WP-Matomo (WP-Piwik) - Version 1.0.20

Version Description

  • Support for new Innocraft cloud URL (*.matomo.cloud)
  • Changed naming from Piwik to Matomo
  • Added City, Type and Model views
  • Bugfix: Avoid warnings on empty results
Download this release

Release Info

Developer Braekling
Plugin Icon 128x128 WP-Matomo (WP-Piwik)
Version 1.0.20
Comparing to
See all releases

Code changes from version 1.0.19 to 1.0.20

Files changed (154) hide show
  1. .gitignore +2 -0
  2. LICENSE +0 -0
  3. README.md +0 -0
  4. bitcoin.png +0 -0
  5. classes/.htaccess +0 -0
  6. classes/WP_Piwik.php +1327 -1322
  7. classes/WP_Piwik/Admin.php +0 -0
  8. classes/WP_Piwik/Admin/Network.php +0 -0
  9. classes/WP_Piwik/Admin/Settings.php +718 -716
  10. classes/WP_Piwik/Admin/Sitebrowser.php +111 -111
  11. classes/WP_Piwik/Admin/Statistics.php +0 -0
  12. classes/WP_Piwik/Logger.php +0 -0
  13. classes/WP_Piwik/Logger/Dummy.php +0 -0
  14. classes/WP_Piwik/Logger/File.php +0 -0
  15. classes/WP_Piwik/Logger/Screen.php +0 -0
  16. classes/WP_Piwik/Request.php +0 -0
  17. classes/WP_Piwik/Request/Php.php +0 -0
  18. classes/WP_Piwik/Request/Rest.php +3 -1
  19. classes/WP_Piwik/Settings.php +407 -406
  20. classes/WP_Piwik/Shortcode.php +0 -0
  21. classes/WP_Piwik/Template.php +0 -0
  22. classes/WP_Piwik/Template/MetaBoxCustomVars.php +0 -0
  23. classes/WP_Piwik/TrackingCode.php +150 -150
  24. classes/WP_Piwik/Widget.php +375 -374
  25. classes/WP_Piwik/Widget/BrowserDetails.php +20 -19
  26. classes/WP_Piwik/Widget/Browsers.php +20 -19
  27. classes/WP_Piwik/Widget/Chart.php +0 -0
  28. classes/WP_Piwik/Widget/City.php +80 -0
  29. classes/WP_Piwik/Widget/Country.php +20 -19
  30. classes/WP_Piwik/Widget/Ecommerce.php +0 -0
  31. classes/WP_Piwik/Widget/Items.php +0 -0
  32. classes/WP_Piwik/Widget/ItemsCategory.php +0 -0
  33. classes/WP_Piwik/Widget/Keywords.php +0 -0
  34. classes/WP_Piwik/Widget/Models.php +80 -0
  35. classes/WP_Piwik/Widget/Noresult.php +6 -5
  36. classes/WP_Piwik/Widget/OptOut.php +3 -0
  37. classes/WP_Piwik/Widget/Overview.php +0 -0
  38. classes/WP_Piwik/Widget/Pages.php +0 -0
  39. classes/WP_Piwik/Widget/Plugins.php +6 -5
  40. classes/WP_Piwik/Widget/Post.php +0 -0
  41. classes/WP_Piwik/Widget/Referrers.php +0 -0
  42. classes/WP_Piwik/Widget/Screens.php +20 -19
  43. classes/WP_Piwik/Widget/Search.php +6 -5
  44. classes/WP_Piwik/Widget/Seo.php +0 -0
  45. classes/WP_Piwik/Widget/SystemDetails.php +20 -19
  46. classes/WP_Piwik/Widget/Systems.php +20 -19
  47. classes/WP_Piwik/Widget/Types.php +80 -0
  48. classes/WP_Piwik/Widget/Visitors.php +20 -19
  49. config.php +8 -8
  50. css/index.php +1 -1
  51. css/wp-piwik-spark.css +2 -2
  52. css/wp-piwik.css +0 -0
  53. gpl-3.0.html +690 -690
  54. index.php +1 -1
  55. js/index.php +1 -1
  56. js/jqplot/IMPORTANT_NOTICE.txt +0 -0
  57. js/jqplot/MIT-LICENSE.txt +0 -0
  58. js/jqplot/README.txt +0 -0
  59. js/jqplot/changes.txt +0 -0
  60. js/jqplot/copyright.txt +0 -0
  61. js/jqplot/excanvas.min.js +2 -2
  62. js/jqplot/gpl-2.0.txt +0 -0
  63. js/jqplot/index.php +1 -1
  64. js/jqplot/jquery.jqplot.min.css +0 -0
  65. js/jqplot/jquery.jqplot.min.js +2 -2
  66. js/jqplot/plugins/jqplot.pieRenderer.min.js +2 -2
  67. js/jqplot/plugins/jqplot.trendline.min.js +2 -2
  68. js/jqplot/usage.txt +0 -0
  69. js/jqplot/wp-piwik.jqplot.js +0 -0
  70. js/sparkline/index.php +1 -1
  71. js/sparkline/jquery.sparkline.js +0 -0
  72. js/sparkline/jquery.sparkline.min.js +0 -0
  73. js/wp-piwik.js +0 -0
  74. languages/.htaccess +0 -0
  75. languages/.tx/config +0 -0
  76. languages/update.sh +0 -0
  77. languages/wp-piwik-az_AZ.mo +0 -0
  78. languages/wp-piwik-az_AZ.po +0 -0
  79. languages/wp-piwik-be_BY.mo +0 -0
  80. languages/wp-piwik-be_BY.po +0 -0
  81. languages/wp-piwik-cs_CZ.mo +0 -0
  82. languages/wp-piwik-cs_CZ.po +0 -0
  83. languages/wp-piwik-de_CH.mo +0 -0
  84. languages/wp-piwik-de_CH.po +0 -0
  85. languages/wp-piwik-de_DE.mo +0 -0
  86. languages/wp-piwik-de_DE.po +0 -0
  87. languages/wp-piwik-el.mo +0 -0
  88. languages/wp-piwik-el.po +0 -0
  89. languages/wp-piwik-el_GR.mo +0 -0
  90. languages/wp-piwik-el_GR.po +0 -0
  91. languages/wp-piwik-es_ES.mo +0 -0
  92. languages/wp-piwik-es_ES.po +0 -0
  93. languages/wp-piwik-fa_IR.mo +0 -0
  94. languages/wp-piwik-fa_IR.po +0 -0
  95. languages/wp-piwik-fr_FR.mo +0 -0
  96. languages/wp-piwik-fr_FR.po +0 -0
  97. languages/wp-piwik-hi.mo +0 -0
  98. languages/wp-piwik-hi.po +0 -0
  99. languages/wp-piwik-hu_HU.mo +0 -0
  100. languages/wp-piwik-hu_HU.po +0 -0
  101. languages/wp-piwik-id.mo +0 -0
  102. languages/wp-piwik-id.po +0 -0
  103. languages/wp-piwik-it_IT.mo +0 -0
  104. languages/wp-piwik-it_IT.po +0 -0
  105. languages/wp-piwik-lb.mo +0 -0
  106. languages/wp-piwik-lb.po +0 -0
  107. languages/wp-piwik-lt_LT.mo +0 -0
  108. languages/wp-piwik-lt_LT.po +0 -0
  109. languages/wp-piwik-nb_NO.mo +0 -0
  110. languages/wp-piwik-nb_NO.po +0 -0
  111. languages/wp-piwik-nl_NL.mo +0 -0
  112. languages/wp-piwik-nl_NL.po +0 -0
  113. languages/wp-piwik-pl_PL.mo +0 -0
  114. languages/wp-piwik-pl_PL.po +0 -0
  115. languages/wp-piwik-pt_BR.mo +0 -0
  116. languages/wp-piwik-pt_BR.po +0 -0
  117. languages/wp-piwik-ro_RO.mo +0 -0
  118. languages/wp-piwik-ro_RO.po +0 -0
  119. languages/wp-piwik-ru_RU.mo +0 -0
  120. languages/wp-piwik-ru_RU.po +0 -0
  121. languages/wp-piwik-sl_SI.mo +0 -0
  122. languages/wp-piwik-sl_SI.po +0 -0
  123. languages/wp-piwik-sq.mo +0 -0
  124. languages/wp-piwik-sq.po +0 -0
  125. languages/wp-piwik-sv_SE.mo +0 -0
  126. languages/wp-piwik-sv_SE.po +0 -0
  127. languages/wp-piwik-tr_TR.mo +0 -0
  128. languages/wp-piwik-tr_TR.po +0 -0
  129. languages/wp-piwik-ua_UA.mo +0 -0
  130. languages/wp-piwik-ua_UA.po +0 -0
  131. languages/wp-piwik-uk_UA.mo +0 -0
  132. languages/wp-piwik-uk_UA.po +0 -0
  133. languages/wp-piwik-zh_CN.mo +0 -0
  134. languages/wp-piwik-zh_CN.po +0 -0
  135. languages/wp-piwik.pot +101 -86
  136. logs/.htaccess +0 -0
  137. proxy/config.php +38 -35
  138. proxy/index.php +1 -1
  139. proxy/piwik.php +0 -0
  140. readme.txt +17 -11
  141. screenshot-1.gif +0 -0
  142. screenshot-2.gif +0 -0
  143. screenshot-3.gif +0 -0
  144. screenshot-4.gif +0 -0
  145. screenshot-5.gif +0 -0
  146. uninstall.php +1 -0
  147. update/.htaccess +0 -0
  148. update/2015051101.php +40 -40
  149. update/2017080701.php +0 -0
  150. update/90001.php +8 -8
  151. update/90801.php +4 -4
  152. update/91006.php +9 -9
  153. wp-piwik.php +83 -83
  154. wpml-config.xml +0 -0
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
1
+
2
+ .idea/
LICENSE CHANGED
File without changes
README.md CHANGED
File without changes
bitcoin.png CHANGED
File without changes
classes/.htaccess CHANGED
File without changes
classes/WP_Piwik.php CHANGED
@@ -1,1322 +1,1327 @@
1
- <?php
2
-
3
- /**
4
- * The main WP-Piwik class configures, registers and manages the plugin
5
- *
6
- * @author Andr&eacute; Br&auml;kling <webmaster@braekling.de>
7
- * @package WP_Piwik
8
- */
9
- class WP_Piwik {
10
-
11
- /**
12
- *
13
- * @var Runtime environment variables
14
- */
15
- private static $revisionId = 2017101501, $version = '1.0.19', $blog_id, $pluginBasename = NULL, $logger, $settings, $request, $optionsPageId;
16
-
17
- /**
18
- * Constructor class to configure and register all WP-Piwik components
19
- */
20
- public function __construct() {
21
- global $blog_id;
22
- self::$blog_id = (isset ( $blog_id ) ? $blog_id : 'n/a');
23
- $this->openLogger ();
24
- $this->openSettings ();
25
- $this->setup ();
26
- $this->addFilters ();
27
- $this->addActions ();
28
- $this->addShortcodes ();
29
- }
30
-
31
- /**
32
- * Destructor class to finish logging
33
- */
34
- public function __destruct() {
35
- $this->closeLogger ();
36
- }
37
-
38
- /**
39
- * Setup class to prepare settings and check for installation and update
40
- */
41
- private function setup() {
42
- self::$pluginBasename = plugin_basename ( __FILE__ );
43
- if (! $this->isInstalled ())
44
- $this->installPlugin ();
45
- elseif ($this->isUpdated ())
46
- $this->updatePlugin ();
47
- if ($this->isConfigSubmitted ())
48
- $this->applySettings ();
49
- self::$settings->save ();
50
- }
51
-
52
- /**
53
- * Register WordPress actions
54
- */
55
- private function addActions() {
56
- if ( is_admin () ) {
57
- add_action ( 'admin_menu', array (
58
- $this,
59
- 'buildAdminMenu'
60
- ) );
61
- add_action ( 'admin_post_save_wp-piwik_stats', array (
62
- $this,
63
- 'onStatsPageSaveChanges'
64
- ) );
65
- add_action ( 'load-post.php', array (
66
- $this,
67
- 'addPostMetaboxes'
68
- ) );
69
- add_action ( 'load-post-new.php', array (
70
- $this,
71
- 'addPostMetaboxes'
72
- ) );
73
- if ($this->isNetworkMode ()) {
74
- add_action ( 'network_admin_notices', array (
75
- $this,
76
- 'showNotices'
77
- ) );
78
- add_action ( 'network_admin_menu', array (
79
- $this,
80
- 'buildNetworkAdminMenu'
81
- ) );
82
- add_action ( 'update_site_option_blogname', array (
83
- $this,
84
- 'onBlogNameChange'
85
- ) );
86
- add_action ( 'update_site_option_siteurl', array (
87
- $this,
88
- 'onSiteUrlChange'
89
- ) );
90
- } else {
91
- add_action ( 'admin_notices', array (
92
- $this,
93
- 'showNotices'
94
- ) );
95
- add_action ( 'update_option_blogname', array (
96
- $this,
97
- 'onBlogNameChange'
98
- ) );
99
- add_action ( 'update_option_siteurl', array (
100
- $this,
101
- 'onSiteUrlChange'
102
- ) );
103
- }
104
- if ($this->isDashboardActive ())
105
- add_action ( 'wp_dashboard_setup', array (
106
- $this,
107
- 'extendWordPressDashboard'
108
- ) );
109
- }
110
- if ($this->isToolbarActive ()) {
111
- add_action ( is_admin () ? 'admin_head' : 'wp_head', array (
112
- $this,
113
- 'loadToolbarRequirements'
114
- ) );
115
- add_action ( 'admin_bar_menu', array (
116
- $this,
117
- 'extendWordPressToolbar'
118
- ), 1000 );
119
- }
120
- if ($this->isTrackingActive ()) {
121
- if ( !is_admin () || $this->isAdminTrackingActive ()) {
122
- $prefix = is_admin ()?'admin':'wp';
123
- add_action ( self::$settings->getGlobalOption ( 'track_codeposition' ) == 'footer' ? $prefix.'_footer' : $prefix.'_head', array (
124
- $this,
125
- 'addJavascriptCode'
126
- ) );
127
- if (self::$settings->getGlobalOption ( 'dnsprefetch' ))
128
- add_action ( $prefix.'_head', array (
129
- $this,
130
- 'addDNSPrefetchTag'
131
- ) );
132
- if ($this->isAddNoScriptCode ())
133
- add_action ( $prefix.'_footer', array (
134
- $this,
135
- 'addNoscriptCode'
136
- ) );
137
- }
138
- if (self::$settings->getGlobalOption ( 'add_post_annotations' ))
139
- add_action ( 'transition_post_status', array (
140
- $this,
141
- 'addPiwikAnnotation'
142
- ), 10, 3 );
143
- }
144
-
145
- }
146
-
147
- /**
148
- * Register WordPress filters
149
- */
150
- private function addFilters() {
151
- if (is_admin()) {
152
- add_filter ( 'plugin_row_meta', array (
153
- $this,
154
- 'setPluginMeta'
155
- ), 10, 2 );
156
- add_filter ( 'screen_layout_columns', array (
157
- $this,
158
- 'onScreenLayoutColumns'
159
- ), 10, 2 );
160
- } elseif ($this->isTrackingActive ()) {
161
- if ($this->isTrackFeed ()) {
162
- add_filter ( 'the_excerpt_rss', array (
163
- $this,
164
- 'addFeedTracking'
165
- ) );
166
- add_filter ( 'the_content', array (
167
- $this,
168
- 'addFeedTracking'
169
- ) );
170
- }
171
- if ($this->isAddFeedCampaign ()) {
172
- add_filter ( 'post_link', array (
173
- $this,
174
- 'addFeedCampaign'
175
- ) );
176
- }
177
- if ($this->isCrossDomainLinkingEnabled ()) {
178
- add_filter ( 'wp_redirect', array (
179
- $this,
180
- 'forwardCrossDomainVisitorId'
181
- ) );
182
- }
183
- }
184
- }
185
-
186
- /**
187
- * Register WordPress shortcodes
188
- */
189
- private function addShortcodes() {
190
- if ($this->isAddShortcode ())
191
- add_shortcode ( 'wp-piwik', array (
192
- $this,
193
- 'shortcode'
194
- ) );
195
- }
196
-
197
- /**
198
- * Install WP-Piwik for the first time
199
- */
200
- private function installPlugin($isUpdate = false) {
201
- self::$logger->log ( 'Running WP-Piwik installation' );
202
- if (! $isUpdate)
203
- $this->addNotice ( 'install', sprintf ( __ ( '%s %s installed.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$version ), __ ( 'Next you should connect to Piwik', 'wp-piwik' ) );
204
- self::$settings->setGlobalOption ( 'revision', self::$revisionId );
205
- self::$settings->setGlobalOption ( 'last_settings_update', time () );
206
- }
207
-
208
- /**
209
- * Uninstall WP-Piwik
210
- */
211
- public static function uninstallPlugin() {
212
- self::$logger->log ( 'Running WP-Piwik uninstallation' );
213
- if (! defined ( 'WP_UNINSTALL_PLUGIN' ))
214
- exit ();
215
- $this->deleteWordPressOption ( 'wp-piwik-notices' );
216
- self::$settings->resetSettings ( true );
217
- }
218
-
219
- /**
220
- * Update WP-Piwik
221
- */
222
- private function updatePlugin() {
223
- self::$logger->log ( 'Upgrade WP-Piwik to ' . self::$version );
224
- $patches = glob ( dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'update' . DIRECTORY_SEPARATOR . '*.php' );
225
- $isPatched = false;
226
- if (is_array ( $patches )) {
227
- sort ( $patches );
228
- foreach ( $patches as $patch ) {
229
- $patchVersion = ( int ) pathinfo ( $patch, PATHINFO_FILENAME );
230
- if ($patchVersion && self::$settings->getGlobalOption ( 'revision' ) < $patchVersion) {
231
- self::includeFile ( 'update' . DIRECTORY_SEPARATOR . $patchVersion );
232
- $isPatched = true;
233
- }
234
- }
235
- }
236
- if ((self::$settings->getGlobalOption('update_notice') == 'enabled') || ((self::$settings->getGlobalOption('update_notice') == 'script') && $isPatched))
237
- $this->addNotice ( 'update', sprintf ( __ ( '%s updated to %s.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$version ), __ ( 'Please validate your configuration', 'wp-piwik' ) );
238
- $this->installPlugin ( true );
239
- }
240
-
241
- /**
242
- * Define a notice
243
- *
244
- * @param string $type
245
- * identifier
246
- * @param string $subject
247
- * notice headline
248
- * @param string $text
249
- * notice content
250
- * @param boolean $stay
251
- * set to true if the message should persist (default: false)
252
- */
253
- private function addNotice($type, $subject, $text, $stay = false) {
254
- $notices = $this->getWordPressOption ( 'wp-piwik-notices', array () );
255
- $notices [$type] = array (
256
- 'subject' => $subject,
257
- 'text' => $text,
258
- 'stay' => $stay
259
- );
260
- $this->updateWordPressOption ( 'wp-piwik-notices', $notices );
261
- }
262
-
263
- /**
264
- * Show all notices defined previously
265
- *
266
- * @see addNotice()
267
- */
268
- public function showNotices() {
269
- $link = sprintf ( '<a href="' . $this->getSettingsURL () . '">%s</a>', __ ( 'Settings', 'wp-piwik' ) );
270
- if ($notices = $this->getWordPressOption ( 'wp-piwik-notices' )) {
271
- foreach ( $notices as $type => $notice ) {
272
- printf ( '<div class="updated fade"><p>%s <strong>%s:</strong> %s: %s</p></div>', $notice ['subject'], __ ( 'Important', 'wp-piwik' ), $notice ['text'], $link );
273
- if (! $notice ['stay'])
274
- unset ( $notices [$type] );
275
- }
276
- }
277
- $this->updateWordPressOption ( 'wp-piwik-notices', $notices );
278
- }
279
-
280
- /**
281
- * Get the settings page URL
282
- *
283
- * @return string settings page URL
284
- */
285
- private function getSettingsURL() {
286
- return (self::$settings->checkNetworkActivation () ? 'settings' : 'options-general') . '.php?page=' . self::$pluginBasename;
287
- }
288
-
289
- /**
290
- * Echo javascript tracking code
291
- */
292
- public function addJavascriptCode() {
293
- if ($this->isHiddenUser ()) {
294
- self::$logger->log ( 'Do not add tracking code to site (user should not be tracked) Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
295
- return;
296
- }
297
- $trackingCode = new WP_Piwik\TrackingCode ( $this );
298
- $trackingCode->is404 = (is_404 () && self::$settings->getGlobalOption ( 'track_404' ));
299
- $trackingCode->isUsertracking = self::$settings->getGlobalOption ( 'track_user_id' ) != 'disabled';
300
- $trackingCode->isSearch = (is_search () && self::$settings->getGlobalOption ( 'track_search' ));
301
- self::$logger->log ( 'Add tracking code. Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
302
- if ($this->isNetworkMode () && self::$settings->getGlobalOption ( 'track_mode' ) == 'manually') {
303
- $siteId = $this->getPiwikSiteId ();
304
- if ($siteId != 'n/a')
305
- echo str_replace ( '{ID}', $siteId, $trackingCode->getTrackingCode () );
306
- else
307
- echo '<!-- Site will be created and tracking code added on next request -->';
308
- } else
309
- echo $trackingCode->getTrackingCode ();
310
- }
311
-
312
- /**
313
- * Echo DNS prefetch tag
314
- */
315
- public function addDNSPrefetchTag() {
316
- echo '<link rel="dns-prefetch" href="'.$this->getPiwikDomain().'" />';
317
- }
318
-
319
- /**
320
- * Get Piwik Domain
321
- */
322
- public function getPiwikDomain() {
323
- switch (self::$settings->getGlobalOption ( 'piwik_mode' )) {
324
- case 'php' :
325
- return '//' . parse_url(self::$settings->getGlobalOption ( 'proxy_url' ), PHP_URL_HOST);
326
- case 'cloud' :
327
- return '//' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud';
328
- default :
329
- return '//' . parse_url(self::$settings->getGlobalOption ( 'piwik_url' ), PHP_URL_HOST);
330
- }
331
- }
332
-
333
- /**
334
- * Echo noscript tracking code
335
- */
336
- public function addNoscriptCode() {
337
- if (self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy')
338
- return;
339
- if ($this->isHiddenUser ()) {
340
- self::$logger->log ( 'Do not add noscript code to site (user should not be tracked) Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
341
- return;
342
- }
343
- self::$logger->log ( 'Add noscript code. Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
344
- echo self::$settings->getOption ( 'noscript_code' ) . "\n";
345
- }
346
-
347
- /**
348
- * Register post view meta boxes
349
- */
350
- public function addPostMetaboxes() {
351
- if (self::$settings->getGlobalOption ( 'add_customvars_box' )) {
352
- add_action ( 'add_meta_boxes', array (
353
- new WP_Piwik\Template\MetaBoxCustomVars ( $this, self::$settings ),
354
- 'addMetabox'
355
- ) );
356
- add_action ( 'save_post', array (
357
- new WP_Piwik\Template\MetaBoxCustomVars ( $this, self::$settings ),
358
- 'saveCustomVars'
359
- ), 10, 2 );
360
- }
361
- if (self::$settings->getGlobalOption ( 'perpost_stats' )) {
362
- add_action ( 'add_meta_boxes', array (
363
- $this,
364
- 'onloadPostPage'
365
- ) );
366
- }
367
- }
368
-
369
- /**
370
- * Register admin menu components
371
- */
372
- public function buildAdminMenu() {
373
- if (self::isConfigured ()) {
374
- $cap = 'wp-piwik_read_stats';
375
- if (self::$settings->checkNetworkActivation ()) {
376
- global $current_user;
377
- $userRoles = $current_user->roles;
378
- $allowed = self::$settings->getGlobalOption ( 'capability_read_stats' );
379
- if (is_array($userRoles) && is_array($allowed))
380
- foreach ($userRoles as $userRole)
381
- if (isset( $allowed[$userRole] ) && $allowed[$userRole]) {
382
- $cap = 'read';
383
- break;
384
- }
385
- }
386
- $statsPage = new WP_Piwik\Admin\Statistics ( $this, self::$settings );
387
- $this->statsPageId = add_dashboard_page ( __ ( 'Piwik Statistics', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), $cap, 'wp-piwik_stats', array (
388
- $statsPage,
389
- 'show'
390
- ) );
391
- $this->loadAdminStatsHeader ( $this->statsPageId, $statsPage );
392
- }
393
- if (! self::$settings->checkNetworkActivation ()) {
394
- $optionsPage = new WP_Piwik\Admin\Settings ( $this, self::$settings );
395
- self::$optionsPageId = add_options_page ( self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'activate_plugins', __FILE__, array (
396
- $optionsPage,
397
- 'show'
398
- ) );
399
- $this->loadAdminSettingsHeader ( self::$optionsPageId, $optionsPage );
400
- }
401
- }
402
-
403
- /**
404
- * Register network admin menu components
405
- */
406
- public function buildNetworkAdminMenu() {
407
- if (self::isConfigured ()) {
408
- $statsPage = new WP_Piwik\Admin\Network ( $this, self::$settings );
409
- $this->statsPageId = add_dashboard_page ( __ ( 'Piwik Statistics', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'manage_sites', 'wp-piwik_stats', array (
410
- $statsPage,
411
- 'show'
412
- ) );
413
- $this->loadAdminStatsHeader ( $this->statsPageId, $statsPage );
414
- }
415
- $optionsPage = new WP_Piwik\Admin\Settings ( $this, self::$settings );
416
- self::$optionsPageId = add_submenu_page ( 'settings.php', self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'manage_sites', __FILE__, array (
417
- $optionsPage,
418
- 'show'
419
- ) );
420
- $this->loadAdminSettingsHeader ( self::$optionsPageId, $optionsPage );
421
- }
422
-
423
- /**
424
- * Register admin header extensions for stats page
425
- *
426
- * @param $optionsPageId options
427
- * page id
428
- * @param $optionsPage options
429
- * page object
430
- */
431
- public function loadAdminStatsHeader($statsPageId, $statsPage) {
432
- add_action ( 'admin_print_scripts-' . $statsPageId, array (
433
- $statsPage,
434
- 'printAdminScripts'
435
- ) );
436
- add_action ( 'admin_print_styles-' . $statsPageId, array (
437
- $statsPage,
438
- 'printAdminStyles'
439
- ) );
440
- add_action ( 'admin_head-' . $statsPageId, array (
441
- $statsPage,
442
- 'extendAdminHeader'
443
- ) );
444
- add_action ( 'load-' . $statsPageId, array (
445
- $this,
446
- 'onloadStatsPage'
447
- ) );
448
- }
449
-
450
- /**
451
- * Register admin header extensions for settings page
452
- *
453
- * @param $optionsPageId options
454
- * page id
455
- * @param $optionsPage options
456
- * page object
457
- */
458
- public function loadAdminSettingsHeader($optionsPageId, $optionsPage) {
459
- add_action ( 'admin_head-' . $optionsPageId, array (
460
- $optionsPage,
461
- 'extendAdminHeader'
462
- ) );
463
- add_action ( 'admin_print_styles-' . $optionsPageId, array (
464
- $optionsPage,
465
- 'printAdminStyles'
466
- ) );
467
- }
468
-
469
- /**
470
- * Register WordPress dashboard widgets
471
- */
472
- public function extendWordPressDashboard() {
473
- if (current_user_can ( 'wp-piwik_read_stats' )) {
474
- if (self::$settings->getGlobalOption ( 'dashboard_widget' ) != 'disabled')
475
- new WP_Piwik\Widget\Overview ( $this, self::$settings, 'dashboard', 'side', 'default', array (
476
- 'date' => self::$settings->getGlobalOption ( 'dashboard_widget' ),
477
- 'period' => 'day'
478
- ) );
479
- if (self::$settings->getGlobalOption ( 'dashboard_chart' ))
480
- new WP_Piwik\Widget\Chart ( $this, self::$settings );
481
- if (self::$settings->getGlobalOption ( 'dashboard_ecommerce' ))
482
- new WP_Piwik\Widget\Ecommerce ( $this, self::$settings );
483
- if (self::$settings->getGlobalOption ( 'dashboard_seo' ))
484
- new WP_Piwik\Widget\Seo ( $this, self::$settings );
485
- }
486
- }
487
-
488
- /**
489
- * Register WordPress toolbar components
490
- */
491
- public function extendWordPressToolbar($toolbar) {
492
- if (current_user_can ( 'wp-piwik_read_stats' ) && is_admin_bar_showing ()) {
493
- $id = WP_Piwik\Request::register ( 'VisitsSummary.getUniqueVisitors', array (
494
- 'period' => 'day',
495
- 'date' => 'last30'
496
- ) );
497
- $unique = $this->request ( $id );
498
- $url = is_network_admin () ? $this->getSettingsURL () : false;
499
- $content = is_network_admin () ? __('Configure WP-Piwik', 'wp-piwik') : '';
500
- // Leave if result array does contain a message instead of valid data
501
- if (isset($unique['result']))
502
- $content .= '<!-- '.$unique['result'].': '.($unique['message']?$unique['message']:'...').' -->';
503
- elseif (is_array ( $unique ) ) {
504
- $content = "<script type='text/javascript'>var \$jSpark = jQuery.noConflict();\$jSpark(function() {var piwikSparkVals=[" . implode ( ',', $unique ) . "];\$jSpark('.wp-piwik_dynbar').sparkline(piwikSparkVals, {type: 'bar', barColor: '#ccc', barWidth:2});});</script><span class='wp-piwik_dynbar'>Loading...</span>";
505
- $url = $this->getStatsURL ();
506
- }
507
- $toolbar->add_menu ( array (
508
- 'id' => 'wp-piwik_stats',
509
- 'title' => $content,
510
- 'href' => $url
511
- ) );
512
- }
513
- }
514
-
515
- /**
516
- * Add plugin meta data
517
- *
518
- * @param array $links
519
- * list of already defined plugin meta data
520
- * @param string $file
521
- * handled file
522
- * @return array complete list of plugin meta data
523
- */
524
- public function setPluginMeta($links, $file) {
525
- if ($file == 'wp-piwik/wp-piwik.php' && (!$this->isNetworkMode () || is_network_admin()) )
526
- return array_merge ( $links, array (
527
- sprintf ( '<a href="%s">%s</a>', self::getSettingsURL (), __ ( 'Settings', 'wp-piwik' ) )
528
- ) );
529
- return $links;
530
- }
531
-
532
- /**
533
- * Prepare toolbar widget requirements
534
- */
535
- public function loadToolbarRequirements() {
536
- if (is_admin_bar_showing ()) {
537
- wp_enqueue_script ( 'wp-piwik-sparkline', $this->getPluginURL () . 'js/sparkline/jquery.sparkline.min.js', array (
538
- 'jquery'
539
- ), self::$version );
540
- wp_enqueue_style ( 'wp-piwik', $this->getPluginURL () . 'css/wp-piwik-spark.css', array (), $this->getPluginVersion () );
541
- }
542
- }
543
-
544
- /**
545
- * Add tracking pixels to feed content
546
- *
547
- * @param string $content
548
- * post content
549
- * @return string post content extended by tracking pixel
550
- */
551
- public function addFeedTracking($content) {
552
- global $post;
553
- if (is_feed ()) {
554
- self::$logger->log ( 'Add tracking image to feed entry.' );
555
- if (! self::$settings->getOption ( 'site_id' )) {
556
- $siteId = $this->requestPiwikSiteId ();
557
- if ($siteId != 'n/a')
558
- self::$settings->setOption ( 'site_id', $siteId );
559
- else
560
- return false;
561
- }
562
- $title = the_title ( null, null, false );
563
- $posturl = get_permalink ( $post->ID );
564
- $urlref = get_bloginfo ( 'rss2_url' );
565
- if (self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy')
566
- $url = plugins_url ( 'wp-piwik' ) . '/proxy/piwik.php';
567
- else {
568
- $url = self::$settings->getGlobalOption ( 'piwik_url' );
569
- if (substr($url, -10, 10) == '/index.php')
570
- $url = str_replace('/index.php', '/piwik.php', $url);
571
- else
572
- $url .= 'piwik.php';
573
- }
574
- $trackingImage = $url . '?idsite=' . self::$settings->getOption ( 'site_id' ) . '&amp;rec=1&amp;url=' . urlencode ( $posturl ) . '&amp;action_name=' . urlencode ( $title ) . '&amp;urlref=' . urlencode ( $urlref );
575
- $content .= '<img src="' . $trackingImage . '" style="border:0;width:0;height:0" width="0" height="0" alt="" />';
576
- }
577
- return $content;
578
- }
579
-
580
- /**
581
- * Add a campaign parameter to feed permalink
582
- *
583
- * @param string $permalink
584
- * permalink
585
- * @return string permalink extended by campaign parameter
586
- */
587
- public function addFeedCampaign($permalink) {
588
- global $post;
589
- if (is_feed ()) {
590
- self::$logger->log ( 'Add campaign to feed permalink.' );
591
- $sep = (strpos ( $permalink, '?' ) === false ? '?' : '&');
592
- $permalink .= $sep . 'pk_campaign=' . urlencode ( self::$settings->getGlobalOption ( 'track_feed_campaign' ) ) . '&pk_kwd=' . urlencode ( $post->post_name );
593
- }
594
- return $permalink;
595
- }
596
-
597
- /**
598
- * Forwards the cross domain parameter pk_vid if the URL parameter is set and a user is about to be redirected.
599
- * When another website links to WooCommerce with a pk_vid parameter, and WooCommerce redirects the user to another
600
- * URL, the pk_vid parameter would get lost and the visitorId would later not be applied by the tracking code
601
- * due to the lost pk_vid URL parameter. If the URL parameter is set, we make sure to forward this parameter.
602
- *
603
- * @param string $location
604
- *
605
- * @return string location extended by pk_vid URL parameter if the URL parameter is set
606
- */
607
- public function forwardCrossDomainVisitorId($location) {
608
-
609
- if (!empty($_GET['pk_vid'])
610
- && preg_match('/^[a-zA-Z0-9]{24,48}$/', $_GET['pk_vid'])) {
611
- // currently, the pk_vid parameter is 32 characters long, but it may vary over time.
612
- $location = add_query_arg( 'pk_vid', $_GET['pk_vid'], $location );
613
- }
614
-
615
- return $location;
616
- }
617
-
618
- /**
619
- * Apply settings update
620
- *
621
- * @return boolean settings update applied
622
- */
623
- private function applySettings() {
624
- self::$settings->applyChanges ( $_POST ['wp-piwik'] );
625
- if (self::$settings->getGlobalOption ( 'auto_site_config' ) && self::isConfigured ()) {
626
- if ($this->isPHPMode () && ! defined ( 'PIWIK_INCLUDE_PATH' ))
627
- self::definePiwikConstants ();
628
- $siteId = $this->getPiwikSiteId ();
629
- $trackingCode = $this->updateTrackingCode ( $siteId );
630
- self::$settings->setOption ( 'site_id', $siteId );
631
- }
632
- self::$settings->setGlobalOption ( 'revision', self::$revisionId );
633
- self::$settings->setGlobalOption ( 'last_settings_update', time () );
634
- return true;
635
- }
636
-
637
- /**
638
- * Check if WP-Piwik is configured
639
- *
640
- * @return boolean Is WP-Piwik configured?
641
- */
642
- public static function isConfigured() {
643
- return (self::$settings->getGlobalOption ( 'piwik_token' ) && (self::$settings->getGlobalOption ( 'piwik_mode' ) != 'disabled') && (((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'http') && (self::$settings->getGlobalOption ( 'piwik_url' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'php') && (self::$settings->getGlobalOption ( 'piwik_path' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud') && (self::$settings->getGlobalOption ( 'piwik_user' )))));
644
- }
645
-
646
- /**
647
- * Check if WP-Piwik was updated
648
- *
649
- * @return boolean Was WP-Piwik updated?
650
- */
651
- private function isUpdated() {
652
- return self::$settings->getGlobalOption ( 'revision' ) && self::$settings->getGlobalOption ( 'revision' ) < self::$revisionId;
653
- }
654
-
655
- /**
656
- * Check if WP-Piwik is already installed
657
- *
658
- * @return boolean Is WP-Piwik installed?
659
- */
660
- private function isInstalled() {
661
- $oldSettings = $this->getWordPressOption ( 'wp-piwik_global-settings', false );
662
- if ($oldSettings && isset( $oldSettings['revision'] )) {
663
- self::log('Save old settings');
664
- self::$settings->setGlobalOption ( 'revision', $oldSettings['revision'] );
665
- } else self::log( 'Current revision '.self::$settings->getGlobalOption ( 'revision' ) );
666
- return self::$settings->getGlobalOption ( 'revision' ) > 0;
667
- }
668
-
669
- /**
670
- * Check if new settings were submitted
671
- *
672
- * @return boolean Are new settings submitted?
673
- */
674
- public static function isConfigSubmitted() {
675
- return isset ( $_POST ) && isset ( $_POST ['wp-piwik'] ) && self::isValidOptionsPost();
676
- }
677
-
678
- /**
679
- * Check if PHP mode is chosen
680
- *
681
- * @return Is PHP mode chosen?
682
- */
683
- public function isPHPMode() {
684
- return self::$settings->getGlobalOption ( 'piwik_mode' ) && self::$settings->getGlobalOption ( 'piwik_mode' ) == 'php';
685
- }
686
-
687
- /**
688
- * Check if WordPress is running in network mode
689
- *
690
- * @return boolean Is WordPress running in network mode?
691
- */
692
- public function isNetworkMode() {
693
- return self::$settings->checkNetworkActivation ();
694
- }
695
-
696
- /**
697
- * Check if a WP-Piwik dashboard widget is enabled
698
- *
699
- * @return boolean Is a dashboard widget enabled?
700
- */
701
- private function isDashboardActive() {
702
- return self::$settings->getGlobalOption ( 'dashboard_widget' ) || self::$settings->getGlobalOption ( 'dashboard_chart' ) || self::$settings->getGlobalOption ( 'dashboard_seo' );
703
- }
704
-
705
- /**
706
- * Check if a WP-Piwik toolbar widget is enabled
707
- *
708
- * @return boolean Is a toolbar widget enabled?
709
- */
710
- private function isToolbarActive() {
711
- return self::$settings->getGlobalOption ( 'toolbar' );
712
- }
713
-
714
- /**
715
- * Check if WP-Piwik tracking code insertion is enabled
716
- *
717
- * @return boolean Insert tracking code?
718
- */
719
- private function isTrackingActive() {
720
- return self::$settings->getGlobalOption ( 'track_mode' ) != 'disabled';
721
- }
722
-
723
- /**
724
- * Check if admin tracking is enabled
725
- *
726
- * @return boolean Is admin tracking enabled?
727
- */
728
- private function isAdminTrackingActive() {
729
- return self::$settings->getGlobalOption ( 'track_admin' ) && is_admin ();
730
- }
731
-
732
- /**
733
- * Check if WP-Piwik noscript code insertion is enabled
734
- *
735
- * @return boolean Insert noscript code?
736
- */
737
- private function isAddNoScriptCode() {
738
- return self::$settings->getGlobalOption ( 'track_noscript' );
739
- }
740
-
741
- /**
742
- * Check if feed tracking is enabled
743
- *
744
- * @return boolean Is feed tracking enabled?
745
- */
746
- private function isTrackFeed() {
747
- return self::$settings->getGlobalOption ( 'track_feed' );
748
- }
749
-
750
- /**
751
- * Check if feed permalinks get a campaign parameter
752
- *
753
- * @return boolean Add campaign parameter to feed permalinks?
754
- */
755
- private function isAddFeedCampaign() {
756
- return self::$settings->getGlobalOption ( 'track_feed_addcampaign' );
757
- }
758
-
759
- /**
760
- * Check if feed permalinks get a campaign parameter
761
- *
762
- * @return boolean Add campaign parameter to feed permalinks?
763
- */
764
- private function isCrossDomainLinkingEnabled() {
765
- return self::$settings->getGlobalOption ( 'track_crossdomain_linking' );
766
- }
767
-
768
- /**
769
- * Check if WP-Piwik shortcodes are enabled
770
- *
771
- * @return boolean Are shortcodes enabled?
772
- */
773
- private function isAddShortcode() {
774
- return self::$settings->getGlobalOption ( 'shortcodes' );
775
- }
776
-
777
- /**
778
- * Define Piwik constants for PHP reporting API
779
- */
780
- public static function definePiwikConstants() {
781
- if (! defined ( 'PIWIK_INCLUDE_PATH' )) {
782
- //@header('Content-type: text/html');
783
- define ( 'PIWIK_INCLUDE_PATH', self::$settings->getGlobalOption ( 'piwik_path' ) );
784
- define ( 'PIWIK_USER_PATH', self::$settings->getGlobalOption ( 'piwik_path' ) );
785
- define ( 'PIWIK_ENABLE_DISPATCH', false );
786
- define ( 'PIWIK_ENABLE_ERROR_HANDLER', false );
787
- define ( 'PIWIK_ENABLE_SESSION_START', false );
788
- }
789
- }
790
-
791
- /**
792
- * Start chosen logging method
793
- */
794
- private function openLogger() {
795
- switch (WP_PIWIK_ACTIVATE_LOGGER) {
796
- case 1 :
797
- self::$logger = new WP_Piwik\Logger\Screen ( __CLASS__ );
798
- break;
799
- case 2 :
800
- self::$logger = new WP_Piwik\Logger\File ( __CLASS__ );
801
- break;
802
- default :
803
- self::$logger = new WP_Piwik\Logger\Dummy ( __CLASS__ );
804
- }
805
- }
806
-
807
- /**
808
- * Log a message
809
- *
810
- * @param string $message
811
- * logger message
812
- */
813
- public static function log($message) {
814
- self::$logger->log ( $message );
815
- }
816
-
817
- /**
818
- * End logging
819
- */
820
- private function closeLogger() {
821
- self::$logger = null;
822
- }
823
-
824
- /**
825
- * Load WP-Piwik settings
826
- */
827
- private function openSettings() {
828
- self::$settings = new WP_Piwik\Settings ( $this, self::$logger );
829
- if (! $this->isConfigSubmitted () && $this->isPHPMode () && ! defined ( 'PIWIK_INCLUDE_PATH' ))
830
- self::definePiwikConstants ();
831
- }
832
-
833
- /**
834
- * Include a WP-Piwik file
835
- */
836
- private function includeFile($strFile) {
837
- self::$logger->log ( 'Include ' . $strFile . '.php' );
838
- if (WP_PIWIK_PATH . $strFile . '.php')
839
- include (WP_PIWIK_PATH . $strFile . '.php');
840
- }
841
-
842
- /**
843
- * Check if user should not be tracked
844
- *
845
- * @return boolean Do not track user?
846
- */
847
- private function isHiddenUser() {
848
- if (is_multisite ())
849
- foreach ( self::$settings->getGlobalOption ( 'capability_stealth' ) as $key => $val )
850
- if ($val && current_user_can ( $key ))
851
- return true;
852
- return current_user_can ( 'wp-piwik_stealth' );
853
- }
854
-
855
- /**
856
- * Check if tracking code is up to date
857
- *
858
- * @return boolean Is tracking code up to date?
859
- */
860
- public function isCurrentTrackingCode() {
861
- return (self::$settings->getOption ( 'last_tracking_code_update' ) && self::$settings->getOption ( 'last_tracking_code_update' ) > self::$settings->getGlobalOption ( 'last_settings_update' ));
862
- }
863
-
864
- /**
865
- * DEPRECTAED Add javascript code to site header
866
- *
867
- * @deprecated
868
- *
869
- */
870
- public function site_header() {
871
- self::$logger->log ( 'Using deprecated function site_header' );
872
- $this->addJavascriptCode ();
873
- }
874
-
875
- /**
876
- * DEPRECTAED Add javascript code to site footer
877
- *
878
- * @deprecated
879
- *
880
- */
881
- public function site_footer() {
882
- self::$logger->log ( 'Using deprecated function site_footer' );
883
- $this->addNoscriptCode ();
884
- }
885
-
886
- /**
887
- * Identify new posts if an annotation is required
888
- * and create Piwik annotation
889
- *
890
- * @param string $newStatus
891
- * new post status
892
- * @param strint $oldStatus
893
- * new post status
894
- * @param object $post
895
- * current post object
896
- */
897
- public function addPiwikAnnotation($newStatus, $oldStatus, $post) {
898
- $enabledPostTypes = self::$settings->getGlobalOption ( 'add_post_annotations' );
899
- if (isset($enabledPostTypes[$post->post_type]) && $enabledPostTypes[$post->post_type] && $newStatus == 'publish' && $oldStatus != 'publish') {
900
- $note = 'Published: ' . $post->post_title . ' - URL: ' . get_permalink ( $post->ID );
901
- $id = WP_Piwik\Request::register ( 'Annotations.add', array (
902
- 'idSite' => $this->getPiwikSiteId (),
903
- 'date' => date ( 'Y-m-d' ),
904
- 'note' => $note
905
- ) );
906
- $result = $this->request ( $id );
907
- self::$logger->log ( 'Add post annotation. ' . $note . ' - ' . serialize ( $result ) );
908
- }
909
- }
910
-
911
- /**
912
- * Get WP-Piwik's URL
913
- */
914
- public function getPluginURL() {
915
- return trailingslashit ( plugins_url () . '/wp-piwik/' );
916
- }
917
-
918
- /**
919
- * Get WP-Piwik's version
920
- */
921
- public function getPluginVersion() {
922
- return self::$version;
923
- }
924
-
925
- /**
926
- * Enable three columns for WP-Piwik stats screen
927
- *
928
- * @param
929
- * array full list of column settings
930
- * @param
931
- * mixed current screen id
932
- * @return array updated list of column settings
933
- */
934
- public function onScreenLayoutColumns($columns, $screen) {
935
- if (isset( $this->statsPageId ) && $screen == $this->statsPageId)
936
- $columns [$this->statsPageId] = 3;
937
- return $columns;
938
- }
939
-
940
- /**
941
- * Add tracking code to admin header
942
- */
943
- function addAdminHeaderTracking() {
944
- $this->addJavascriptCode ();
945
- }
946
-
947
- /**
948
- * Get option value
949
- *
950
- * @param string $key
951
- * option key
952
- * @return mixed option value
953
- */
954
- public function getOption($key) {
955
- return self::$settings->getOption ( $key );
956
- }
957
-
958
- /**
959
- * Get global option value
960
- *
961
- * @param string $key
962
- * global option key
963
- * @return mixed global option value
964
- */
965
- public function getGlobalOption($key) {
966
- return self::$settings->getGlobalOption ( $key );
967
- }
968
-
969
- /**
970
- * Get stats page URL
971
- *
972
- * @return string stats page URL
973
- */
974
- public function getStatsURL() {
975
- return admin_url () . '?page=wp-piwik_stats';
976
- }
977
-
978
- /**
979
- * Execute WP-Piwik test script
980
- */
981
- private function loadTestscript() {
982
- $this->includeFile ( 'debug' . DIRECTORY_SEPARATOR . 'testscript' );
983
- }
984
-
985
- /**
986
- * Echo an error message
987
- *
988
- * @param string $message
989
- * message content
990
- */
991
- private static function showErrorMessage($message) {
992
- echo '<strong class="wp-piwik-error">' . __ ( 'An error occured', 'wp-piwik' ) . ':</strong> ' . $message . ' [<a href="' . (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general') . '.php?page=wp-piwik/classes/WP_Piwik.php&tab=support">' . __ ( 'Support', 'wp-piwik' ) . '</a>]';
993
- }
994
-
995
- /**
996
- * Perform a Piwik request
997
- *
998
- * @param string $id
999
- * request ID
1000
- * @return mixed request result
1001
- */
1002
- public function request($id, $debug = false) {
1003
- if ( self::$settings->getGlobalOption ( 'piwik_mode' ) == 'disabled' )
1004
- return 'n/a';
1005
- if (! isset ( self::$request ) || empty ( self::$request ))
1006
- self::$request = (self::$settings->getGlobalOption ( 'piwik_mode' ) == 'http' || self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud' ? new WP_Piwik\Request\Rest ( $this, self::$settings ) : new WP_Piwik\Request\Php ( $this, self::$settings ));
1007
- if ($debug)
1008
- return self::$request->getDebug ( $id );
1009
- return self::$request->perform ( $id );
1010
- }
1011
-
1012
- /**
1013
- * Reset request object
1014
- */
1015
- public function resetRequest() {
1016
- if (is_object(self::$request))
1017
- self::$request->reset();
1018
- self::$request = NULL;
1019
- }
1020
-
1021
- /**
1022
- * Execute WP-Piwik shortcode
1023
- *
1024
- * @param array $attributes
1025
- * attribute list
1026
- */
1027
- public function shortcode($attributes) {
1028
- shortcode_atts ( array (
1029
- 'title' => '',
1030
- 'module' => 'overview',
1031
- 'period' => 'day',
1032
- 'date' => 'yesterday',
1033
- 'limit' => 10,
1034
- 'width' => '100%',
1035
- 'height' => '200px',
1036
- 'idsite' => '',
1037
- 'language' => 'en',
1038
- 'range' => false,
1039
- 'key' => 'sum_daily_nb_uniq_visitors'
1040
- ), $attributes );
1041
- $shortcodeObject = new \WP_Piwik\Shortcode ( $attributes, $this, self::$settings );
1042
- return $shortcodeObject->get();
1043
- }
1044
-
1045
- /**
1046
- * Get Piwik site ID by blog ID
1047
- *
1048
- * @param int $blogId
1049
- * which blog's Piwik site ID to get, default is the current blog
1050
- * @return mixed Piwik site ID or n/a
1051
- */
1052
- public function getPiwikSiteId($blogId = null) {
1053
- if (! $blogId && $this->isNetworkMode ())
1054
- $blogId = get_current_blog_id ();
1055
- $result = self::$settings->getOption ( 'site_id', $blogId );
1056
- self::$logger->log ( 'Database result: ' . $result );
1057
- return (! empty ( $result ) ? $result : $this->requestPiwikSiteId ( $blogId ));
1058
- }
1059
-
1060
- /**
1061
- * Get a detailed list of all Piwik sites
1062
- *
1063
- * @return array Piwik sites
1064
- */
1065
- public function getPiwikSiteDetails() {
1066
- $id = WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array () );
1067
- $piwikSiteDetails = $this->request ( $id );
1068
- return $piwikSiteDetails;
1069
- }
1070
-
1071
- /**
1072
- * Estimate a Piwik site ID by blog ID
1073
- *
1074
- * @param int $blogId
1075
- * which blog's Piwik site ID to estimate, default is the current blog
1076
- * @return mixed Piwik site ID or n/a
1077
- */
1078
- private function requestPiwikSiteId($blogId = null) {
1079
- $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId );
1080
- if (self::$settings->getGlobalOption ( 'auto_site_config' )) {
1081
- $id = WP_Piwik\Request::register ( 'SitesManager.getSitesIdFromSiteUrl', array (
1082
- 'url' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl
1083
- ) );
1084
- $result = $this->request ( $id );
1085
- $this->log ( 'Tried to identify current site, result: ' . serialize ( $result ) );
1086
- if (is_array( $result ) && empty( $result ))
1087
- $result = $this->addPiwikSite ( $blogId );
1088
- elseif ( $result != 'n/a' && isset($result [0]) )
1089
- $result = $result [0] ['idsite'];
1090
- else $result = null;
1091
- } else $result = null;
1092
- self::$logger->log ( 'Get Piwik ID: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) . ' = Piwik ID ' . $result );
1093
- if ($result !== null) {
1094
- self::$settings->setOption ( 'site_id', $result, $blogId );
1095
- if (self::$settings->getGlobalOption ( 'track_mode' ) != 'disabled' && self::$settings->getGlobalOption ( 'track_mode' ) != 'manually') {
1096
- $code = $this->updateTrackingCode ( $result, $blogId );
1097
- }
1098
- $this::$settings->save ();
1099
- return $result;
1100
- }
1101
- return 'n/a';
1102
- }
1103
-
1104
- /**
1105
- * Add a new Piwik
1106
- *
1107
- * @param int $blogId
1108
- * which blog's Piwik site to create, default is the current blog
1109
- * @return int Piwik site ID
1110
- */
1111
- public function addPiwikSite($blogId = null) {
1112
- $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId );
1113
- // Do not add site if Piwik connection is unreliable
1114
- if (! $this->request ( 'global.getPiwikVersion' ))
1115
- return null;
1116
- $id = WP_Piwik\Request::register ( 'SitesManager.addSite', array (
1117
- 'urls' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl,
1118
- 'siteName' => urlencode( $isCurrent ? get_bloginfo ( 'name' ) : get_blog_details ( $blogId )->blogname )
1119
- ) );
1120
- $result = (int) $this->request ( $id );
1121
- self::$logger->log ( 'Create Piwik ID: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) . ' = Piwik ID ' . $result );
1122
- if (empty ( $result ))
1123
- return null;
1124
- else {
1125
- do_action('wp-piwik_site_created', $result);
1126
- return $result;
1127
- }
1128
- }
1129
-
1130
- /**
1131
- * Update a Piwik site's detail information
1132
- *
1133
- * @param int $siteId
1134
- * which Piwik site to updated
1135
- * @param int $blogId
1136
- * which blog's Piwik site ID to get, default is the current blog
1137
- */
1138
- private function updatePiwikSite($siteId, $blogId = null) {
1139
- $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId );
1140
- $id = WP_Piwik\Request::register ( 'SitesManager.updateSite', array (
1141
- 'idSite' => $siteId,
1142
- 'urls' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->$siteurl,
1143
- 'siteName' => $isCurrent ? get_bloginfo ( 'name' ) : get_blog_details ( $blogId )->$blogname
1144
- ) );
1145
- $result = $this->request ( $id );
1146
- self::$logger->log ( 'Update Piwik site: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->$siteurl) );
1147
- }
1148
-
1149
- /**
1150
- * Update a site's tracking code
1151
- *
1152
- * @param int $siteId
1153
- * which Piwik site to updated
1154
- * @param int $blogId
1155
- * which blog's Piwik site ID to get, default is the current blog
1156
- * @return string tracking code
1157
- */
1158
- public function updateTrackingCode($siteId = false, $blogId = null) {
1159
- if (!$siteId)
1160
- $siteId = $this->getPiwikSiteId ();
1161
- if (self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled' || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually')
1162
- return false;
1163
- $id = WP_Piwik\Request::register ( 'SitesManager.getJavascriptTag', array (
1164
- 'idSite' => $siteId,
1165
- 'mergeSubdomains' => self::$settings->getGlobalOption ( 'track_across' ) ? 1 : 0,
1166
- 'mergeAliasUrls' => self::$settings->getGlobalOption ( 'track_across_alias' ) ? 1 : 0,
1167
- 'disableCookies' => self::$settings->getGlobalOption ( 'disable_cookies' ) ? 1 : 0,
1168
- 'crossDomain' => self::$settings->getGlobalOption ( 'track_crossdomain_linking' ) ? 1 : 0,
1169
- 'trackNoScript' => 1
1170
- ) );
1171
- $code = $this->request ( $id );
1172
- if (is_array($code) && isset($code['value']))
1173
- $code = $code['value'];
1174
- $result = !is_array ( $code ) ? html_entity_decode ( $code ) : '<!-- '.json_encode($code).' -->';
1175
- self::$logger->log ( 'Delivered tracking code: ' . $result );
1176
- $result = WP_Piwik\TrackingCode::prepareTrackingCode ( $result, self::$settings, self::$logger, true );
1177
- if (isset ( $result ['script'] ) && ! empty ( $result ['script'] )) {
1178
- self::$settings->setOption ( 'tracking_code', $result ['script'], $blogId );
1179
- self::$settings->setOption ( 'noscript_code', $result ['noscript'], $blogId );
1180
- self::$settings->setGlobalOption ( 'proxy_url', $result ['proxy'], $blogId );
1181
- }
1182
- return $result;
1183
- }
1184
-
1185
- /**
1186
- * Update Piwik site if blog name changes
1187
- *
1188
- * @param string $oldValue
1189
- * old blog name
1190
- * @param string $newValue
1191
- * new blog name
1192
- */
1193
- public function onBlogNameChange($oldValue, $newValue = null) {
1194
- $this->updatePiwikSite ( self::$settings->getOption ( 'site_id' ) );
1195
- }
1196
-
1197
- /**
1198
- * Update Piwik site if blog URL changes
1199
- *
1200
- * @param string $oldValue
1201
- * old blog URL
1202
- * @param string $newValue
1203
- * new blog URL
1204
- */
1205
- public function onSiteUrlChange($oldValue, $newValue = null) {
1206
- $this->updatePiwikSite ( self::$settings->getOption ( 'site_id' ) );
1207
- }
1208
-
1209
- /**
1210
- * Register stats page meta boxes
1211
- *
1212
- * @param mixed $statsPageId
1213
- * WordPress stats page ID
1214
- */
1215
- public function onloadStatsPage($statsPageId) {
1216
- if (self::$settings->getGlobalOption ( 'disable_timelimit' ))
1217
- set_time_limit ( 0 );
1218
- wp_enqueue_script ( 'common' );
1219
- wp_enqueue_script ( 'wp-lists' );
1220
- wp_enqueue_script ( 'postbox' );
1221
- wp_enqueue_script ( 'wp-piwik', $this->getPluginURL () . 'js/wp-piwik.js', array (), self::$version, true );
1222
- wp_enqueue_script ( 'wp-piwik-jqplot', $this->getPluginURL () . 'js/jqplot/wp-piwik.jqplot.js', array (
1223
- 'jquery'
1224
- ), self::$version );
1225
- new \WP_Piwik\Widget\Chart ( $this, self::$settings, $this->statsPageId );
1226
- new \WP_Piwik\Widget\Visitors ( $this, self::$settings, $this->statsPageId );
1227
- new \WP_Piwik\Widget\Overview ( $this, self::$settings, $this->statsPageId );
1228
- if (self::$settings->getGlobalOption ( 'stats_ecommerce' )) {
1229
- new \WP_Piwik\Widget\Ecommerce ($this, self::$settings, $this->statsPageId);
1230
- new \WP_Piwik\Widget\Items ($this, self::$settings, $this->statsPageId);
1231
- new \WP_Piwik\Widget\ItemsCategory ($this, self::$settings, $this->statsPageId);
1232
- }
1233
- if (self::$settings->getGlobalOption ( 'stats_seo' ))
1234
- new \WP_Piwik\Widget\Seo ( $this, self::$settings, $this->statsPageId );
1235
- new \WP_Piwik\Widget\Pages ( $this, self::$settings, $this->statsPageId );
1236
- new \WP_Piwik\Widget\Keywords ( $this, self::$settings, $this->statsPageId );
1237
- new \WP_Piwik\Widget\Referrers ( $this, self::$settings, $this->statsPageId );
1238
- new \WP_Piwik\Widget\Plugins ( $this, self::$settings, $this->statsPageId );
1239
- new \WP_Piwik\Widget\Search ( $this, self::$settings, $this->statsPageId );
1240
- new \WP_Piwik\Widget\Noresult ( $this, self::$settings, $this->statsPageId );
1241
- new \WP_Piwik\Widget\Browsers ( $this, self::$settings, $this->statsPageId );
1242
- new \WP_Piwik\Widget\BrowserDetails ( $this, self::$settings, $this->statsPageId );
1243
- new \WP_Piwik\Widget\Screens ( $this, self::$settings, $this->statsPageId );
1244
- new \WP_Piwik\Widget\Systems ( $this, self::$settings, $this->statsPageId );
1245
- new \WP_Piwik\Widget\SystemDetails ( $this, self::$settings, $this->statsPageId );
1246
- new \WP_Piwik\Widget\Country ( $this, self::$settings, $this->statsPageId );
1247
- }
1248
-
1249
- /**
1250
- * Add per post statistics to a post's page
1251
- *
1252
- * @param mixed $postPageId
1253
- * WordPress post page ID
1254
- */
1255
- public function onloadPostPage($postPageId) {
1256
- global $post;
1257
- $postUrl = get_permalink ( $post->ID );
1258
- $this->log ( 'Load per post statistics: ' . $postUrl );
1259
- array (
1260
- new \WP_Piwik\Widget\Post ( $this, self::$settings, array('post', 'page', 'custom_post_type'), 'side', 'default', array (
1261
- 'url' => $postUrl
1262
- ) ),
1263
- 'show'
1264
- );
1265
- }
1266
-
1267
- /**
1268
- * Stats page changes by POST submit
1269
- *
1270
- * @see http://tinyurl.com/5r5vnzs
1271
- */
1272
- function onStatsPageSaveChanges() {
1273
- if (! current_user_can ( 'manage_options' ))
1274
- wp_die ( __ ( 'Cheatin&#8217; uh?' ) );
1275
- check_admin_referer ( 'wp-piwik_stats' );
1276
- wp_redirect ( $_POST ['_wp_http_referer'] );
1277
- }
1278
-
1279
- /**
1280
- * Get option value, choose method depending on network mode
1281
- *
1282
- * @param string $option option key
1283
- * @return string option value
1284
- */
1285
- private function getWordPressOption($option, $default = null) {
1286
- return ($this->isNetworkMode () ? get_site_option ( $option, $default ) : get_option ( $option, $default ));
1287
- }
1288
-
1289
- /**
1290
- * Delete option, choose method depending on network mode
1291
- *
1292
- * @param string $option option key
1293
- */
1294
- private function deleteWordPressOption($option) {
1295
- if ( $this->isNetworkMode () )
1296
- delete_site_option ( $option );
1297
- else
1298
- delete_option ( $option );
1299
- }
1300
-
1301
- /**
1302
- * Set option value, choose method depending on network mode
1303
- *
1304
- * @param string $option option key
1305
- * @param mixed $value option value
1306
- */
1307
- private function updateWordPressOption($option, $value) {
1308
- if ( $this->isNetworkMode () )
1309
- update_site_option ( $option, $value );
1310
- else
1311
- update_option ( $option, $value );
1312
- }
1313
-
1314
- /**
1315
- * Check if WP-Piwik options page
1316
- *
1317
- * @return boolean True if current page is WP-Piwik's option page
1318
- */
1319
- public static function isValidOptionsPost() {
1320
- return is_admin() && check_admin_referer( 'wp-piwik_settings' ) && current_user_can( 'manage_options' ) ;
1321
- }
1322
- }
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The main WP-Matomo class configures, registers and manages the plugin
5
+ *
6
+ * @author Andr&eacute; Br&auml;kling <webmaster@braekling.de>
7
+ * @package WP_Piwik
8
+ */
9
+ class WP_Piwik {
10
+
11
+ /**
12
+ *
13
+ * @var Runtime environment variables
14
+ */
15
+ private static $revisionId = 2019032401, $version = '1.0.20', $blog_id, $pluginBasename = NULL, $logger, $settings, $request, $optionsPageId;
16
+
17
+ /**
18
+ * Constructor class to configure and register all WP-Piwik components
19
+ */
20
+ public function __construct() {
21
+ global $blog_id;
22
+ self::$blog_id = (isset ( $blog_id ) ? $blog_id : 'n/a');
23
+ $this->openLogger ();
24
+ $this->openSettings ();
25
+ $this->setup ();
26
+ $this->addFilters ();
27
+ $this->addActions ();
28
+ $this->addShortcodes ();
29
+ }
30
+
31
+ /**
32
+ * Destructor class to finish logging
33
+ */
34
+ public function __destruct() {
35
+ $this->closeLogger ();
36
+ }
37
+
38
+ /**
39
+ * Setup class to prepare settings and check for installation and update
40
+ */
41
+ private function setup() {
42
+ self::$pluginBasename = plugin_basename ( __FILE__ );
43
+ if (! $this->isInstalled ())
44
+ $this->installPlugin ();
45
+ elseif ($this->isUpdated ())
46
+ $this->updatePlugin ();
47
+ if ($this->isConfigSubmitted ())
48
+ $this->applySettings ();
49
+ self::$settings->save ();
50
+ }
51
+
52
+ /**
53
+ * Register WordPress actions
54
+ */
55
+ private function addActions() {
56
+ if ( is_admin () ) {
57
+ add_action ( 'admin_menu', array (
58
+ $this,
59
+ 'buildAdminMenu'
60
+ ) );
61
+ add_action ( 'admin_post_save_wp-piwik_stats', array (
62
+ $this,
63
+ 'onStatsPageSaveChanges'
64
+ ) );
65
+ add_action ( 'load-post.php', array (
66
+ $this,
67
+ 'addPostMetaboxes'
68
+ ) );
69
+ add_action ( 'load-post-new.php', array (
70
+ $this,
71
+ 'addPostMetaboxes'
72
+ ) );
73
+ if ($this->isNetworkMode ()) {
74
+ add_action ( 'network_admin_notices', array (
75
+ $this,
76
+ 'showNotices'
77
+ ) );
78
+ add_action ( 'network_admin_menu', array (
79
+ $this,
80
+ 'buildNetworkAdminMenu'
81
+ ) );
82
+ add_action ( 'update_site_option_blogname', array (
83
+ $this,
84
+ 'onBlogNameChange'
85
+ ) );
86
+ add_action ( 'update_site_option_siteurl', array (
87
+ $this,
88
+ 'onSiteUrlChange'
89
+ ) );
90
+ } else {
91
+ add_action ( 'admin_notices', array (
92
+ $this,
93
+ 'showNotices'
94
+ ) );
95
+ add_action ( 'update_option_blogname', array (
96
+ $this,
97
+ 'onBlogNameChange'
98
+ ) );
99
+ add_action ( 'update_option_siteurl', array (
100
+ $this,
101
+ 'onSiteUrlChange'
102
+ ) );
103
+ }
104
+ if ($this->isDashboardActive ())
105
+ add_action ( 'wp_dashboard_setup', array (
106
+ $this,
107
+ 'extendWordPressDashboard'
108
+ ) );
109
+ }
110
+ if ($this->isToolbarActive ()) {
111
+ add_action ( is_admin () ? 'admin_head' : 'wp_head', array (
112
+ $this,
113
+ 'loadToolbarRequirements'
114
+ ) );
115
+ add_action ( 'admin_bar_menu', array (
116
+ $this,
117
+ 'extendWordPressToolbar'
118
+ ), 1000 );
119
+ }
120
+ if ($this->isTrackingActive ()) {
121
+ if ( !is_admin () || $this->isAdminTrackingActive ()) {
122
+ $prefix = is_admin ()?'admin':'wp';
123
+ add_action ( self::$settings->getGlobalOption ( 'track_codeposition' ) == 'footer' ? $prefix.'_footer' : $prefix.'_head', array (
124
+ $this,
125
+ 'addJavascriptCode'
126
+ ) );
127
+ if (self::$settings->getGlobalOption ( 'dnsprefetch' ))
128
+ add_action ( $prefix.'_head', array (
129
+ $this,
130
+ 'addDNSPrefetchTag'
131
+ ) );
132
+ if ($this->isAddNoScriptCode ())
133
+ add_action ( $prefix.'_footer', array (
134
+ $this,
135
+ 'addNoscriptCode'
136
+ ) );
137
+ }
138
+ if (self::$settings->getGlobalOption ( 'add_post_annotations' ))
139
+ add_action ( 'transition_post_status', array (
140
+ $this,
141
+ 'addPiwikAnnotation'
142
+ ), 10, 3 );
143
+ }
144
+
145
+ }
146
+
147
+ /**
148
+ * Register WordPress filters
149
+ */
150
+ private function addFilters() {
151
+ if (is_admin()) {
152
+ add_filter ( 'plugin_row_meta', array (
153
+ $this,
154
+ 'setPluginMeta'
155
+ ), 10, 2 );
156
+ add_filter ( 'screen_layout_columns', array (
157
+ $this,
158
+ 'onScreenLayoutColumns'
159
+ ), 10, 2 );
160
+ } elseif ($this->isTrackingActive ()) {
161
+ if ($this->isTrackFeed ()) {
162
+ add_filter ( 'the_excerpt_rss', array (
163
+ $this,
164
+ 'addFeedTracking'
165
+ ) );
166
+ add_filter ( 'the_content', array (
167
+ $this,
168
+ 'addFeedTracking'
169
+ ) );
170
+ }
171
+ if ($this->isAddFeedCampaign ()) {
172
+ add_filter ( 'post_link', array (
173
+ $this,
174
+ 'addFeedCampaign'
175
+ ) );
176
+ }
177
+ if ($this->isCrossDomainLinkingEnabled ()) {
178
+ add_filter ( 'wp_redirect', array (
179
+ $this,
180
+ 'forwardCrossDomainVisitorId'
181
+ ) );
182
+ }
183
+ }
184
+ }
185
+
186
+ /**
187
+ * Register WordPress shortcodes
188
+ */
189
+ private function addShortcodes() {
190
+ if ($this->isAddShortcode ())
191
+ add_shortcode ( 'wp-piwik', array (
192
+ $this,
193
+ 'shortcode'
194
+ ) );
195
+ }
196
+
197
+ /**
198
+ * Install WP-Piwik for the first time
199
+ */
200
+ private function installPlugin($isUpdate = false) {
201
+ self::$logger->log ( 'Running WP-Piwik installation' );
202
+ if (! $isUpdate)
203
+ $this->addNotice ( 'install', sprintf ( __ ( '%s %s installed.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$version ), __ ( 'Next you should connect to Piwik', 'wp-piwik' ) );
204
+ self::$settings->setGlobalOption ( 'revision', self::$revisionId );
205
+ self::$settings->setGlobalOption ( 'last_settings_update', time () );
206
+ }
207
+
208
+ /**
209
+ * Uninstall WP-Piwik
210
+ */
211
+ public function uninstallPlugin() {
212
+ self::$logger->log ( 'Running WP-Piwik uninstallation' );
213
+ if (! defined ( 'WP_UNINSTALL_PLUGIN' ))
214
+ exit ();
215
+ self::deleteWordPressOption ( 'wp-piwik-notices' );
216
+ self::$settings->resetSettings ( true );
217
+ }
218
+
219
+ /**
220
+ * Update WP-Piwik
221
+ */
222
+ private function updatePlugin() {
223
+ self::$logger->log ( 'Upgrade WP-Piwik to ' . self::$version );
224
+ $patches = glob ( dirname ( __FILE__ ) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'update' . DIRECTORY_SEPARATOR . '*.php' );
225
+ $isPatched = false;
226
+ if (is_array ( $patches )) {
227
+ sort ( $patches );
228
+ foreach ( $patches as $patch ) {
229
+ $patchVersion = ( int ) pathinfo ( $patch, PATHINFO_FILENAME );
230
+ if ($patchVersion && self::$settings->getGlobalOption ( 'revision' ) < $patchVersion) {
231
+ self::includeFile ( 'update' . DIRECTORY_SEPARATOR . $patchVersion );
232
+ $isPatched = true;
233
+ }
234
+ }
235
+ }
236
+ if ((self::$settings->getGlobalOption('update_notice') == 'enabled') || ((self::$settings->getGlobalOption('update_notice') == 'script') && $isPatched))
237
+ $this->addNotice ( 'update', sprintf ( __ ( '%s updated to %s.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$version ), __ ( 'Please validate your configuration', 'wp-piwik' ) );
238
+ $this->installPlugin ( true );
239
+ }
240
+
241
+ /**
242
+ * Define a notice
243
+ *
244
+ * @param string $type
245
+ * identifier
246
+ * @param string $subject
247
+ * notice headline
248
+ * @param string $text
249
+ * notice content
250
+ * @param boolean $stay
251
+ * set to true if the message should persist (default: false)
252
+ */
253
+ private function addNotice($type, $subject, $text, $stay = false) {
254
+ $notices = $this->getWordPressOption ( 'wp-piwik-notices', array () );
255
+ $notices [$type] = array (
256
+ 'subject' => $subject,
257
+ 'text' => $text,
258
+ 'stay' => $stay
259
+ );
260
+ $this->updateWordPressOption ( 'wp-piwik-notices', $notices );
261
+ }
262
+
263
+ /**
264
+ * Show all notices defined previously
265
+ *
266
+ * @see addNotice()
267
+ */
268
+ public function showNotices() {
269
+ $link = sprintf ( '<a href="' . $this->getSettingsURL () . '">%s</a>', __ ( 'Settings', 'wp-piwik' ) );
270
+ if ($notices = $this->getWordPressOption ( 'wp-piwik-notices' )) {
271
+ foreach ( $notices as $type => $notice ) {
272
+ printf ( '<div class="updated fade"><p>%s <strong>%s:</strong> %s: %s</p></div>', $notice ['subject'], __ ( 'Important', 'wp-piwik' ), $notice ['text'], $link );
273
+ if (! $notice ['stay'])
274
+ unset ( $notices [$type] );
275
+ }
276
+ }
277
+ $this->updateWordPressOption ( 'wp-piwik-notices', $notices );
278
+ }
279
+
280
+ /**
281
+ * Get the settings page URL
282
+ *
283
+ * @return string settings page URL
284
+ */
285
+ private function getSettingsURL() {
286
+ return (self::$settings->checkNetworkActivation () ? 'settings' : 'options-general') . '.php?page=' . self::$pluginBasename;
287
+ }
288
+
289
+ /**
290
+ * Echo javascript tracking code
291
+ */
292
+ public function addJavascriptCode() {
293
+ if ($this->isHiddenUser ()) {
294
+ self::$logger->log ( 'Do not add tracking code to site (user should not be tracked) Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
295
+ return;
296
+ }
297
+ $trackingCode = new WP_Piwik\TrackingCode ( $this );
298
+ $trackingCode->is404 = (is_404 () && self::$settings->getGlobalOption ( 'track_404' ));
299
+ $trackingCode->isUsertracking = self::$settings->getGlobalOption ( 'track_user_id' ) != 'disabled';
300
+ $trackingCode->isSearch = (is_search () && self::$settings->getGlobalOption ( 'track_search' ));
301
+ self::$logger->log ( 'Add tracking code. Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
302
+ if ($this->isNetworkMode () && self::$settings->getGlobalOption ( 'track_mode' ) == 'manually') {
303
+ $siteId = $this->getPiwikSiteId ();
304
+ if ($siteId != 'n/a')
305
+ echo str_replace ( '{ID}', $siteId, $trackingCode->getTrackingCode () );
306
+ else
307
+ echo '<!-- Site will be created and tracking code added on next request -->';
308
+ } else
309
+ echo $trackingCode->getTrackingCode ();
310
+ }
311
+
312
+ /**
313
+ * Echo DNS prefetch tag
314
+ */
315
+ public function addDNSPrefetchTag() {
316
+ echo '<link rel="dns-prefetch" href="'.$this->getPiwikDomain().'" />';
317
+ }
318
+
319
+ /**
320
+ * Get Piwik Domain
321
+ */
322
+ public function getPiwikDomain() {
323
+ switch (self::$settings->getGlobalOption ( 'piwik_mode' )) {
324
+ case 'php' :
325
+ return '//' . parse_url(self::$settings->getGlobalOption ( 'proxy_url' ), PHP_URL_HOST);
326
+ case 'cloud' :
327
+ return '//' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud';
328
+ case 'cloud-matomo' :
329
+ return '//' . self::$settings->getGlobalOption ( 'matomo_user' ) . '.matomo.cloud';
330
+ default :
331
+ return '//' . parse_url(self::$settings->getGlobalOption ( 'piwik_url' ), PHP_URL_HOST);
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Echo noscript tracking code
337
+ */
338
+ public function addNoscriptCode() {
339
+ if (self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy')
340
+ return;
341
+ if ($this->isHiddenUser ()) {
342
+ self::$logger->log ( 'Do not add noscript code to site (user should not be tracked) Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
343
+ return;
344
+ }
345
+ self::$logger->log ( 'Add noscript code. Blog ID: ' . self::$blog_id . ' Site ID: ' . self::$settings->getOption ( 'site_id' ) );
346
+ echo self::$settings->getOption ( 'noscript_code' ) . "\n";
347
+ }
348
+
349
+ /**
350
+ * Register post view meta boxes
351
+ */
352
+ public function addPostMetaboxes() {
353
+ if (self::$settings->getGlobalOption ( 'add_customvars_box' )) {
354
+ add_action ( 'add_meta_boxes', array (
355
+ new WP_Piwik\Template\MetaBoxCustomVars ( $this, self::$settings ),
356
+ 'addMetabox'
357
+ ) );
358
+ add_action ( 'save_post', array (
359
+ new WP_Piwik\Template\MetaBoxCustomVars ( $this, self::$settings ),
360
+ 'saveCustomVars'
361
+ ), 10, 2 );
362
+ }
363
+ if (self::$settings->getGlobalOption ( 'perpost_stats' )) {
364
+ add_action ( 'add_meta_boxes', array (
365
+ $this,
366
+ 'onloadPostPage'
367
+ ) );
368
+ }
369
+ }
370
+
371
+ /**
372
+ * Register admin menu components
373
+ */
374
+ public function buildAdminMenu() {
375
+ if (self::isConfigured ()) {
376
+ $cap = 'wp-piwik_read_stats';
377
+ if (self::$settings->checkNetworkActivation ()) {
378
+ global $current_user;
379
+ $userRoles = $current_user->roles;
380
+ $allowed = self::$settings->getGlobalOption ( 'capability_read_stats' );
381
+ if (is_array($userRoles) && is_array($allowed))
382
+ foreach ($userRoles as $userRole)
383
+ if (isset( $allowed[$userRole] ) && $allowed[$userRole]) {
384
+ $cap = 'read';
385
+ break;
386
+ }
387
+ }
388
+ $statsPage = new WP_Piwik\Admin\Statistics ( $this, self::$settings );
389
+ $this->statsPageId = add_dashboard_page ( __ ( 'Piwik Statistics', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), $cap, 'wp-piwik_stats', array (
390
+ $statsPage,
391
+ 'show'
392
+ ) );
393
+ $this->loadAdminStatsHeader ( $this->statsPageId, $statsPage );
394
+ }
395
+ if (! self::$settings->checkNetworkActivation ()) {
396
+ $optionsPage = new WP_Piwik\Admin\Settings ( $this, self::$settings );
397
+ self::$optionsPageId = add_options_page ( self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'activate_plugins', __FILE__, array (
398
+ $optionsPage,
399
+ 'show'
400
+ ) );
401
+ $this->loadAdminSettingsHeader ( self::$optionsPageId, $optionsPage );
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Register network admin menu components
407
+ */
408
+ public function buildNetworkAdminMenu() {
409
+ if (self::isConfigured ()) {
410
+ $statsPage = new WP_Piwik\Admin\Network ( $this, self::$settings );
411
+ $this->statsPageId = add_dashboard_page ( __ ( 'Piwik Statistics', 'wp-piwik' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'manage_sites', 'wp-piwik_stats', array (
412
+ $statsPage,
413
+ 'show'
414
+ ) );
415
+ $this->loadAdminStatsHeader ( $this->statsPageId, $statsPage );
416
+ }
417
+ $optionsPage = new WP_Piwik\Admin\Settings ( $this, self::$settings );
418
+ self::$optionsPageId = add_submenu_page ( 'settings.php', self::$settings->getGlobalOption ( 'plugin_display_name' ), self::$settings->getGlobalOption ( 'plugin_display_name' ), 'manage_sites', __FILE__, array (
419
+ $optionsPage,
420
+ 'show'
421
+ ) );
422
+ $this->loadAdminSettingsHeader ( self::$optionsPageId, $optionsPage );
423
+ }
424
+
425
+ /**
426
+ * Register admin header extensions for stats page
427
+ *
428
+ * @param $optionsPageId options
429
+ * page id
430
+ * @param $optionsPage options
431
+ * page object
432
+ */
433
+ public function loadAdminStatsHeader($statsPageId, $statsPage) {
434
+ add_action ( 'admin_print_scripts-' . $statsPageId, array (
435
+ $statsPage,
436
+ 'printAdminScripts'
437
+ ) );
438
+ add_action ( 'admin_print_styles-' . $statsPageId, array (
439
+ $statsPage,
440
+ 'printAdminStyles'
441
+ ) );
442
+ add_action ( 'admin_head-' . $statsPageId, array (
443
+ $statsPage,
444
+ 'extendAdminHeader'
445
+ ) );
446
+ add_action ( 'load-' . $statsPageId, array (
447
+ $this,
448
+ 'onloadStatsPage'
449
+ ) );
450
+ }
451
+
452
+ /**
453
+ * Register admin header extensions for settings page
454
+ *
455
+ * @param $optionsPageId options
456
+ * page id
457
+ * @param $optionsPage options
458
+ * page object
459
+ */
460
+ public function loadAdminSettingsHeader($optionsPageId, $optionsPage) {
461
+ add_action ( 'admin_head-' . $optionsPageId, array (
462
+ $optionsPage,
463
+ 'extendAdminHeader'
464
+ ) );
465
+ add_action ( 'admin_print_styles-' . $optionsPageId, array (
466
+ $optionsPage,
467
+ 'printAdminStyles'
468
+ ) );
469
+ }
470
+
471
+ /**
472
+ * Register WordPress dashboard widgets
473
+ */
474
+ public function extendWordPressDashboard() {
475
+ if (current_user_can ( 'wp-piwik_read_stats' )) {
476
+ if (self::$settings->getGlobalOption ( 'dashboard_widget' ) != 'disabled')
477
+ new WP_Piwik\Widget\Overview ( $this, self::$settings, 'dashboard', 'side', 'default', array (
478
+ 'date' => self::$settings->getGlobalOption ( 'dashboard_widget' ),
479
+ 'period' => 'day'
480
+ ) );
481
+ if (self::$settings->getGlobalOption ( 'dashboard_chart' ))
482
+ new WP_Piwik\Widget\Chart ( $this, self::$settings );
483
+ if (self::$settings->getGlobalOption ( 'dashboard_ecommerce' ))
484
+ new WP_Piwik\Widget\Ecommerce ( $this, self::$settings );
485
+ if (self::$settings->getGlobalOption ( 'dashboard_seo' ))
486
+ new WP_Piwik\Widget\Seo ( $this, self::$settings );
487
+ }
488
+ }
489
+
490
+ /**
491
+ * Register WordPress toolbar components
492
+ */
493
+ public function extendWordPressToolbar($toolbar) {
494
+ if (current_user_can ( 'wp-piwik_read_stats' ) && is_admin_bar_showing ()) {
495
+ $id = WP_Piwik\Request::register ( 'VisitsSummary.getUniqueVisitors', array (
496
+ 'period' => 'day',
497
+ 'date' => 'last30'
498
+ ) );
499
+ $unique = $this->request ( $id );
500
+ $url = is_network_admin () ? $this->getSettingsURL () : false;
501
+ $content = is_network_admin () ? __('Configure WP-Piwik', 'wp-piwik') : '';
502
+ // Leave if result array does contain a message instead of valid data
503
+ if (isset($unique['result']))
504
+ $content .= '<!-- '.$unique['result'].': '.($unique['message']?$unique['message']:'...').' -->';
505
+ elseif (is_array ( $unique ) ) {
506
+ $content = "<script type='text/javascript'>var \$jSpark = jQuery.noConflict();\$jSpark(function() {var piwikSparkVals=[" . implode ( ',', $unique ) . "];\$jSpark('.wp-piwik_dynbar').sparkline(piwikSparkVals, {type: 'bar', barColor: '#ccc', barWidth:2});});</script><span class='wp-piwik_dynbar'>Loading...</span>";
507
+ $url = $this->getStatsURL ();
508
+ }
509
+ $toolbar->add_menu ( array (
510
+ 'id' => 'wp-piwik_stats',
511
+ 'title' => $content,
512
+ 'href' => $url
513
+ ) );
514
+ }
515
+ }
516
+
517
+ /**
518
+ * Add plugin meta data
519
+ *
520
+ * @param array $links
521
+ * list of already defined plugin meta data
522
+ * @param string $file
523
+ * handled file
524
+ * @return array complete list of plugin meta data
525
+ */
526
+ public function setPluginMeta($links, $file) {
527
+ if ($file == 'wp-piwik/wp-piwik.php' && (!$this->isNetworkMode () || is_network_admin()) )
528
+ return array_merge ( $links, array (
529
+ sprintf ( '<a href="%s">%s</a>', self::getSettingsURL (), __ ( 'Settings', 'wp-piwik' ) )
530
+ ) );
531
+ return $links;
532
+ }
533
+
534
+ /**
535
+ * Prepare toolbar widget requirements
536
+ */
537
+ public function loadToolbarRequirements() {
538
+ if (is_admin_bar_showing ()) {
539
+ wp_enqueue_script ( 'wp-piwik-sparkline', $this->getPluginURL () . 'js/sparkline/jquery.sparkline.min.js', array (
540
+ 'jquery'
541
+ ), self::$version );
542
+ wp_enqueue_style ( 'wp-piwik', $this->getPluginURL () . 'css/wp-piwik-spark.css', array (), $this->getPluginVersion () );
543
+ }
544
+ }
545
+
546
+ /**
547
+ * Add tracking pixels to feed content
548
+ *
549
+ * @param string $content
550
+ * post content
551
+ * @return string post content extended by tracking pixel
552
+ */
553
+ public function addFeedTracking($content) {
554
+ global $post;
555
+ if (is_feed ()) {
556
+ self::$logger->log ( 'Add tracking image to feed entry.' );
557
+ if (! self::$settings->getOption ( 'site_id' )) {
558
+ $siteId = $this->requestPiwikSiteId ();
559
+ if ($siteId != 'n/a')
560
+ self::$settings->setOption ( 'site_id', $siteId );
561
+ else
562
+ return false;
563
+ }
564
+ $title = the_title ( null, null, false );
565
+ $posturl = get_permalink ( $post->ID );
566
+ $urlref = get_bloginfo ( 'rss2_url' );
567
+ if (self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy')
568
+ $url = plugins_url ( 'wp-piwik' ) . '/proxy/piwik.php';
569
+ else {
570
+ $url = self::$settings->getGlobalOption ( 'piwik_url' );
571
+ if (substr($url, -10, 10) == '/index.php')
572
+ $url = str_replace('/index.php', '/piwik.php', $url);
573
+ else
574
+ $url .= 'piwik.php';
575
+ }
576
+ $trackingImage = $url . '?idsite=' . self::$settings->getOption ( 'site_id' ) . '&amp;rec=1&amp;url=' . urlencode ( $posturl ) . '&amp;action_name=' . urlencode ( $title ) . '&amp;urlref=' . urlencode ( $urlref );
577
+ $content .= '<img src="' . $trackingImage . '" style="border:0;width:0;height:0" width="0" height="0" alt="" />';
578
+ }
579
+ return $content;
580
+ }
581
+
582
+ /**
583
+ * Add a campaign parameter to feed permalink
584
+ *
585
+ * @param string $permalink
586
+ * permalink
587
+ * @return string permalink extended by campaign parameter
588
+ */
589
+ public function addFeedCampaign($permalink) {
590
+ global $post;
591
+ if (is_feed ()) {
592
+ self::$logger->log ( 'Add campaign to feed permalink.' );
593
+ $sep = (strpos ( $permalink, '?' ) === false ? '?' : '&');
594
+ $permalink .= $sep . 'pk_campaign=' . urlencode ( self::$settings->getGlobalOption ( 'track_feed_campaign' ) ) . '&pk_kwd=' . urlencode ( $post->post_name );
595
+ }
596
+ return $permalink;
597
+ }
598
+
599
+ /**
600
+ * Forwards the cross domain parameter pk_vid if the URL parameter is set and a user is about to be redirected.
601
+ * When another website links to WooCommerce with a pk_vid parameter, and WooCommerce redirects the user to another
602
+ * URL, the pk_vid parameter would get lost and the visitorId would later not be applied by the tracking code
603
+ * due to the lost pk_vid URL parameter. If the URL parameter is set, we make sure to forward this parameter.
604
+ *
605
+ * @param string $location
606
+ *
607
+ * @return string location extended by pk_vid URL parameter if the URL parameter is set
608
+ */
609
+ public function forwardCrossDomainVisitorId($location) {
610
+
611
+ if (!empty($_GET['pk_vid'])
612
+ && preg_match('/^[a-zA-Z0-9]{24,48}$/', $_GET['pk_vid'])) {
613
+ // currently, the pk_vid parameter is 32 characters long, but it may vary over time.
614
+ $location = add_query_arg( 'pk_vid', $_GET['pk_vid'], $location );
615
+ }
616
+
617
+ return $location;
618
+ }
619
+
620
+ /**
621
+ * Apply settings update
622
+ *
623
+ * @return boolean settings update applied
624
+ */
625
+ private function applySettings() {
626
+ self::$settings->applyChanges ( $_POST ['wp-piwik'] );
627
+ if (self::$settings->getGlobalOption ( 'auto_site_config' ) && self::isConfigured ()) {
628
+ if ($this->isPHPMode () && ! defined ( 'PIWIK_INCLUDE_PATH' ))
629
+ self::definePiwikConstants ();
630
+ $siteId = $this->getPiwikSiteId ();
631
+ $trackingCode = $this->updateTrackingCode ( $siteId );
632
+ self::$settings->setOption ( 'site_id', $siteId );
633
+ }
634
+ self::$settings->setGlobalOption ( 'revision', self::$revisionId );
635
+ self::$settings->setGlobalOption ( 'last_settings_update', time () );
636
+ return true;
637
+ }
638
+
639
+ /**
640
+ * Check if WP-Piwik is configured
641
+ *
642
+ * @return boolean Is WP-Piwik configured?
643
+ */
644
+ public static function isConfigured() {
645
+ return (self::$settings->getGlobalOption ( 'piwik_token' ) && (self::$settings->getGlobalOption ( 'piwik_mode' ) != 'disabled') && (((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'http') && (self::$settings->getGlobalOption ( 'piwik_url' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'php') && (self::$settings->getGlobalOption ( 'piwik_path' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud') && (self::$settings->getGlobalOption ( 'piwik_user' ))) || ((self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud-matomo') && (self::$settings->getGlobalOption ( 'matomo_user' )))));
646
+ }
647
+
648
+ /**
649
+ * Check if WP-Piwik was updated
650
+ *
651
+ * @return boolean Was WP-Piwik updated?
652
+ */
653
+ private function isUpdated() {
654
+ return self::$settings->getGlobalOption ( 'revision' ) && self::$settings->getGlobalOption ( 'revision' ) < self::$revisionId;
655
+ }
656
+
657
+ /**
658
+ * Check if WP-Piwik is already installed
659
+ *
660
+ * @return boolean Is WP-Piwik installed?
661
+ */
662
+ private function isInstalled() {
663
+ $oldSettings = $this->getWordPressOption ( 'wp-piwik_global-settings', false );
664
+ if ($oldSettings && isset( $oldSettings['revision'] )) {
665
+ self::log('Save old settings');
666
+ self::$settings->setGlobalOption ( 'revision', $oldSettings['revision'] );
667
+ } else self::log( 'Current revision '.self::$settings->getGlobalOption ( 'revision' ) );
668
+ return self::$settings->getGlobalOption ( 'revision' ) > 0;
669
+ }
670
+
671
+ /**
672
+ * Check if new settings were submitted
673
+ *
674
+ * @return boolean Are new settings submitted?
675
+ */
676
+ public static function isConfigSubmitted() {
677
+ return isset ( $_POST ) && isset ( $_POST ['wp-piwik'] ) && self::isValidOptionsPost();
678
+ }
679
+
680
+ /**
681
+ * Check if PHP mode is chosen
682
+ *
683
+ * @return Is PHP mode chosen?
684
+ */
685
+ public function isPHPMode() {
686
+ return self::$settings->getGlobalOption ( 'piwik_mode' ) && self::$settings->getGlobalOption ( 'piwik_mode' ) == 'php';
687
+ }
688
+
689
+ /**
690
+ * Check if WordPress is running in network mode
691
+ *
692
+ * @return boolean Is WordPress running in network mode?
693
+ */
694
+ public function isNetworkMode() {
695
+ return self::$settings->checkNetworkActivation ();
696
+ }
697
+
698
+ /**
699
+ * Check if a WP-Piwik dashboard widget is enabled
700
+ *
701
+ * @return boolean Is a dashboard widget enabled?
702
+ */
703
+ private function isDashboardActive() {
704
+ return self::$settings->getGlobalOption ( 'dashboard_widget' ) || self::$settings->getGlobalOption ( 'dashboard_chart' ) || self::$settings->getGlobalOption ( 'dashboard_seo' );
705
+ }
706
+
707
+ /**
708
+ * Check if a WP-Piwik toolbar widget is enabled
709
+ *
710
+ * @return boolean Is a toolbar widget enabled?
711
+ */
712
+ private function isToolbarActive() {
713
+ return self::$settings->getGlobalOption ( 'toolbar' );
714
+ }
715
+
716
+ /**
717
+ * Check if WP-Piwik tracking code insertion is enabled
718
+ *
719
+ * @return boolean Insert tracking code?
720
+ */
721
+ private function isTrackingActive() {
722
+ return self::$settings->getGlobalOption ( 'track_mode' ) != 'disabled';
723
+ }
724
+
725
+ /**
726
+ * Check if admin tracking is enabled
727
+ *
728
+ * @return boolean Is admin tracking enabled?
729
+ */
730
+ private function isAdminTrackingActive() {
731
+ return self::$settings->getGlobalOption ( 'track_admin' ) && is_admin ();
732
+ }
733
+
734
+ /**
735
+ * Check if WP-Piwik noscript code insertion is enabled
736
+ *
737
+ * @return boolean Insert noscript code?
738
+ */
739
+ private function isAddNoScriptCode() {
740
+ return self::$settings->getGlobalOption ( 'track_noscript' );
741
+ }
742
+
743
+ /**
744
+ * Check if feed tracking is enabled
745
+ *
746
+ * @return boolean Is feed tracking enabled?
747
+ */
748
+ private function isTrackFeed() {
749
+ return self::$settings->getGlobalOption ( 'track_feed' );
750
+ }
751
+
752
+ /**
753
+ * Check if feed permalinks get a campaign parameter
754
+ *
755
+ * @return boolean Add campaign parameter to feed permalinks?
756
+ */
757
+ private function isAddFeedCampaign() {
758
+ return self::$settings->getGlobalOption ( 'track_feed_addcampaign' );
759
+ }
760
+
761
+ /**
762
+ * Check if feed permalinks get a campaign parameter
763
+ *
764
+ * @return boolean Add campaign parameter to feed permalinks?
765
+ */
766
+ private function isCrossDomainLinkingEnabled() {
767
+ return self::$settings->getGlobalOption ( 'track_crossdomain_linking' );
768
+ }
769
+
770
+ /**
771
+ * Check if WP-Piwik shortcodes are enabled
772
+ *
773
+ * @return boolean Are shortcodes enabled?
774
+ */
775
+ private function isAddShortcode() {
776
+ return self::$settings->getGlobalOption ( 'shortcodes' );
777
+ }
778
+
779
+ /**
780
+ * Define Piwik constants for PHP reporting API
781
+ */
782
+ public static function definePiwikConstants() {
783
+ if (! defined ( 'PIWIK_INCLUDE_PATH' )) {
784
+ //@header('Content-type: text/html');
785
+ define ( 'PIWIK_INCLUDE_PATH', self::$settings->getGlobalOption ( 'piwik_path' ) );
786
+ define ( 'PIWIK_USER_PATH', self::$settings->getGlobalOption ( 'piwik_path' ) );
787
+ define ( 'PIWIK_ENABLE_DISPATCH', false );
788
+ define ( 'PIWIK_ENABLE_ERROR_HANDLER', false );
789
+ define ( 'PIWIK_ENABLE_SESSION_START', false );
790
+ }
791
+ }
792
+
793
+ /**
794
+ * Start chosen logging method
795
+ */
796
+ private function openLogger() {
797
+ switch (WP_PIWIK_ACTIVATE_LOGGER) {
798
+ case 1 :
799
+ self::$logger = new WP_Piwik\Logger\Screen ( __CLASS__ );
800
+ break;
801
+ case 2 :
802
+ self::$logger = new WP_Piwik\Logger\File ( __CLASS__ );
803
+ break;
804
+ default :
805
+ self::$logger = new WP_Piwik\Logger\Dummy ( __CLASS__ );
806
+ }
807
+ }
808
+
809
+ /**
810
+ * Log a message
811
+ *
812
+ * @param string $message
813
+ * logger message
814
+ */
815
+ public static function log($message) {
816
+ self::$logger->log ( $message );
817
+ }
818
+
819
+ /**
820
+ * End logging
821
+ */
822
+ private function closeLogger() {
823
+ self::$logger = null;
824
+ }
825
+
826
+ /**
827
+ * Load WP-Piwik settings
828
+ */
829
+ private function openSettings() {
830
+ self::$settings = new WP_Piwik\Settings ( $this, self::$logger );
831
+ if (! $this->isConfigSubmitted () && $this->isPHPMode () && ! defined ( 'PIWIK_INCLUDE_PATH' ))
832
+ self::definePiwikConstants ();
833
+ }
834
+
835
+ /**
836
+ * Include a WP-Piwik file
837
+ */
838
+ private function includeFile($strFile) {
839
+ self::$logger->log ( 'Include ' . $strFile . '.php' );
840
+ if (WP_PIWIK_PATH . $strFile . '.php')
841
+ include (WP_PIWIK_PATH . $strFile . '.php');
842
+ }
843
+
844
+ /**
845
+ * Check if user should not be tracked
846
+ *
847
+ * @return boolean Do not track user?
848
+ */
849
+ private function isHiddenUser() {
850
+ if (is_multisite ())
851
+ foreach ( self::$settings->getGlobalOption ( 'capability_stealth' ) as $key => $val )
852
+ if ($val && current_user_can ( $key ))
853
+ return true;
854
+ return current_user_can ( 'wp-piwik_stealth' );
855
+ }
856
+
857
+ /**
858
+ * Check if tracking code is up to date
859
+ *
860
+ * @return boolean Is tracking code up to date?
861
+ */
862
+ public function isCurrentTrackingCode() {
863
+ return (self::$settings->getOption ( 'last_tracking_code_update' ) && self::$settings->getOption ( 'last_tracking_code_update' ) > self::$settings->getGlobalOption ( 'last_settings_update' ));
864
+ }
865
+
866
+ /**
867
+ * DEPRECTAED Add javascript code to site header
868
+ *
869
+ * @deprecated
870
+ *
871
+ */
872
+ public function site_header() {
873
+ self::$logger->log ( 'Using deprecated function site_header' );
874
+ $this->addJavascriptCode ();
875
+ }
876
+
877
+ /**
878
+ * DEPRECTAED Add javascript code to site footer
879
+ *
880
+ * @deprecated
881
+ *
882
+ */
883
+ public function site_footer() {
884
+ self::$logger->log ( 'Using deprecated function site_footer' );
885
+ $this->addNoscriptCode ();
886
+ }
887
+
888
+ /**
889
+ * Identify new posts if an annotation is required
890
+ * and create Piwik annotation
891
+ *
892
+ * @param string $newStatus
893
+ * new post status
894
+ * @param strint $oldStatus
895
+ * new post status
896
+ * @param object $post
897
+ * current post object
898
+ */
899
+ public function addPiwikAnnotation($newStatus, $oldStatus, $post) {
900
+ $enabledPostTypes = self::$settings->getGlobalOption ( 'add_post_annotations' );
901
+ if (isset($enabledPostTypes[$post->post_type]) && $enabledPostTypes[$post->post_type] && $newStatus == 'publish' && $oldStatus != 'publish') {
902
+ $note = 'Published: ' . $post->post_title . ' - URL: ' . get_permalink ( $post->ID );
903
+ $id = WP_Piwik\Request::register ( 'Annotations.add', array (
904
+ 'idSite' => $this->getPiwikSiteId (),
905
+ 'date' => date ( 'Y-m-d' ),
906
+ 'note' => $note
907
+ ) );
908
+ $result = $this->request ( $id );
909
+ self::$logger->log ( 'Add post annotation. ' . $note . ' - ' . serialize ( $result ) );
910
+ }
911
+ }
912
+
913
+ /**
914
+ * Get WP-Piwik's URL
915
+ */
916
+ public function getPluginURL() {
917
+ return trailingslashit ( plugins_url () . '/wp-piwik/' );
918
+ }
919
+
920
+ /**
921
+ * Get WP-Piwik's version
922
+ */
923
+ public function getPluginVersion() {
924
+ return self::$version;
925
+ }
926
+
927
+ /**
928
+ * Enable three columns for WP-Piwik stats screen
929
+ *
930
+ * @param
931
+ * array full list of column settings
932
+ * @param
933
+ * mixed current screen id
934
+ * @return array updated list of column settings
935
+ */
936
+ public function onScreenLayoutColumns($columns, $screen) {
937
+ if (isset( $this->statsPageId ) && $screen == $this->statsPageId)
938
+ $columns [$this->statsPageId] = 3;
939
+ return $columns;
940
+ }
941
+
942
+ /**
943
+ * Add tracking code to admin header
944
+ */
945
+ function addAdminHeaderTracking() {
946
+ $this->addJavascriptCode ();
947
+ }
948
+
949
+ /**
950
+ * Get option value
951
+ *
952
+ * @param string $key
953
+ * option key
954
+ * @return mixed option value
955
+ */
956
+ public function getOption($key) {
957
+ return self::$settings->getOption ( $key );
958
+ }
959
+
960
+ /**
961
+ * Get global option value
962
+ *
963
+ * @param string $key
964
+ * global option key
965
+ * @return mixed global option value
966
+ */
967
+ public function getGlobalOption($key) {
968
+ return self::$settings->getGlobalOption ( $key );
969
+ }
970
+
971
+ /**
972
+ * Get stats page URL
973
+ *
974
+ * @return string stats page URL
975
+ */
976
+ public function getStatsURL() {
977
+ return admin_url () . '?page=wp-piwik_stats';
978
+ }
979
+
980
+ /**
981
+ * Execute WP-Piwik test script
982
+ */
983
+ private function loadTestscript() {
984
+ $this->includeFile ( 'debug' . DIRECTORY_SEPARATOR . 'testscript' );
985
+ }
986
+
987
+ /**
988
+ * Echo an error message
989
+ *
990
+ * @param string $message
991
+ * message content
992
+ */
993
+ private static function showErrorMessage($message) {
994
+ echo '<strong class="wp-piwik-error">' . __ ( 'An error occured', 'wp-piwik' ) . ':</strong> ' . $message . ' [<a href="' . (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general') . '.php?page=wp-piwik/classes/WP_Piwik.php&tab=support">' . __ ( 'Support', 'wp-piwik' ) . '</a>]';
995
+ }
996
+
997
+ /**
998
+ * Perform a Piwik request
999
+ *
1000
+ * @param string $id
1001
+ * request ID
1002
+ * @return mixed request result
1003
+ */
1004
+ public function request($id, $debug = false) {
1005
+ if ( self::$settings->getGlobalOption ( 'piwik_mode' ) == 'disabled' )
1006
+ return 'n/a';
1007
+ if (! isset ( self::$request ) || empty ( self::$request ))
1008
+ self::$request = (self::$settings->getGlobalOption ( 'piwik_mode' ) == 'http' || self::$settings->getGlobalOption ( 'piwik_mode' ) == 'cloud' ? new WP_Piwik\Request\Rest ( $this, self::$settings ) : new WP_Piwik\Request\Php ( $this, self::$settings ));
1009
+ if ($debug)
1010
+ return self::$request->getDebug ( $id );
1011
+ return self::$request->perform ( $id );
1012
+ }
1013
+
1014
+ /**
1015
+ * Reset request object
1016
+ */
1017
+ public function resetRequest() {
1018
+ if (is_object(self::$request))
1019
+ self::$request->reset();
1020
+ self::$request = NULL;
1021
+ }
1022
+
1023
+ /**
1024
+ * Execute WP-Piwik shortcode
1025
+ *
1026
+ * @param array $attributes
1027
+ * attribute list
1028
+ */
1029
+ public function shortcode($attributes) {
1030
+ shortcode_atts ( array (
1031
+ 'title' => '',
1032
+ 'module' => 'overview',
1033
+ 'period' => 'day',
1034
+ 'date' => 'yesterday',
1035
+ 'limit' => 10,
1036
+ 'width' => '100%',
1037
+ 'height' => '200px',
1038
+ 'idsite' => '',
1039
+ 'language' => 'en',
1040
+ 'range' => false,
1041
+ 'key' => 'sum_daily_nb_uniq_visitors'
1042
+ ), $attributes );
1043
+ $shortcodeObject = new \WP_Piwik\Shortcode ( $attributes, $this, self::$settings );
1044
+ return $shortcodeObject->get();
1045
+ }
1046
+
1047
+ /**
1048
+ * Get Piwik site ID by blog ID
1049
+ *
1050
+ * @param int $blogId
1051
+ * which blog's Piwik site ID to get, default is the current blog
1052
+ * @return mixed Piwik site ID or n/a
1053
+ */
1054
+ public function getPiwikSiteId($blogId = null) {
1055
+ if (! $blogId && $this->isNetworkMode ())
1056
+ $blogId = get_current_blog_id ();
1057
+ $result = self::$settings->getOption ( 'site_id', $blogId );
1058
+ self::$logger->log ( 'Database result: ' . $result );
1059
+ return (! empty ( $result ) ? $result : $this->requestPiwikSiteId ( $blogId ));
1060
+ }
1061
+
1062
+ /**
1063
+ * Get a detailed list of all Piwik sites
1064
+ *
1065
+ * @return array Piwik sites
1066
+ */
1067
+ public function getPiwikSiteDetails() {
1068
+ $id = WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array () );
1069
+ $piwikSiteDetails = $this->request ( $id );
1070
+ return $piwikSiteDetails;
1071
+ }
1072
+
1073
+ /**
1074
+ * Estimate a Piwik site ID by blog ID
1075
+ *
1076
+ * @param int $blogId
1077
+ * which blog's Piwik site ID to estimate, default is the current blog
1078
+ * @return mixed Piwik site ID or n/a
1079
+ */
1080
+ private function requestPiwikSiteId($blogId = null) {
1081
+ $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId );
1082
+ if (self::$settings->getGlobalOption ( 'auto_site_config' )) {
1083
+ $id = WP_Piwik\Request::register ( 'SitesManager.getSitesIdFromSiteUrl', array (
1084
+ 'url' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl
1085
+ ) );
1086
+ $result = $this->request ( $id );
1087
+ $this->log ( 'Tried to identify current site, result: ' . serialize ( $result ) );
1088
+ if (is_array( $result ) && empty( $result ))
1089
+ $result = $this->addPiwikSite ( $blogId );
1090
+ elseif ( $result != 'n/a' && isset($result [0]) )
1091
+ $result = $result [0] ['idsite'];
1092
+ else $result = null;
1093
+ } else $result = null;
1094
+ self::$logger->log ( 'Get Piwik ID: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) . ' = Piwik ID ' . $result );
1095
+ if ($result !== null) {
1096
+ self::$settings->setOption ( 'site_id', $result, $blogId );
1097
+ if (self::$settings->getGlobalOption ( 'track_mode' ) != 'disabled' && self::$settings->getGlobalOption ( 'track_mode' ) != 'manually') {
1098
+ $code = $this->updateTrackingCode ( $result, $blogId );
1099
+ }
1100
+ $this::$settings->save ();
1101
+ return $result;
1102
+ }
1103
+ return 'n/a';
1104
+ }
1105
+
1106
+ /**
1107
+ * Add a new Piwik
1108
+ *
1109
+ * @param int $blogId
1110
+ * which blog's Piwik site to create, default is the current blog
1111
+ * @return int Piwik site ID
1112
+ */
1113
+ public function addPiwikSite($blogId = null) {
1114
+ $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId );
1115
+ // Do not add site if Piwik connection is unreliable
1116
+ if (! $this->request ( 'global.getPiwikVersion' ))
1117
+ return null;
1118
+ $id = WP_Piwik\Request::register ( 'SitesManager.addSite', array (
1119
+ 'urls' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl,
1120
+ 'siteName' => urlencode( $isCurrent ? get_bloginfo ( 'name' ) : get_blog_details ( $blogId )->blogname )
1121
+ ) );
1122
+ $result = (int) $this->request ( $id );
1123
+ self::$logger->log ( 'Create Piwik ID: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl) . ' = Piwik ID ' . $result );
1124
+ if (empty ( $result ))
1125
+ return null;
1126
+ else {
1127
+ do_action('wp-piwik_site_created', $result);
1128
+ return $result;
1129
+ }
1130
+ }
1131
+
1132
+ /**
1133
+ * Update a Piwik site's detail information
1134
+ *
1135
+ * @param int $siteId
1136
+ * which Piwik site to updated
1137
+ * @param int $blogId
1138
+ * which blog's Piwik site ID to get, default is the current blog
1139
+ */
1140
+ private function updatePiwikSite($siteId, $blogId = null) {
1141
+ $isCurrent = ! self::$settings->checkNetworkActivation () || empty ( $blogId );
1142
+ $id = WP_Piwik\Request::register ( 'SitesManager.updateSite', array (
1143
+ 'idSite' => $siteId,
1144
+ 'urls' => $isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->siteurl,
1145
+ 'siteName' => $isCurrent ? get_bloginfo ( 'name' ) : get_blog_details ( $blogId )->blogname
1146
+ ) );
1147
+ $this->request ( $id );
1148
+ self::$logger->log ( 'Update Piwik site: WordPress site ' . ($isCurrent ? get_bloginfo ( 'url' ) : get_blog_details ( $blogId )->$siteurl) );
1149
+ }
1150
+
1151
+ /**
1152
+ * Update a site's tracking code
1153
+ *
1154
+ * @param int $siteId
1155
+ * which Piwik site to updated
1156
+ * @param int $blogId
1157
+ * which blog's Piwik site ID to get, default is the current blog
1158
+ * @return string tracking code
1159
+ */
1160
+ public function updateTrackingCode($siteId = false, $blogId = null) {
1161
+ if (!$siteId)
1162
+ $siteId = $this->getPiwikSiteId ();
1163
+ if (self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled' || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually')
1164
+ return false;
1165
+ $id = WP_Piwik\Request::register ( 'SitesManager.getJavascriptTag', array (
1166
+ 'idSite' => $siteId,
1167
+ 'mergeSubdomains' => self::$settings->getGlobalOption ( 'track_across' ) ? 1 : 0,
1168
+ 'mergeAliasUrls' => self::$settings->getGlobalOption ( 'track_across_alias' ) ? 1 : 0,
1169
+ 'disableCookies' => self::$settings->getGlobalOption ( 'disable_cookies' ) ? 1 : 0,
1170
+ 'crossDomain' => self::$settings->getGlobalOption ( 'track_crossdomain_linking' ) ? 1 : 0,
1171
+ 'trackNoScript' => 1
1172
+ ) );
1173
+ $code = $this->request ( $id );
1174
+ if (is_array($code) && isset($code['value']))
1175
+ $code = $code['value'];
1176
+ $result = !is_array ( $code ) ? html_entity_decode ( $code ) : '<!-- '.json_encode($code).' -->';
1177
+ self::$logger->log ( 'Delivered tracking code: ' . $result );
1178
+ $result = WP_Piwik\TrackingCode::prepareTrackingCode ( $result, self::$settings, self::$logger, true );
1179
+ if (isset ( $result ['script'] ) && ! empty ( $result ['script'] )) {
1180
+ self::$settings->setOption ( 'tracking_code', $result ['script'], $blogId );
1181
+ self::$settings->setOption ( 'noscript_code', $result ['noscript'], $blogId );
1182
+ self::$settings->setGlobalOption ( 'proxy_url', $result ['proxy'], $blogId );
1183
+ }
1184
+ return $result;
1185
+ }
1186
+
1187
+ /**
1188
+ * Update Piwik site if blog name changes
1189
+ *
1190
+ * @param string $oldValue
1191
+ * old blog name
1192
+ * @param string $newValue
1193
+ * new blog name
1194
+ */
1195
+ public function onBlogNameChange($oldValue, $newValue = null) {
1196
+ $this->updatePiwikSite ( self::$settings->getOption ( 'site_id' ) );
1197
+ }
1198
+
1199
+ /**
1200
+ * Update Piwik site if blog URL changes
1201
+ *
1202
+ * @param string $oldValue
1203
+ * old blog URL
1204
+ * @param string $newValue
1205
+ * new blog URL
1206
+ */
1207
+ public function onSiteUrlChange($oldValue, $newValue = null) {
1208
+ $this->updatePiwikSite ( self::$settings->getOption ( 'site_id' ) );
1209
+ }
1210
+
1211
+ /**
1212
+ * Register stats page meta boxes
1213
+ *
1214
+ * @param mixed $statsPageId
1215
+ * WordPress stats page ID
1216
+ */
1217
+ public function onloadStatsPage($statsPageId) {
1218
+ if (self::$settings->getGlobalOption ( 'disable_timelimit' ))
1219
+ set_time_limit ( 0 );
1220
+ wp_enqueue_script ( 'common' );
1221
+ wp_enqueue_script ( 'wp-lists' );
1222
+ wp_enqueue_script ( 'postbox' );
1223
+ wp_enqueue_script ( 'wp-piwik', $this->getPluginURL () . 'js/wp-piwik.js', array (), self::$version, true );
1224
+ wp_enqueue_script ( 'wp-piwik-jqplot', $this->getPluginURL () . 'js/jqplot/wp-piwik.jqplot.js', array (
1225
+ 'jquery'
1226
+ ), self::$version );
1227
+ new \WP_Piwik\Widget\Chart ( $this, self::$settings, $this->statsPageId );
1228
+ new \WP_Piwik\Widget\Visitors ( $this, self::$settings, $this->statsPageId );
1229
+ new \WP_Piwik\Widget\Overview ( $this, self::$settings, $this->statsPageId );
1230
+ if (self::$settings->getGlobalOption ( 'stats_ecommerce' )) {
1231
+ new \WP_Piwik\Widget\Ecommerce ($this, self::$settings, $this->statsPageId);
1232
+ new \WP_Piwik\Widget\Items ($this, self::$settings, $this->statsPageId);
1233
+ new \WP_Piwik\Widget\ItemsCategory ($this, self::$settings, $this->statsPageId);
1234
+ }
1235
+ if (self::$settings->getGlobalOption ( 'stats_seo' ))
1236
+ new \WP_Piwik\Widget\Seo ( $this, self::$settings, $this->statsPageId );
1237
+ new \WP_Piwik\Widget\Pages ( $this, self::$settings, $this->statsPageId );
1238
+ new \WP_Piwik\Widget\Keywords ( $this, self::$settings, $this->statsPageId );
1239
+ new \WP_Piwik\Widget\Referrers ( $this, self::$settings, $this->statsPageId );
1240
+ new \WP_Piwik\Widget\Plugins ( $this, self::$settings, $this->statsPageId );
1241
+ new \WP_Piwik\Widget\Search ( $this, self::$settings, $this->statsPageId );
1242
+ new \WP_Piwik\Widget\Noresult ( $this, self::$settings, $this->statsPageId );
1243
+ new \WP_Piwik\Widget\Browsers ( $this, self::$settings, $this->statsPageId );
1244
+ new \WP_Piwik\Widget\BrowserDetails ( $this, self::$settings, $this->statsPageId );
1245
+ new \WP_Piwik\Widget\Screens ( $this, self::$settings, $this->statsPageId );
1246
+ new \WP_Piwik\Widget\Types ( $this, self::$settings, $this->statsPageId );
1247
+ new \WP_Piwik\Widget\Models ( $this, self::$settings, $this->statsPageId );
1248
+ new \WP_Piwik\Widget\Systems ( $this, self::$settings, $this->statsPageId );
1249
+ new \WP_Piwik\Widget\SystemDetails ( $this, self::$settings, $this->statsPageId );
1250
+ new \WP_Piwik\Widget\City ( $this, self::$settings, $this->statsPageId );
1251
+ new \WP_Piwik\Widget\Country ( $this, self::$settings, $this->statsPageId );
1252
+ }
1253
+
1254
+ /**
1255
+ * Add per post statistics to a post's page
1256
+ *
1257
+ * @param mixed $postPageId
1258
+ * WordPress post page ID
1259
+ */
1260
+ public function onloadPostPage($postPageId) {
1261
+ global $post;
1262
+ $postUrl = get_permalink ( $post->ID );
1263
+ $this->log ( 'Load per post statistics: ' . $postUrl );
1264
+ array (
1265
+ new \WP_Piwik\Widget\Post ( $this, self::$settings, array('post', 'page', 'custom_post_type'), 'side', 'default', array (
1266
+ 'url' => $postUrl
1267
+ ) ),
1268
+ 'show'
1269
+ );
1270
+ }
1271
+
1272
+ /**
1273
+ * Stats page changes by POST submit
1274
+ *
1275
+ * @see http://tinyurl.com/5r5vnzs
1276
+ */
1277
+ function onStatsPageSaveChanges() {
1278
+ if (! current_user_can ( 'manage_options' ))
1279
+ wp_die ( __ ( 'Cheatin&#8217; uh?' ) );
1280
+ check_admin_referer ( 'wp-piwik_stats' );
1281
+ wp_redirect ( $_POST ['_wp_http_referer'] );
1282
+ }
1283
+
1284
+ /**
1285
+ * Get option value, choose method depending on network mode
1286
+ *
1287
+ * @param string $option option key
1288
+ * @return string option value
1289
+ */
1290
+ private function getWordPressOption($option, $default = null) {
1291
+ return ($this->isNetworkMode () ? get_site_option ( $option, $default ) : get_option ( $option, $default ));
1292
+ }
1293
+
1294
+ /**
1295
+ * Delete option, choose method depending on network mode
1296
+ *
1297
+ * @param string $option option key
1298
+ */
1299
+ private function deleteWordPressOption($option) {
1300
+ if ( $this->isNetworkMode () )
1301
+ delete_site_option ( $option );
1302
+ else
1303
+ delete_option ( $option );
1304
+ }
1305
+
1306
+ /**
1307
+ * Set option value, choose method depending on network mode
1308
+ *
1309
+ * @param string $option option key
1310
+ * @param mixed $value option value
1311
+ */
1312
+ private function updateWordPressOption($option, $value) {
1313
+ if ( $this->isNetworkMode () )
1314
+ update_site_option ( $option, $value );
1315
+ else
1316
+ update_option ( $option, $value );
1317
+ }
1318
+
1319
+ /**
1320
+ * Check if WP-Piwik options page
1321
+ *
1322
+ * @return boolean True if current page is WP-Piwik's option page
1323
+ */
1324
+ public static function isValidOptionsPost() {
1325
+ return is_admin() && check_admin_referer( 'wp-piwik_settings' ) && current_user_can( 'manage_options' ) ;
1326
+ }
1327
+ }
classes/WP_Piwik/Admin.php CHANGED
File without changes
classes/WP_Piwik/Admin/Network.php CHANGED
File without changes
classes/WP_Piwik/Admin/Settings.php CHANGED
@@ -1,716 +1,718 @@
1
- <?php
2
-
3
- namespace WP_Piwik\Admin;
4
-
5
- /**
6
- * WordPress Admin settings page
7
- *
8
- * @package WP_Piwik\Admin
9
- * @author Andr&eacute; Br&auml;kling <webmaster@braekling.de>
10
- */
11
- class Settings extends \WP_Piwik\Admin {
12
-
13
- /**
14
- * Builds and displays the settings page
15
- */
16
- public function show() {
17
- if (isset($_GET['sitebrowser']) && $_GET['sitebrowser']) {
18
- new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik);
19
- return;
20
- }
21
- if (isset($_GET['clear']) && $_GET['clear']) {
22
- $this->clear($_GET['clear'] == 2);
23
- self::$wpPiwik->resetRequest();
24
- echo '<form method="post" action="?page='.htmlentities($_GET['page']).'"><input type="submit" value="'.__('Reload', 'wp-piwik').'" /></form>';
25
- return;
26
- } elseif (self::$wpPiwik->isConfigSubmitted()) {
27
- $this->showBox ( 'updated', 'yes', __ ( 'Changes saved.' ) );
28
- self::$wpPiwik->resetRequest();
29
- self::$wpPiwik->updateTrackingCode();
30
- }
31
- global $wp_roles;
32
- ?>
33
- <div id="plugin-options-wrap" class="widefat">
34
- <?php
35
- echo $this->getHeadline ( 1, 'admin-generic', 'Settings', true );
36
- if (isset($_GET['testscript']) && $_GET['testscript'])
37
- $this->runTestscript();
38
- ?>
39
- <?php
40
- if (self::$wpPiwik->isConfigured ()) {
41
- $piwikVersion = self::$wpPiwik->request ( 'global.getPiwikVersion' );
42
- if (is_array ( $piwikVersion ) && isset( $piwikVersion['value'] ))
43
- $piwikVersion = $piwikVersion['value'];
44
- if (! empty ( $piwikVersion ) && !is_array( $piwikVersion ))
45
- $this->showDonation();
46
- }
47
- ?>
48
- <form method="post" action="?page=<?php echo htmlentities($_GET['page']); ?>">
49
- <input type="hidden" name="wp-piwik[revision]" value="<?php echo self::$settings->getGlobalOption('revision'); ?>" />
50
- <?php wp_nonce_field('wp-piwik_settings'); ?>
51
- <table class="wp-piwik-form">
52
- <tbody>
53
- <?php
54
- $submitButton = '<tr><td colspan="2"><p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_attr__ ( 'Save Changes' ) . '" /></p></td></tr>';
55
- printf ( '<tr><td colspan="2">%s</td></tr>', __ ( 'Thanks for using WP-Piwik!', 'wp-piwik' ) );
56
- if (self::$wpPiwik->isConfigured ()) {
57
- if (! empty ( $piwikVersion ) && !is_array( $piwikVersion )) {
58
- $this->showText ( sprintf ( __ ( 'WP-Piwik %s is successfully connected to Piwik %s.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $piwikVersion ) . ' ' . (! self::$wpPiwik->isNetworkMode () ? sprintf ( __ ( 'You are running WordPress %s.', 'wp-piwik' ), get_bloginfo ( 'version' ) ) : sprintf ( __ ( 'You are running a WordPress %s blog network (WPMU). WP-Piwik will handle your sites as different websites.', 'wp-piwik' ), get_bloginfo ( 'version' ) )) );
59
- } else {
60
- $errorMessage = \WP_Piwik\Request::getLastError();
61
- if ( empty( $errorMessage ) )
62
- $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Piwik %s was not able to connect to Piwik using your configuration. Check the &raquo;Connect to Piwik&laquo; section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) );
63
- else
64
- $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Piwik %s was not able to connect to Piwik using your configuration. During connection the following error occured: <br /><code>%s</code>', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) );
65
- }
66
- } else
67
- $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Piwik %s has to be connected to Piwik first. Check the &raquo;Connect to Piwik&laquo; section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) );
68
-
69
- $tabs ['connect'] = array (
70
- 'icon' => 'admin-plugins',
71
- 'name' => __('Connect to Piwik', 'wp-piwik')
72
- );
73
- if (self::$wpPiwik->isConfigured ()) {
74
- $tabs ['statistics'] = array (
75
- 'icon' => 'chart-pie',
76
- 'name' => __('Show Statistics', 'wp-piwik')
77
- );
78
- $tabs ['tracking'] = array (
79
- 'icon' => 'location-alt',
80
- 'name' => __('Enable Tracking', 'wp-piwik')
81
- );
82
- }
83
- $tabs ['expert'] = array (
84
- 'icon' => 'shield',
85
- 'name' => __('Expert Settings', 'wp-piwik')
86
- );
87
- $tabs ['support'] = array (
88
- 'icon' => 'lightbulb',
89
- 'name' => __('Support', 'wp-piwik')
90
- );
91
- $tabs ['credits'] = array (
92
- 'icon' => 'groups',
93
- 'name' => __('Credits', 'wp-piwik')
94
- );
95
-
96
- echo '<tr><td colspan="2"><h2 class="nav-tab-wrapper">';
97
- foreach ( $tabs as $tab => $details ) {
98
- $class = ($tab == 'connect') ? ' nav-tab-active' : '';
99
- echo '<a style="cursor:pointer;" id="tab-' . $tab . '" class="nav-tab' . $class . '" onclick="javascript:$j(\'table.wp-piwik_menu-tab\').addClass(\'hidden\');$j(\'#' . $tab . '\').removeClass(\'hidden\');$j(\'a.nav-tab\').removeClass(\'nav-tab-active\');$j(\'#tab-' . $tab . '\').addClass(\'nav-tab-active\');">';
100
- $this->showHeadline ( 0, $details ['icon'], $details ['name'] );
101
- echo "</a>";
102
- }
103
- echo '</h2></td></tr></tbody></table><table id="connect" class="wp-piwik_menu-tab"><tbody>';
104
-
105
- if (! self::$wpPiwik->isConfigured ())
106
- $this->showBox ( 'updated', 'info', sprintf ( '%s <a href="%s">%s</a> %s <a href="%s">%s</a>.', __ ( 'WP-Piwik is a WordPress plugin to show a selection of Piwik stats in your WordPress admin dashboard and to add and configure your Piwik tracking code. To use this you will need your own Piwik instance. If you do not already have a Piwik setup, you have two simple options: use either', 'wp-piwik' ), 'http://piwik.org/', __ ( 'a self-hosted Piwik', 'wp-piwik' ), __ ( 'or', 'wp-piwik' ), 'https://www.innocraft.cloud/?pk_campaign=WP-Piwik', __ ( 'a cloud-hosted Piwik by InnoCraft', 'wp-piwik' ) ) );
107
-
108
- if (! function_exists ( 'curl_init' ) && ! ini_get ( 'allow_url_fopen' ))
109
- $this->showBox ( 'error', 'no', __ ( 'Neither cURL nor fopen are available. So WP-Piwik can not use the HTTP API and not connect to InnoCraft Cloud.' ) . ' ' . sprintf ( '<a href="%s">%s.</a>', 'https://wordpress.org/plugins/wp-piwik/faq/', __ ( 'More information', 'wp-piwik' ) ) );
110
-
111
- $description = sprintf ( '%s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s', __ ( 'You can choose between three connection methods:', 'wp-piwik' ), __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ), __ ( 'This is the default option for a self-hosted Piwik and should work for most configurations. WP-Piwik will connect to Piwik using http(s).', 'wp-piwik' ), __ ( 'Self-hosted (PHP API)', 'wp-piwik' ), __ ( 'Choose this, if your self-hosted Piwik and WordPress are running on the same machine and you know the full server path to your Piwik instance.', 'wp-piwik' ), __ ( 'Cloud-hosted (InnoCraft Cloud)', 'wp-piwik' ), __ ( 'If you are using a cloud-hosted Piwik by InnoCraft, you can simply use this option.', 'wp-piwik' ) );
112
- $this->showSelect ( 'piwik_mode', __ ( 'Piwik Mode', 'wp-piwik' ), array (
113
- 'disabled' => __ ( 'Disabled (WP-Piwik will not connect to Piwik)', 'wp-piwik' ),
114
- 'http' => __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ),
115
- 'php' => __ ( 'Self-hosted (PHP API)', 'wp-piwik' ),
116
- 'cloud' => __ ( 'Cloud-hosted (InnoCraft Cloud)', 'wp-piwik' )
117
- ), $description, '$j(\'tr.wp-piwik-mode-option\').addClass(\'hidden\'); $j(\'#wp-piwik-mode-option-\' + $j(\'#piwik_mode\').val()).removeClass(\'hidden\');', false, '', self::$wpPiwik->isConfigured () );
118
-
119
- $this->showInput ( 'piwik_url', __ ( 'Piwik URL', 'wp-piwik' ), __( 'Enter your Piwik URL. This is the same URL you use to access your Piwik instance, e.g. http://www.example.com/piwik/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'http', 'wp-piwik-mode-option', 'http', self::$wpPiwik->isConfigured (), true );
120
- $this->showInput ( 'piwik_path', __ ( 'Piwik path', 'wp-piwik' ), __( 'Enter the file path to your Piwik instance, e.g. /var/www/piwik/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'php', 'wp-piwik-mode-option', 'php', self::$wpPiwik->isConfigured (), true );
121
- $this->showInput ( 'piwik_user', __ ( 'Piwik subdomain', 'wp-piwik' ), __( 'Enter your InnoCraft Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.innocraft.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud', 'wp-piwik-mode-option', 'cloud', self::$wpPiwik->isConfigured () );
122
- $this->showInput ( 'piwik_token', __ ( 'Auth token', 'wp-piwik' ), __( 'Enter your Piwik auth token here. It is an alphanumerical code like 0a1b2c34d56e78901fa2bc3d45678efa.', 'wp-piwik' ).' '.sprintf ( __ ( 'See %sWP-Piwik FAQ%s.', 'wp-piwik' ), '<a href="https://wordpress.org/plugins/wp-piwik/faq/" target="_BLANK">', '</a>' ), false, '', '', self::$wpPiwik->isConfigured (), true );
123
-
124
- // Site configuration
125
- $piwikSiteId = self::$wpPiwik->isConfigured () ? self::$wpPiwik->getPiwikSiteId () : false;
126
- if (! self::$wpPiwik->isNetworkMode() ) {
127
- $this->showCheckbox ( 'auto_site_config', __ ( 'Auto config', 'wp-piwik' ), __ ( 'Check this to automatically choose your blog from your Piwik sites by URL. If your blog is not added to Piwik yet, WP-Piwik will add a new site.', 'wp-piwik' ), false, '$j(\'tr.wp-piwik-auto-option\').toggle(\'hidden\');' . ($piwikSiteId ? '$j(\'#site_id\').val(' . $piwikSiteId . ');' : '') );
128
- if (self::$wpPiwik->isConfigured ()) {
129
- $piwikSiteList = self::$wpPiwik->getPiwikSiteDetails ();
130
- if (isset($piwikSiteList['result']) && $piwikSiteList['result'] == 'error') {
131
- $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Piwik %s was not able to get sites with at least view access: <br /><code>%s</code>', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) );
132
- } else {
133
- if (is_array($piwikSiteList))
134
- foreach ($piwikSiteList as $details)
135
- $piwikSiteDetails[$details['idsite']] = $details;
136
- unset($piwikSiteList);
137
- if ($piwikSiteId != 'n/a' && isset($piwikSiteDetails) && is_array($piwikSiteDetails))
138
- $piwikSiteDescription = $piwikSiteDetails [$piwikSiteId] ['name'] . ' (' . $piwikSiteDetails [$piwikSiteId] ['main_url'] . ')';
139
- else
140
- $piwikSiteDescription = 'n/a';
141
- echo '<tr class="wp-piwik-auto-option' . (!self::$settings->getGlobalOption('auto_site_config') ? ' hidden' : '') . '"><th scope="row">' . __('Determined site', 'wp-piwik') . ':</th><td>' . $piwikSiteDescription . '</td></tr>';
142
- if (isset ($piwikSiteDetails) && is_array($piwikSiteDetails))
143
- foreach ($piwikSiteDetails as $key => $siteData)
144
- $siteList [$siteData['idsite']] = $siteData ['name'] . ' (' . $siteData ['main_url'] . ')';
145
- if (isset($siteList))
146
- $this->showSelect('site_id', __('Select site', 'wp-piwik'), $siteList, 'Choose the Piwik site corresponding to this blog.', '', self::$settings->getGlobalOption('auto_site_config'), 'wp-piwik-auto-option', true, false);
147
- }
148
- }
149
- } else echo '<tr class="hidden"><td colspan="2"><input type="hidden" name="wp-piwik[auto_site_config]" value="1" /></td></tr>';
150
-
151
- echo $submitButton;
152
-
153
- echo '</tbody></table><table id="statistics" class="wp-piwik_menu-tab hidden"><tbody>';
154
- // Stats configuration
155
- $this->showSelect ( 'default_date', __ ( 'Piwik default date', 'wp-piwik' ), array (
156
- 'today' => __ ( 'Today', 'wp-piwik' ),
157
- 'yesterday' => __ ( 'Yesterday', 'wp-piwik' ),
158
- 'current_month' => __ ( 'Current month', 'wp-piwik' ),
159
- 'last_month' => __ ( 'Last month', 'wp-piwik' ),
160
- 'current_week' => __ ( 'Current week', 'wp-piwik' ),
161
- 'last_week' => __ ( 'Last week', 'wp-piwik' )
162
- ), __ ( 'Default date shown on statistics page.', 'wp-piwik' ) );
163
-
164
- $this->showCheckbox ( 'stats_seo', __ ( 'Show SEO data', 'wp-piwik' ), __ ( 'Display SEO ranking data on statistics page.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' );
165
- $this->showCheckbox ( 'stats_ecommerce', __ ( 'Show e-commerce data', 'wp-piwik' ), __ ( 'Display e-commerce data on statistics page.', 'wp-piwik' ) );
166
-
167
- $this->showSelect ( 'dashboard_widget', __ ( 'Dashboard overview', 'wp-piwik' ), array (
168
- 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
169
- 'yesterday' => __ ( 'Yesterday', 'wp-piwik' ),
170
- 'today' => __ ( 'Today', 'wp-piwik' ),
171
- 'last30' => __ ( 'Last 30 days', 'wp-piwik' )
172
- ), __ ( 'Enable WP-Piwik dashboard widget &quot;Overview&quot;.', 'wp-piwik' ) );
173
-
174
- $this->showCheckbox ( 'dashboard_chart', __ ( 'Dashboard graph', 'wp-piwik' ), __ ( 'Enable WP-Piwik dashboard widget &quot;Graph&quot;.', 'wp-piwik' ) );
175
-
176
- $this->showCheckbox ( 'dashboard_seo', __ ( 'Dashboard SEO', 'wp-piwik' ), __ ( 'Enable WP-Piwik dashboard widget &quot;SEO&quot;.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' );
177
-
178
- $this->showCheckbox ( 'dashboard_ecommerce', __ ( 'Dashboard e-commerce', 'wp-piwik' ), __ ( 'Enable WP-Piwik dashboard widget &quot;E-commerce&quot;.', 'wp-piwik' ) );
179
-
180
- $this->showCheckbox ( 'toolbar', __ ( 'Show graph on WordPress Toolbar', 'wp-piwik' ), __ ( 'Display a last 30 days visitor graph on WordPress\' toolbar.', 'wp-piwik' ) );
181
-
182
- echo '<tr><th scope="row"><label for="capability_read_stats">' . __ ( 'Display stats to', 'wp-piwik' ) . '</label>:</th><td>';
183
- $filter = self::$settings->getGlobalOption ( 'capability_read_stats' );
184
- foreach ( $wp_roles->role_names as $key => $name ) {
185
- echo '<input type="checkbox" ' . (isset ( $filter [$key] ) && $filter [$key] ? 'checked="checked" ' : '') . 'value="1" onchange="$j(\'#capability_read_stats-' . $key . '-input\').val(this.checked?1:0);" />';
186
- echo '<input id="capability_read_stats-' . $key . '-input" type="hidden" name="wp-piwik[capability_read_stats][' . $key . ']" value="' . ( int ) (isset ( $filter [$key] ) && $filter [$key]) . '" />';
187
- echo $name . ' &nbsp; ';
188
- }
189
- echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#capability_read_stats-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="capability_read_stats-desc">' . __ ( 'Choose user roles allowed to see the statistics page.', 'wp-piwik' ) . '</p></td></tr>';
190
-
191
- $this->showCheckbox ( 'perpost_stats', __ ( 'Show per post stats', 'wp-piwik' ), __ ( 'Show stats about single posts at the post edit admin page.', 'wp-piwik' ) );
192
-
193
- $this->showCheckbox ( 'piwik_shortcut', __ ( 'Piwik shortcut', 'wp-piwik' ), __ ( 'Display a shortcut to Piwik itself.', 'wp-piwik' ) );
194
-
195
- $this->showInput ( 'plugin_display_name', __ ( 'WP-Piwik display name', 'wp-piwik' ), __ ( 'Plugin name shown in WordPress.', 'wp-piwik' ) );
196
-
197
- $this->showCheckbox ( 'shortcodes', __ ( 'Enable shortcodes', 'wp-piwik' ), __ ( 'Enable shortcodes in post or page content.', 'wp-piwik' ) );
198
-
199
- echo $submitButton;
200
-
201
- echo '</tbody></table><table id="tracking" class="wp-piwik_menu-tab hidden"><tbody>';
202
-
203
- // Tracking Configuration
204
- $isNotTracking = self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled';
205
- $isNotGeneratedTracking = $isNotTracking || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually';
206
- $fullGeneratedTrackingGroup = 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy';
207
-
208
- $description = sprintf ( '%s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s', __ ( 'You can choose between four tracking code modes:', 'wp-piwik' ), __ ( 'Disabled', 'wp-piwik' ), __ ( 'WP-Piwik will not add the tracking code. Use this, if you want to add the tracking code to your template files or you use another plugin to add the tracking code.', 'wp-piwik' ), __ ( 'Default tracking', 'wp-piwik' ), __ ( 'WP-Piwik will use Piwik\'s standard tracking code.', 'wp-piwik' ), __ ( 'Use js/index.php', 'wp-piwik' ), __ ( 'You can choose this tracking code, to deliver a minified proxy code and to avoid using the files called piwik.js or piwik.php.', 'wp-piwik' ).' '.sprintf( __( 'See %sreadme file%s.', 'wp-piwik' ), '<a href="http://demo.piwik.org/js/README" target="_BLANK">', '</a>'), __ ( 'Use proxy script', 'wp-piwik' ), __ ( 'Use this tracking code to not reveal the Piwik server URL.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/#faq_132" target="_BLANK">', '</a>' ) , __ ( 'Enter manually', 'wp-piwik' ), __ ( 'Enter your own tracking code manually. You can choose one of the prior options, pre-configure your tracking code and switch to manually editing at last.', 'wp-piwik' ).( self::$wpPiwik->isNetworkMode() ? ' '.__ ( 'Use the placeholder {ID} to add the Piwik site ID.', 'wp-piwik' ) : '' ) );
209
- $this->showSelect ( 'track_mode', __ ( 'Add tracking code', 'wp-piwik' ), array (
210
- 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
211
- 'default' => __ ( 'Default tracking', 'wp-piwik' ),
212
- 'js' => __ ( 'Use js/index.php', 'wp-piwik' ),
213
- 'proxy' => __ ( 'Use proxy script', 'wp-piwik' ),
214
- 'manually' => __ ( 'Enter manually', 'wp-piwik' )
215
- ), $description, '$j(\'tr.wp-piwik-track-option\').addClass(\'hidden\'); $j(\'tr.wp-piwik-track-option-\' + $j(\'#track_mode\').val()).removeClass(\'hidden\'); $j(\'#tracking_code, #noscript_code\').prop(\'readonly\', $j(\'#track_mode\').val() != \'manually\');' );
216
-
217
- $this->showTextarea ( 'tracking_code', __ ( 'Tracking code', 'wp-piwik' ), 15, 'This is a preview of your current tracking code. If you choose to enter your tracking code manually, you can change it here.', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false );
218
-
219
- $this->showSelect ( 'track_codeposition', __ ( 'JavaScript code position', 'wp-piwik' ), array (
220
- 'footer' => __ ( 'Footer', 'wp-piwik' ),
221
- 'header' => __ ( 'Header', 'wp-piwik' )
222
- ), __ ( 'Choose whether the JavaScript code is added to the footer or the header.', 'wp-piwik' ), '', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually' );
223
-
224
- $this->showTextarea ( 'noscript_code', __ ( 'Noscript code', 'wp-piwik' ), 2, 'This is a preview of your &lt;noscript&gt; code which is part of your tracking code.', self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false );
225
-
226
- $this->showCheckbox ( 'track_noscript', __ ( 'Add &lt;noscript&gt;', 'wp-piwik' ), __ ( 'Adds the &lt;noscript&gt; code to your footer.', 'wp-piwik' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' );
227
-
228
- $this->showCheckbox ( 'track_nojavascript', __ ( 'Add rec parameter to noscript code', 'wp-piwik' ), __ ( 'Enable tracking for visitors without JavaScript (not recommended).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/#faq_176" target="_BLANK">', '</a>' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' );
229
-
230
- $this->showSelect ( 'track_content', __ ( 'Enable content tracking', 'wp-piwik' ), array (
231
- 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
232
- 'all' => __ ( 'Track all content blocks', 'wp-piwik' ),
233
- 'visible' => __ ( 'Track only visible content blocks', 'wp-piwik' )
234
- ), __ ( 'Content tracking allows you to track interaction with the content of a web page or application.' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/content-tracking" target="_BLANK">', '</a>' ), '', $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
235
-
236
- $this->showCheckbox ( 'track_search', __ ( 'Track search', 'wp-piwik' ), __ ( 'Use Piwik\'s advanced Site Search Analytics feature.' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/site-search/#track-site-search-using-the-tracking-api-advanced-users-only" target="_BLANK">', '</a>' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
237
-
238
- $this->showCheckbox ( 'track_404', __ ( 'Track 404', 'wp-piwik' ), __ ( 'WP-Piwik can automatically add a 404-category to track 404-page-visits.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/faq_60/" target="_BLANK">', '</a>' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
239
-
240
- echo '<tr class="' . $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' . ($isNotTracking ? ' hidden' : '') . '">';
241
- echo '<th scope="row"><label for="add_post_annotations">' . __ ( 'Add annotation on new post of type', 'wp-piwik' ) . '</label>:</th><td>';
242
- $filter = self::$settings->getGlobalOption ( 'add_post_annotations' );
243
- foreach ( get_post_types(array(), 'objects') as $post_type )
244
- echo '<input type="checkbox" ' . (isset ( $filter [$post_type->name] ) && $filter [$post_type->name] ? 'checked="checked" ' : '') . 'value="1" name="wp-piwik[add_post_annotations][' . $post_type->name . ']" /> ' . $post_type->label . ' &nbsp; ';
245
- echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#add_post_annotations-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="add_post_annotations-desc">' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/annotations/" target="_BLANK">', '</a>' ) . '</p></td></tr>';
246
-
247
- $this->showCheckbox ( 'add_customvars_box', __ ( 'Show custom variables box', 'wp-piwik' ), __ ( ' Show a &quot;custom variables&quot; edit box on post edit page.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/custom-variables/" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
248
-
249
- $this->showInput ( 'add_download_extensions', __ ( 'Add new file types for download tracking', 'wp-piwik' ), __ ( 'Add file extensions for download tracking, divided by a vertical bar (&#124;).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#file-extensions-for-tracking-downloads" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
250
-
251
- $this->showCheckbox ( 'disable_cookies', __ ( 'Disable cookies', 'wp-piwik' ), __ ( 'Disable all tracking cookies for a visitor.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
252
-
253
- $this->showCheckbox ( 'limit_cookies', __ ( 'Limit cookie lifetime', 'wp-piwik' ), __ ( 'You can limit the cookie lifetime to avoid tracking your users over a longer period as necessary.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup, true, '$j(\'tr.wp-piwik-cookielifetime-option\').toggleClass(\'wp-piwik-hidden\');' );
254
-
255
- $this->showInput ( 'limit_cookies_visitor', __ ( 'Visitor timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup.' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
256
-
257
- $this->showInput ( 'limit_cookies_session', __ ( 'Session timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
258
-
259
- $this->showInput ( 'limit_cookies_referral', __ ( 'Referral timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
260
-
261
- $this->showCheckbox ( 'track_admin', __ ( 'Track admin pages', 'wp-piwik' ), __ ( 'Enable to track users on admin pages (remember to configure the tracking filter appropriately).', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
262
-
263
- echo '<tr class="' . $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' . ($isNotTracking ? ' hidden' : '') . '">';
264
- echo '<th scope="row"><label for="capability_stealth">' . __ ( 'Tracking filter', 'wp-piwik' ) . '</label>:</th><td>';
265
- $filter = self::$settings->getGlobalOption ( 'capability_stealth' );
266
- foreach ( $wp_roles->role_names as $key => $name )
267
- echo '<input type="checkbox" ' . (isset ( $filter [$key] ) && $filter [$key] ? 'checked="checked" ' : '') . 'value="1" name="wp-piwik[capability_stealth][' . $key . ']" /> ' . $name . ' &nbsp; ';
268
- echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#capability_stealth-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="capability_stealth-desc">' . __ ( 'Choose users by user role you do <strong>not</strong> want to track.', 'wp-piwik' ) . '</p></td></tr>';
269
-
270
- $this->showCheckbox ( 'track_across', __ ( 'Track subdomains in the same website', 'wp-piwik' ), __ ( 'Adds *.-prefix to cookie domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#tracking-subdomains-in-the-same-website" tagert="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
271
-
272
- $this->showCheckbox ( 'track_across_alias', __ ( 'Do not count subdomains as outlink', 'wp-piwik' ), __ ( 'Adds *.-prefix to tracked domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#outlink-tracking-exclusions" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
273
-
274
- $this->showCheckbox ( 'track_crossdomain_linking', __ ( 'Enable cross domain linking', 'wp-piwik' ), __ ( 'When enabled, it will make sure to use the same visitor ID for the same visitor across several domains. This works only when this feature is enabled because the visitor ID is stored in a cookie and cannot be read on the other domain by default. When this feature is enabled, it will append a URL parameter "pk_vid" that contains the visitor ID when a user clicks on a URL that belongs to one of your domains. For this feature to work, you also have to configure which domains should be treated as local in your Piwik website settings. This feature requires Piwik 3.0.2.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually');
275
-
276
- $this->showCheckbox ( 'track_feed', __ ( 'Track RSS feeds', 'wp-piwik' ), __ ( 'Enable to track posts in feeds via tracking pixel.', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
277
-
278
- $this->showCheckbox ( 'track_feed_addcampaign', __ ( 'Track RSS feed links as campaign', 'wp-piwik' ), __ ( 'This will add Piwik campaign parameters to the RSS feed links.' . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/tracking-campaigns/" target="_BLANK">', '</a>' ), 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually', true, '$j(\'tr.wp-piwik-feed_campaign-option\').toggle(\'hidden\');' );
279
-
280
- $this->showInput ( 'track_feed_campaign', __ ( 'RSS feed campaign', 'wp-piwik' ), __ ( 'Keyword: post name.', 'wp-piwik' ), $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'track_feed_addcampaign' ), $fullGeneratedTrackingGroup . ' wp-piwik-feed_campaign-option' );
281
-
282
- $this->showInput ( 'track_heartbeat', __ ( 'Enable heartbeat timer', 'wp-piwik' ), __ ( 'Enable a heartbeat timer to get more accurate visit lengths by sending periodical HTTP ping requests as long as the site is opened. Enter the time between the pings in seconds (Piwik default: 15) to enable or 0 to disable this feature. <strong>Note:</strong> This will cause a lot of additional HTTP requests on your site.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
283
-
284
- $this->showSelect ( 'track_user_id', __ ( 'User ID Tracking', 'wp-piwik' ), array (
285
- 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
286
- 'uid' => __ ( 'WP User ID', 'wp-piwik' ),
287
- 'email' => __ ( 'Email Address', 'wp-piwik' ),
288
- 'username' => __ ( 'Username', 'wp-piwik' ),
289
- 'displayname' => __ ( 'Display Name (Not Recommended!)', 'wp-piwik' )
290
- ), __ ( 'When a user is logged in to WordPress, track their &quot;User ID&quot;. You can select which field from the User\'s profile is tracked as the &quot;User ID&quot;. When enabled, Tracking based on Email Address is recommended.', 'wp-piwik' ), '', $isNotTracking, $fullGeneratedTrackingGroup );
291
-
292
- echo $submitButton;
293
- echo '</tbody></table><table id="expert" class="wp-piwik_menu-tab hidden"><tbody>';
294
-
295
- $this->showText ( __ ( 'Usually, you do not need to change these settings. If you want to do so, you should know what you do or you got an expert\'s advice.', 'wp-piwik' ) );
296
-
297
- $this->showCheckbox ( 'cache', __ ( 'Enable cache', 'wp-piwik' ), __ ( 'Cache API calls, which not contain today\'s values, for a week.', 'wp-piwik' ) );
298
-
299
- if (function_exists('curl_init') && ini_get('allow_url_fopen'))
300
- $this->showSelect ( 'http_connection', __ ( 'HTTP connection via', 'wp-piwik' ), array (
301
- 'curl' => __ ( 'cURL', 'wp-piwik' ),
302
- 'fopen' => __ ( 'fopen', 'wp-piwik' )
303
- ), __('Choose whether WP-Piwik should use cURL or fopen to connect to Piwik in HTTP or Cloud mode.', 'wp-piwik' ) );
304
-
305
- $this->showSelect ( 'http_method', __ ( 'HTTP method', 'wp-piwik' ), array (
306
- 'post' => __ ( 'POST', 'wp-piwik' ),
307
- 'get' => __ ( 'GET', 'wp-piwik' )
308
- ), __('Choose whether WP-Piwik should use POST or GET in HTTP or Cloud mode.', 'wp-piwik' ) );
309
-
310
- $this->showCheckbox ( 'disable_timelimit', __ ( 'Disable time limit', 'wp-piwik' ), __ ( 'Use set_time_limit(0) if stats page causes a time out.', 'wp-piwik' ) );
311
-
312
- $this->showInput ( 'connection_timeout', __ ( 'Connection timeout', 'wp-piwik' ), 'Define a connection timeout for all HTTP requests done by WP-Piwik in seconds.' );
313
-
314
- $this->showCheckbox ( 'disable_ssl_verify', __ ( 'Disable SSL peer verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' );
315
- $this->showCheckbox ( 'disable_ssl_verify_host', __ ( 'Disable SSL host verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' );
316
-
317
- $this->showSelect ( 'piwik_useragent', __ ( 'User agent', 'wp-piwik' ), array (
318
- 'php' => __ ( 'Use the PHP default user agent', 'wp-piwik' ) . (ini_get ( 'user_agent' ) ? '(' . ini_get ( 'user_agent' ) . ')' : ' (' . __ ( 'empty', 'wp-piwik' ) . ')'),
319
- 'own' => __ ( 'Define a specific user agent', 'wp-piwik' )
320
- ), 'WP-Piwik can send the default user agent defined by your PHP settings or use a specific user agent below. The user agent is send by WP-Piwik if HTTP requests are performed.', '$j(\'tr.wp-piwik-useragent-option\').toggleClass(\'hidden\');' );
321
- $this->showInput ( 'piwik_useragent_string', __ ( 'Specific user agent', 'wp-piwik' ), 'Define a user agent description which is send by WP-Piwik if HTTP requests are performed.', self::$settings->getGlobalOption ( 'piwik_useragent' ) != 'own', 'wp-piwik-useragent-option' );
322
-
323
- $this->showCheckbox ( 'dnsprefetch', __ ( 'Enable DNS prefetch', 'wp-piwik' ), __ ( 'Add a DNS prefetch tag.' . ' ' . sprintf ( __ ( 'See %sPiwik Blog%s.', 'wp-piwik' ), '<a target="_BLANK" href="https://piwik.org/blog/2017/04/important-performance-optimizations-load-piwik-javascript-tracker-faster/">', '</a>' ), 'wp-piwik' ) );
324
-
325
- $this->showCheckbox ( 'track_datacfasync', __ ( 'Add data-cfasync=false', 'wp-piwik' ), __ ( 'Adds data-cfasync=false to the script tag, e.g., to ask Rocket Loader to ignore the script.' . ' ' . sprintf ( __ ( 'See %sCloudFlare Knowledge Base%s.', 'wp-piwik' ), '<a href="https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-" target="_BLANK">', '</a>' ), 'wp-piwik' ) );
326
-
327
- $this->showInput ( 'track_cdnurl', __ ( 'CDN URL', 'wp-piwik' ).' http://', 'Enter URL if you want to load the tracking code via CDN.' );
328
-
329
- $this->showInput ( 'track_cdnurlssl', __ ( 'CDN URL (SSL)', 'wp-piwik' ).' https://', 'Enter URL if you want to load the tracking code via a separate SSL CDN.' );
330
-
331
- $this->showSelect ( 'force_protocol', __ ( 'Force Piwik to use a specific protocol', 'wp-piwik' ), array (
332
- 'disabled' => __ ( 'Disabled (default)', 'wp-piwik' ),
333
- 'http' => __ ( 'http', 'wp-piwik' ),
334
- 'https' => __ ( 'https (SSL)', 'wp-piwik' )
335
- ), __ ( 'Choose if you want to explicitly force Piwik to use HTTP or HTTPS. Does not work with a CDN URL.', 'wp-piwik' ) );
336
-
337
- $this->showSelect ( 'update_notice', __ ( 'Update notice', 'wp-piwik' ), array (
338
- 'enabled' => __ ( 'Show always if WP-Piwik is updated', 'wp-piwik' ),
339
- 'script' => __ ( 'Show only if WP-Piwik is updated and settings were changed', 'wp-piwik' ),
340
- 'disabled' => __ ( 'Disabled', 'wp-piwik' )
341
- ), __ ( 'Choose if you want to get an update notice if WP-Piwik is updated.', 'wp-piwik' ) );
342
-
343
- $this->showInput ( 'set_download_extensions', __ ( 'Define all file types for download tracking', 'wp-piwik' ), __ ( 'Replace Piwik\'s default file extensions for download tracking, divided by a vertical bar (&#124;). Leave blank to keep Piwik\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#file-extensions-for-tracking-downloads" target="_BLANK">', '</a>' ) );
344
-
345
- $this->showInput ( 'set_download_classes', __ ( 'Set classes to be treated as downloads', 'wp-piwik' ), __ ( 'Set classes to be treated as downloads (in addition to piwik_download), divided by a vertical bar (&#124;). Leave blank to keep Piwik\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik JavaScript Tracking Client reference%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/api-reference/tracking-javascript" target="_BLANK">', '</a>' ) );
346
-
347
- $this->showInput ( 'set_link_classes', __ ( 'Set classes to be treated as outlinks', 'wp-piwik' ), __ ( 'Set classes to be treated as outlinks (in addition to piwik_link), divided by a vertical bar (&#124;). Leave blank to keep Piwik\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sPiwik JavaScript Tracking Client reference%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/api-reference/tracking-javascript" target="_BLANK">', '</a>' ) );
348
-
349
- echo $submitButton;
350
- ?>
351
- </tbody>
352
- </table>
353
- <table id="support" class="wp-piwik_menu-tab hidden">
354
- <tbody>
355
- <tr><td colspan="2"><?php
356
- echo $this->showSupport();
357
- ?></td></tr>
358
- </tbody>
359
- </table>
360
- <table id="credits" class="wp-piwik_menu-tab hidden">
361
- <tbody>
362
- <tr><td colspan="2"><?php
363
- echo $this->showCredits();
364
- ?></td></tr>
365
- </tbody>
366
- </table>
367
- <input type="hidden" name="wp-piwik[proxy_url]"
368
- value="<?php echo self::$settings->getGlobalOption('proxy_url'); ?>" />
369
- </form>
370
- </div>
371
- <?php
372
- }
373
-
374
- /**
375
- * Show an option's description
376
- *
377
- * @param string $id option id
378
- * @param string $description option description
379
- * @param boolean $hideDescription set to false to show description initially (default: true)
380
- * @return string full description HTML
381
- */
382
- private function getDescription($id, $description, $hideDescription = true) {
383
- return sprintf ( '<span class="dashicons dashicons-editor-help" onclick="$j(\'#%s-desc\').toggleClass(\'hidden\');"></span> <p class="description' . ($hideDescription ? ' hidden' : '') . '" id="%1$s-desc">%s</p>', $id, $description );
384
- }
385
-
386
- /**
387
- * Show a checkbox option
388
- *
389
- * @param string $id option id
390
- * @param string $name descriptive option name
391
- * @param string $description option description
392
- * @param boolean $isHidden set to true to initially hide the option (default: false)
393
- * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
394
- * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
395
- * @param string $onChange javascript for onchange event (default: empty)
396
- */
397
- private function showCheckbox($id, $name, $description, $isHidden = false, $groupName = '', $hideDescription = true, $onChange = '') {
398
- printf ( '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s</label>:</th><td><input type="checkbox" value="1"' . (self::$settings->getGlobalOption ( $id ) ? ' checked="checked"' : '') . ' onchange="$j(\'#%s\').val(this.checked?1:0);%s" /><input id="%2$s" type="hidden" name="wp-piwik[%2$s]" value="' . ( int ) self::$settings->getGlobalOption ( $id ) . '" /> %s</td></tr>', $name, $id, $onChange, $this->getDescription ( $id, $description, $hideDescription ) );
399
- }
400
-
401
- /**
402
- * Show a textarea option
403
- *
404
- * @param string $id option id
405
- * @param string $name descriptive option name
406
- * @param int $rows number of rows to show
407
- * @param string $description option description
408
- * @param boolean $isHidden set to true to initially hide the option (default: false)
409
- * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
410
- * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
411
- * @param string $onChange javascript for onchange event (default: empty)
412
- * @param boolean $isReadonly set textarea to read only (default: false)
413
- * @param boolean $global set to false if the textarea shows a site-specific option (default: true)
414
- */
415
- private function showTextarea($id, $name, $rows, $description, $isHidden, $groupName, $hideDescription = true, $onChange = '', $isReadonly = false, $global = true) {
416
- printf (
417
- '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s</label>:</th><td><textarea cols="80" rows="' . $rows . '" id="%s" name="wp-piwik[%2$s]" onchange="%s"' . ($isReadonly ? ' readonly="readonly"' : '') . '>%s</textarea> %s</td></tr>', $name, $id, $onChange, ($global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id )), $this->getDescription ( $id, $description, $hideDescription ) );
418
- }
419
-
420
- /**
421
- * Show a simple text
422
- *
423
- * @param string $text Text to show
424
- */
425
- private function showText($text) {
426
- printf ( '<tr><td colspan="2"><p>%s</p></td></tr>', $text );
427
- }
428
-
429
- /**
430
- * Show an input option
431
- *
432
- * @param string $id option id
433
- * @param string $name descriptive option name
434
- * @param string $description option description
435
- * @param boolean $isHidden set to true to initially hide the option (default: false)
436
- * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
437
- * @param string $rowName define a class name to access the specific option row by javascript (default: empty)
438
- * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
439
- * @param boolean $wide Create a wide box (default: false)
440
- */
441
- private function showInput($id, $name, $description, $isHidden = false, $groupName = '', $rowName = false, $hideDescription = true, $wide = false) {
442
- printf ( '<tr class="%s%s"%s><th scope="row"><label for="%5$s">%s:</label></th><td><input '.($wide?'class="wp-piwik-wide" ':'').'name="wp-piwik[%s]" id="%5$s" value="%s" /> %s</td></tr>', $isHidden ? 'hidden ' : '', $groupName ? $groupName : '', $rowName ? ' id="' . $groupName . '-' . $rowName . '"' : '', $name, $id, htmlentities(self::$settings->getGlobalOption( $id ), ENT_QUOTES, 'UTF-8', false), !empty($description) ? $this->getDescription ( $id, $description, $hideDescription ) : '' );
443
- }
444
-
445
- /**
446
- * Show a select box option
447
- *
448
- * @param string $id option id
449
- * @param string $name descriptive option name
450
- * @param array $options list of options to show array[](option id => descriptive name)
451
- * @param string $description option description
452
- * @param string $onChange javascript for onchange event (default: empty)
453
- * @param boolean $isHidden set to true to initially hide the option (default: false)
454
- * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
455
- * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
456
- * @param boolean $global set to false if the textarea shows a site-specific option (default: true)
457
- */
458
- private function showSelect($id, $name, $options = array(), $description = '', $onChange = '', $isHidden = false, $groupName = '', $hideDescription = true, $global = true) {
459
- $optionList = '';
460
- $default = $global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id );
461
- if (is_array ( $options ))
462
- foreach ( $options as $key => $value )
463
- $optionList .= sprintf ( '<option value="%s"' . ($key == $default ? ' selected="selected"' : '') . '>%s</option>', $key, $value );
464
- printf ( '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s:</label></th><td><select name="wp-piwik[%s]" id="%2$s" onchange="%s">%s</select> %s</td></tr>', $name, $id, $onChange, $optionList, $this->getDescription ( $id, $description, $hideDescription ) );
465
- }
466
-
467
- /**
468
- * Show an info box
469
- *
470
- * @param string $type box style (e.g., updated, error)
471
- * @param string $icon box icon, see https://developer.wordpress.org/resource/dashicons/
472
- * @param string $content box message
473
- */
474
- private function showBox($type, $icon, $content) {
475
- printf ( '<tr><td colspan="2"><div class="%s"><p><span class="dashicons dashicons-%s"></span> %s</p></div></td></tr>', $type, $icon, $content );
476
- }
477
-
478
- /**
479
- * Show headline
480
- * @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging
481
- * @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/
482
- * @param string $headline headline text
483
- * @param string $addPluginName set to true to add the plugin name to the headline (default: false)
484
- */
485
- private function showHeadline($order, $icon, $headline, $addPluginName = false) {
486
- echo $this->getHeadline ( $order, $icon, $headline, $addPluginName = false );
487
- }
488
-
489
- /**
490
- * Get headline HTML
491
- *
492
- * @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging
493
- * @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/
494
- * @param string $headline headline text
495
- * @param string $addPluginName set to true to add the plugin name to the headline (default: false)
496
- */
497
- private function getHeadline($order, $icon, $headline, $addPluginName = false) {
498
- echo ($order > 0 ? "<h$order>" : '') . sprintf ( '<span class="dashicons dashicons-%s"></span> %s%s', $icon, ($addPluginName ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' ' : ''), __ ( $headline, 'wp-piwik' ) ) . ($order > 0 ? "</h$order>" : '');
499
- }
500
-
501
- /**
502
- * Show donation info
503
- */
504
- private function showDonation() {
505
- ?>
506
- <div class="wp-piwik-donate">
507
- <p>
508
- <strong><?php _e('Donate','wp-piwik'); ?></strong>
509
- </p>
510
- <p>
511
- <?php _e('If you like WP-Piwik, you can support its development by a donation:', 'wp-piwik'); ?>
512
- </p>
513
- <div>
514
- <script id='fb0ahsp'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//button.flattr.com/view/?fid=mkdp7z&url=https%3A%2F%2Fwww.braekling.de%2Fwp-piwik-wpmu-piwik-wordpress';f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fb0ahsp');</script>
515
- </div>
516
- <div>
517
- Paypal
518
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
519
- <input type="hidden" name="cmd" value="_s-xclick" />
520
- <input type="hidden" name="hosted_button_id" value="6046779" />
521
- <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online." />
522
- <img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1" />
523
- </form>
524
- </div>
525
- <div>
526
- <a href="bitcoin:32FMBngRne9wQ7XPFP2CfR25tjp3oa4roN">Bitcoin<br />
527
- <img style="border:none;" src="<?php echo self::$wpPiwik->getPluginURL(); ?>bitcoin.png" width="100" height="100" alt="Bitcoin Address" title="32FMBngRne9wQ7XPFP2CfR25tjp3oa4roN" /></a>
528
- </div>
529
- <div>
530
- <a href="http://www.amazon.de/gp/registry/wishlist/111VUJT4HP1RA?reveal=unpurchased&amp;filter=all&amp;sort=priority&amp;layout=standard&amp;x=12&amp;y=14"><?php _e('My Amazon.de wishlist', 'wp-piwik'); ?></a>
531
- </div>
532
- <div>
533
- <?php _e('Please don\'t forget to vote the compatibility at the','wp-piwik'); ?> <a target="_BLANK" href="http://wordpress.org/extend/plugins/wp-piwik/">WordPress.org Plugin Directory</a>.
534
- </div>
535
- </div><?php
536
- }
537
-
538
- /**
539
- * Register admin scripts
540
- *
541
- * @see \WP_Piwik\Admin::printAdminScripts()
542
- */
543
- public function printAdminScripts() {
544
- wp_enqueue_script ( 'jquery' );
545
- }
546
-
547
- /**
548
- * Extend admin header
549
- *
550
- * @see \WP_Piwik\Admin::extendAdminHeader()
551
- */
552
- public function extendAdminHeader() {
553
- echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
554
- }
555
-
556
- /**
557
- * Show credits
558
- */
559
- public function showCredits() {
560
- ?>
561
- <p><strong><?php _e('Thank you very much for your donation', 'wp-piwik'); ?>:</strong> Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., <?php _e('the Piwik team itself','wp-piwik');?><?php _e(', and all people flattering this','wp-piwik'); ?>!</p>
562
- <p><?php _e('Graphs powered by <a href="http://www.jqplot.com/" target="_BLANK">jqPlot</a> (License: GPL 2.0 and MIT) and <a href="http://omnipotent.net/jquery.sparkline/" target="_BLANK">jQuery Sparklines</a> (License: New BSD License).','wp-piwik'); ?></p>
563
- <p><?php _e('Thank you very much','wp-piwik'); ?> <a href="https://www.transifex.com/projects/p/wp-piwik/" target="_BLANK">Transifex Translation Community</a> <?php _e('for your translation work','wp-piwik'); ?>!</p>
564
- <p><?php _e('Thank you very much, all users who send me mails containing criticism, commendation, feature requests and bug reports! You help me to make WP-Piwik much better.','wp-piwik'); ?></p>
565
- <p><?php _e('Thank <strong>you</strong> for using my plugin. It is the best commendation if my piece of code is really used!','wp-piwik'); ?></p>
566
- <?php
567
- }
568
-
569
- /**
570
- * Show support information
571
- */
572
- public function showSupport() {
573
- ?><ul>
574
- <li><?php _e('The best place to get help:', 'wp-piwik'); ?> <a href="https://wordpress.org/support/plugin/wp-piwik" target="_BLANK"><?php _e('WP-Piwik support forum','wp-piwik'); ?></a></li>
575
- <li><?php _e('Please don\'t forget to vote the compatibility at the','wp-piwik'); ?> <a href="http://wordpress.org/extend/plugins/wp-piwik/" target="_BLANK">WordPress.org Plugin Directory</a>.</li>
576
- </ul>
577
- <h3><?php _e('Debugging', 'wp-piwik'); ?></h3>
578
- <p><?php _e('Either allow_url_fopen has to be enabled <em>or</em> cURL has to be available:', 'wp-piwik'); ?></p>
579
- <ol>
580
- <li><?php
581
- _e('cURL is','wp-piwik');
582
- echo ' <strong>'.(function_exists('curl_init')?'':__('not','wp-piwik')).' ';
583
- _e('available','wp-piwik');
584
- ?></strong>.</li>
585
- <li><?php
586
- _e('allow_url_fopen is','wp-piwik');
587
- echo ' <strong>'.(ini_get('allow_url_fopen')?'':__('not','wp-piwik')).' ';
588
- _e('enabled','wp-piwik');
589
- ?></strong>.</li>
590
- <li><strong><?php echo (((function_exists('curl_init') && ini_get('allow_url_fopen') && self::$settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen')))?__('cURL', 'wp-piwik'):__('fopen', 'wp-piwik')).' ('.(self::$settings->getGlobalOption('http_method')=='post'?__('POST','wp-piwik'):__('GET','wp-piwik')).')</strong> '.__('is used.', 'wp-piwik'); ?></li>
591
- <?php if (self::$settings->getGlobalOption('piwik_mode') == 'php') { ?><li><?php
592
- _e('Determined Piwik base URL is', 'wp-piwik');
593
- echo ' <strong>'.(self::$settings->getGlobalOption('proxy_url')).'</strong>';
594
- ?></li><?php } ?>
595
- </ol>
596
- <p><?php _e('Tools', 'wp-piwik'); ?>:</p>
597
- <ol>
598
- <li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&testscript=1' ); ?>"><?php _e('Run testscript', 'wp-piwik'); ?></a></li>
599
- <li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&sitebrowser=1' ); ?>"><?php _e('Sitebrowser', 'wp-piwik'); ?></a></li>
600
- <li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&clear=1' ); ?>"><?php _e('Clear cache', 'wp-piwik'); ?></a></li>
601
- <li><a onclick="return confirm('<?php _e('Are you sure you want to clear all settings?', 'wp-piwik'); ?>')" href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&clear=2' ); ?>"><?php _e('Reset WP-Piwik', 'wp-piwik'); ?></a></li>
602
- </ol>
603
- <h3><?php _e('Latest support threads on WordPress.org', 'wp-piwik'); ?></h3><?php
604
- $supportThreads = $this->readRSSFeed('http://wordpress.org/support/rss/plugin/wp-piwik');
605
- if (!empty($supportThreads)) {
606
- echo '<ol>';
607
- foreach ($supportThreads as $supportThread)
608
- echo '<li><a href="'.$supportThread['url'].'">'.$supportThread['title'].'</a></li>';
609
- echo '</ol>';
610
- }
611
- }
612
-
613
- /**
614
- * Read RSS feed
615
- *
616
- * @param string $feed
617
- * feed URL
618
- * @param int $cnt
619
- * item limit
620
- * @return array feed items array[](title, url)
621
- *
622
- */
623
- private function readRSSFeed($feed, $cnt = 5) {
624
- $result = array ();
625
- if (function_exists ( 'simplexml_load_file' ) && ! empty ( $feed )) {
626
- $xml = @simplexml_load_file ( $feed );
627
- if (! $xml || ! isset ( $xml->channel [0]->item ))
628
- return array (
629
- array (
630
- 'title' => 'Can\'t read RSS feed.',
631
- 'url' => $xml
632
- )
633
- );
634
- foreach ( $xml->channel [0]->item as $item ) {
635
- if ($cnt -- == 0)
636
- break;
637
- $result [] = array (
638
- 'title' => $item->title [0],
639
- 'url' => $item->link [0]
640
- );
641
- }
642
- }
643
- return $result;
644
- }
645
-
646
- /**
647
- * Clear cache and reset settings
648
- *
649
- * @param boolean $clearSettings set to true to reset settings (default: false)
650
- */
651
- private function clear($clearSettings = false) {
652
- if ($clearSettings) {
653
- self::$settings->resetSettings();
654
- $this->showBox ( 'updated', 'yes', __ ( 'Settings cleared (except connection settings).' ) );
655
- }
656
- global $wpdb;
657
- if (self::$settings->checkNetworkActivation()) {
658
- $aryBlogs = \WP_Piwik\Settings::getBlogList();
659
- if (is_array($aryBlogs))
660
- foreach ($aryBlogs as $aryBlog) {
661
- switch_to_blog($aryBlog['blog_id']);
662
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'");
663
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'");
664
- restore_current_blog();
665
- }
666
- } else {
667
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'");
668
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'");
669
- }
670
- $this->showBox ( 'updated', 'yes', __ ( 'Cache cleared.' ) );
671
- }
672
-
673
- /**
674
- * Execute test script and display results
675
- */
676
- private function runTestscript() { ?>
677
- <div class="wp-piwik-debug">
678
- <h2>Testscript Result</h2>
679
- <?php
680
- if (self::$wpPiwik->isConfigured()) {
681
- if (isset($_GET['testscript_id']) && $_GET['testscript_id'])
682
- switch_to_blog((int) $_GET['testscript_id']);
683
- ?>
684
- <textarea cols="80" rows="10"><?php
685
- echo '`WP-Piwik '.self::$wpPiwik->getPluginVersion()."\nMode: ".self::$settings->getGlobalOption('piwik_mode')."\n\n";
686
- ?>Test 1/3: global.getPiwikVersion<?php
687
- $GLOBALS ['wp-piwik_debug'] = true;
688
- $id = \WP_Piwik\Request::register ( 'API.getPiwikVersion', array() );
689
- echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
690
- var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
691
- $GLOBALS ['wp-piwik_debug'] = false;
692
- ?>Test 2/3: SitesManager.getSitesWithAtLeastViewAccess<?php
693
- $GLOBALS ['wp-piwik_debug'] = true;
694
- $id = \WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array() );
695
- echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
696
- var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
697
- $GLOBALS ['wp-piwik_debug'] = false;
698
- ?>Test 3/3: SitesManager.getSitesIdFromSiteUrl<?php
699
- $GLOBALS ['wp-piwik_debug'] = true;
700
- $id = \WP_Piwik\Request::register ( 'SitesManager.getSitesIdFromSiteUrl', array (
701
- 'url' => get_bloginfo ( 'url' )
702
- ) );
703
- echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
704
- var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
705
- echo "\n\n"; var_dump( self::$settings->getDebugData() ); echo "`";
706
- $GLOBALS ['wp-piwik_debug'] = false;
707
- ?></textarea>
708
- <?php
709
- if (isset($_GET['testscript_id']) && $_GET['testscript_id'])
710
- restore_current_blog();
711
- } else echo '<p>Please configure WP-Piwik first.</p>';
712
- ?>
713
- </div>
714
- <?php }
715
-
716
- }
 
 
1
+ <?php
2
+
3
+ namespace WP_Piwik\Admin;
4
+
5
+ /**
6
+ * WordPress Admin settings page
7
+ *
8
+ * @package WP_Piwik\Admin
9
+ * @author Andr&eacute; Br&auml;kling <webmaster@braekling.de>
10
+ */
11
+ class Settings extends \WP_Piwik\Admin {
12
+
13
+ /**
14
+ * Builds and displays the settings page
15
+ */
16
+ public function show() {
17
+ if (isset($_GET['sitebrowser']) && $_GET['sitebrowser']) {
18
+ new \WP_Piwik\Admin\Sitebrowser(self::$wpPiwik);
19
+ return;
20
+ }
21
+ if (isset($_GET['clear']) && $_GET['clear']) {
22
+ $this->clear($_GET['clear'] == 2);
23
+ self::$wpPiwik->resetRequest();
24
+ echo '<form method="post" action="?page='.htmlentities($_GET['page']).'"><input type="submit" value="'.__('Reload', 'wp-piwik').'" /></form>';
25
+ return;
26
+ } elseif (self::$wpPiwik->isConfigSubmitted()) {
27
+ $this->showBox ( 'updated', 'yes', __ ( 'Changes saved.' ) );
28
+ self::$wpPiwik->resetRequest();
29
+ self::$wpPiwik->updateTrackingCode();
30
+ }
31
+ global $wp_roles;
32
+ ?>
33
+ <div id="plugin-options-wrap" class="widefat">
34
+ <?php
35
+ echo $this->getHeadline ( 1, 'admin-generic', 'Settings', true );
36
+ if (isset($_GET['testscript']) && $_GET['testscript'])
37
+ $this->runTestscript();
38
+ ?>
39
+ <?php
40
+ if (self::$wpPiwik->isConfigured ()) {
41
+ $piwikVersion = self::$wpPiwik->request ( 'global.getPiwikVersion' );
42
+ if (is_array ( $piwikVersion ) && isset( $piwikVersion['value'] ))
43
+ $piwikVersion = $piwikVersion['value'];
44
+ if (! empty ( $piwikVersion ) && !is_array( $piwikVersion ))
45
+ $this->showDonation();
46
+ }
47
+ ?>
48
+ <form method="post" action="?page=<?php echo htmlentities($_GET['page']); ?>">
49
+ <input type="hidden" name="wp-piwik[revision]" value="<?php echo self::$settings->getGlobalOption('revision'); ?>" />
50
+ <?php wp_nonce_field('wp-piwik_settings'); ?>
51
+ <table class="wp-piwik-form">
52
+ <tbody>
53
+ <?php
54
+ $submitButton = '<tr><td colspan="2"><p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . esc_attr__ ( 'Save Changes' ) . '" /></p></td></tr>';
55
+ printf ( '<tr><td colspan="2">%s</td></tr>', __ ( 'Thanks for using WP-Matomo!', 'wp-piwik' ) );
56
+ if (self::$wpPiwik->isConfigured ()) {
57
+ if (! empty ( $piwikVersion ) && !is_array( $piwikVersion )) {
58
+ $this->showText ( sprintf ( __ ( 'WP-Matomo %s is successfully connected to Matomo %s.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $piwikVersion ) . ' ' . (! self::$wpPiwik->isNetworkMode () ? sprintf ( __ ( 'You are running WordPress %s.', 'wp-piwik' ), get_bloginfo ( 'version' ) ) : sprintf ( __ ( 'You are running a WordPress %s blog network (WPMU). WP-Matomo will handle your sites as different websites.', 'wp-piwik' ), get_bloginfo ( 'version' ) )) );
59
+ } else {
60
+ $errorMessage = \WP_Piwik\Request::getLastError();
61
+ if ( empty( $errorMessage ) )
62
+ $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to connect to Matomo using your configuration. Check the &raquo;Connect to Matomo&laquo; section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) );
63
+ else
64
+ $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to connect to Matomo using your configuration. During connection the following error occured: <br /><code>%s</code>', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) );
65
+ }
66
+ } else
67
+ $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s has to be connected to Matomo first. Check the &raquo;Connect to Matomo&laquo; section below.', 'wp-piwik' ), self::$wpPiwik->getPluginVersion () ) );
68
+
69
+ $tabs ['connect'] = array (
70
+ 'icon' => 'admin-plugins',
71
+ 'name' => __('Connect to Matomo', 'wp-piwik')
72
+ );
73
+ if (self::$wpPiwik->isConfigured ()) {
74
+ $tabs ['statistics'] = array (
75
+ 'icon' => 'chart-pie',
76
+ 'name' => __('Show Statistics', 'wp-piwik')
77
+ );
78
+ $tabs ['tracking'] = array (
79
+ 'icon' => 'location-alt',
80
+ 'name' => __('Enable Tracking', 'wp-piwik')
81
+ );
82
+ }
83
+ $tabs ['expert'] = array (
84
+ 'icon' => 'shield',
85
+ 'name' => __('Expert Settings', 'wp-piwik')
86
+ );
87
+ $tabs ['support'] = array (
88
+ 'icon' => 'lightbulb',
89
+ 'name' => __('Support', 'wp-piwik')
90
+ );
91
+ $tabs ['credits'] = array (
92
+ 'icon' => 'groups',
93
+ 'name' => __('Credits', 'wp-piwik')
94
+ );
95
+
96
+ echo '<tr><td colspan="2"><h2 class="nav-tab-wrapper">';
97
+ foreach ( $tabs as $tab => $details ) {
98
+ $class = ($tab == 'connect') ? ' nav-tab-active' : '';
99
+ echo '<a style="cursor:pointer;" id="tab-' . $tab . '" class="nav-tab' . $class . '" onclick="javascript:$j(\'table.wp-piwik_menu-tab\').addClass(\'hidden\');$j(\'#' . $tab . '\').removeClass(\'hidden\');$j(\'a.nav-tab\').removeClass(\'nav-tab-active\');$j(\'#tab-' . $tab . '\').addClass(\'nav-tab-active\');">';
100
+ $this->showHeadline ( 0, $details ['icon'], $details ['name'] );
101
+ echo "</a>";
102
+ }
103
+ echo '</h2></td></tr></tbody></table><table id="connect" class="wp-piwik_menu-tab"><tbody>';
104
+
105
+ if (! self::$wpPiwik->isConfigured ())
106
+ $this->showBox ( 'updated', 'info', sprintf ( '%s <a href="%s">%s</a> %s <a href="%s">%s</a>.', __ ( 'WP-Matomo is a WordPress plugin to show a selection of Matomo stats in your WordPress admin dashboard and to add and configure your Matomo tracking code. To use this you will need your own Matomo instance. If you do not already have a Matomo setup, you have two simple options: use either', 'wp-piwik' ), 'http://piwik.org/', __ ( 'a self-hosted Matomo', 'wp-piwik' ), __ ( 'or', 'wp-piwik' ), 'https://www.innocraft.cloud/?pk_campaign=WP-Matomo', __ ( 'a cloud-hosted Matomo by InnoCraft', 'wp-piwik' ) ) );
107
+
108
+ if (! function_exists ( 'curl_init' ) && ! ini_get ( 'allow_url_fopen' ))
109
+ $this->showBox ( 'error', 'no', __ ( 'Neither cURL nor fopen are available. So WP-Matomo can not use the HTTP API and not connect to InnoCraft Cloud.' ) . ' ' . sprintf ( '<a href="%s">%s.</a>', 'https://wordpress.org/plugins/wp-piwik/faq/', __ ( 'More information', 'wp-piwik' ) ) );
110
+
111
+ $description = sprintf ( '%s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s', __ ( 'You can choose between three connection methods:', 'wp-piwik' ), __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ), __ ( 'This is the default option for a self-hosted Matomo and should work for most configurations. WP-Matomo will connect to Matomo using http(s).', 'wp-piwik' ), __ ( 'Self-hosted (PHP API)', 'wp-piwik' ), __ ( 'Choose this, if your self-hosted Matomo and WordPress are running on the same machine and you know the full server path to your Matomo instance.', 'wp-piwik' ), __ ( 'Cloud-hosted', 'wp-piwik' ), __ ( 'If you are using a cloud-hosted Matomo by InnoCraft, you can simply use this option. Be carefull to choose the option which fits to your cloud domain (matomo.cloud or innocraft.cloud).', 'wp-piwik' ) );
112
+ $this->showSelect ( 'piwik_mode', __ ( 'Matomo Mode', 'wp-piwik' ), array (
113
+ 'disabled' => __ ( 'Disabled (WP-Matomo will not connect to Matomo)', 'wp-piwik' ),
114
+ 'http' => __ ( 'Self-hosted (HTTP API, default)', 'wp-piwik' ),
115
+ 'php' => __ ( 'Self-hosted (PHP API)', 'wp-piwik' ),
116
+ 'cloud-matomo' => __('Cloud-hosted (Innocraft Cloud, *.matomo.cloud)', 'wp-piwik'),
117
+ 'cloud' => __ ( 'Cloud-hosted (InnoCraft Cloud, *.innocraft.cloud)', 'wp-piwik' )
118
+ ), $description, '$j(\'tr.wp-piwik-mode-option\').addClass(\'hidden\'); $j(\'#wp-piwik-mode-option-\' + $j(\'#piwik_mode\').val()).removeClass(\'hidden\');', false, '', self::$wpPiwik->isConfigured () );
119
+
120
+ $this->showInput ( 'piwik_url', __ ( 'Matomo URL', 'wp-piwik' ), __( 'Enter your Matomo URL. This is the same URL you use to access your Matomo instance, e.g. http://www.example.com/matomo/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'http', 'wp-piwik-mode-option', 'http', self::$wpPiwik->isConfigured (), true );
121
+ $this->showInput ( 'piwik_path', __ ( 'Matomo path', 'wp-piwik' ), __( 'Enter the file path to your Matomo instance, e.g. /var/www/matomo/.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'php', 'wp-piwik-mode-option', 'php', self::$wpPiwik->isConfigured (), true );
122
+ $this->showInput ( 'piwik_user', __ ( 'Innocraft subdomain', 'wp-piwik' ), __( 'Enter your InnoCraft Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.innocraft.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud', 'wp-piwik-mode-option', 'cloud', self::$wpPiwik->isConfigured () );
123
+ $this->showInput ( 'matomo_user', __ ( 'Matomo subdomain', 'wp-piwik' ), __( 'Enter your Matomo Cloud subdomain. It is also part of your URL: https://SUBDOMAIN.matomo.cloud.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'piwik_mode' ) != 'cloud-matomo', 'wp-piwik-mode-option', 'cloud-matomo', self::$wpPiwik->isConfigured () );
124
+ $this->showInput ( 'piwik_token', __ ( 'Auth token', 'wp-piwik' ), __( 'Enter your Matomo auth token here. It is an alphanumerical code like 0a1b2c34d56e78901fa2bc3d45678efa.', 'wp-piwik' ).' '.sprintf ( __ ( 'See %sWP-Matomo FAQ%s.', 'wp-piwik' ), '<a href="https://wordpress.org/plugins/wp-piwik/faq/" target="_BLANK">', '</a>' ), false, '', '', self::$wpPiwik->isConfigured (), true );
125
+
126
+ // Site configuration
127
+ $piwikSiteId = self::$wpPiwik->isConfigured () ? self::$wpPiwik->getPiwikSiteId () : false;
128
+ if (! self::$wpPiwik->isNetworkMode() ) {
129
+ $this->showCheckbox ( 'auto_site_config', __ ( 'Auto config', 'wp-piwik' ), __ ( 'Check this to automatically choose your blog from your Matomo sites by URL. If your blog is not added to Matomo yet, WP-Matomo will add a new site.', 'wp-piwik' ), false, '$j(\'tr.wp-piwik-auto-option\').toggle(\'hidden\');' . ($piwikSiteId ? '$j(\'#site_id\').val(' . $piwikSiteId . ');' : '') );
130
+ if (self::$wpPiwik->isConfigured ()) {
131
+ $piwikSiteList = self::$wpPiwik->getPiwikSiteDetails ();
132
+ if (isset($piwikSiteList['result']) && $piwikSiteList['result'] == 'error') {
133
+ $this->showBox ( 'error', 'no', sprintf ( __ ( 'WP-Matomo %s was not able to get sites with at least view access: <br /><code>%s</code>', 'wp-piwik' ), self::$wpPiwik->getPluginVersion (), $errorMessage ) );
134
+ } else {
135
+ if (is_array($piwikSiteList))
136
+ foreach ($piwikSiteList as $details)
137
+ $piwikSiteDetails[$details['idsite']] = $details;
138
+ unset($piwikSiteList);
139
+ if ($piwikSiteId != 'n/a' && isset($piwikSiteDetails) && is_array($piwikSiteDetails))
140
+ $piwikSiteDescription = $piwikSiteDetails [$piwikSiteId] ['name'] . ' (' . $piwikSiteDetails [$piwikSiteId] ['main_url'] . ')';
141
+ else
142
+ $piwikSiteDescription = 'n/a';
143
+ echo '<tr class="wp-piwik-auto-option' . (!self::$settings->getGlobalOption('auto_site_config') ? ' hidden' : '') . '"><th scope="row">' . __('Determined site', 'wp-piwik') . ':</th><td>' . $piwikSiteDescription . '</td></tr>';
144
+ if (isset ($piwikSiteDetails) && is_array($piwikSiteDetails))
145
+ foreach ($piwikSiteDetails as $key => $siteData)
146
+ $siteList [$siteData['idsite']] = $siteData ['name'] . ' (' . $siteData ['main_url'] . ')';
147
+ if (isset($siteList))
148
+ $this->showSelect('site_id', __('Select site', 'wp-piwik'), $siteList, 'Choose the Matomo site corresponding to this blog.', '', self::$settings->getGlobalOption('auto_site_config'), 'wp-piwik-auto-option', true, false);
149
+ }
150
+ }
151
+ } else echo '<tr class="hidden"><td colspan="2"><input type="hidden" name="wp-piwik[auto_site_config]" value="1" /></td></tr>';
152
+
153
+ echo $submitButton;
154
+
155
+ echo '</tbody></table><table id="statistics" class="wp-piwik_menu-tab hidden"><tbody>';
156
+ // Stats configuration
157
+ $this->showSelect ( 'default_date', __ ( 'Matomo default date', 'wp-piwik' ), array (
158
+ 'today' => __ ( 'Today', 'wp-piwik' ),
159
+ 'yesterday' => __ ( 'Yesterday', 'wp-piwik' ),
160
+ 'current_month' => __ ( 'Current month', 'wp-piwik' ),
161
+ 'last_month' => __ ( 'Last month', 'wp-piwik' ),
162
+ 'current_week' => __ ( 'Current week', 'wp-piwik' ),
163
+ 'last_week' => __ ( 'Last week', 'wp-piwik' )
164
+ ), __ ( 'Default date shown on statistics page.', 'wp-piwik' ) );
165
+
166
+ $this->showCheckbox ( 'stats_seo', __ ( 'Show SEO data', 'wp-piwik' ), __ ( 'Display SEO ranking data on statistics page.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' );
167
+ $this->showCheckbox ( 'stats_ecommerce', __ ( 'Show e-commerce data', 'wp-piwik' ), __ ( 'Display e-commerce data on statistics page.', 'wp-piwik' ) );
168
+
169
+ $this->showSelect ( 'dashboard_widget', __ ( 'Dashboard overview', 'wp-piwik' ), array (
170
+ 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
171
+ 'yesterday' => __ ( 'Yesterday', 'wp-piwik' ),
172
+ 'today' => __ ( 'Today', 'wp-piwik' ),
173
+ 'last30' => __ ( 'Last 30 days', 'wp-piwik' )
174
+ ), __ ( 'Enable WP-Matomo dashboard widget &quot;Overview&quot;.', 'wp-piwik' ) );
175
+
176
+ $this->showCheckbox ( 'dashboard_chart', __ ( 'Dashboard graph', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget &quot;Graph&quot;.', 'wp-piwik' ) );
177
+
178
+ $this->showCheckbox ( 'dashboard_seo', __ ( 'Dashboard SEO', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget &quot;SEO&quot;.', 'wp-piwik' ) . ' (' . __ ( 'Slow!', 'wp-piwik' ) . ')' );
179
+
180
+ $this->showCheckbox ( 'dashboard_ecommerce', __ ( 'Dashboard e-commerce', 'wp-piwik' ), __ ( 'Enable WP-Matomo dashboard widget &quot;E-commerce&quot;.', 'wp-piwik' ) );
181
+
182
+ $this->showCheckbox ( 'toolbar', __ ( 'Show graph on WordPress Toolbar', 'wp-piwik' ), __ ( 'Display a last 30 days visitor graph on WordPress\' toolbar.', 'wp-piwik' ) );
183
+
184
+ echo '<tr><th scope="row"><label for="capability_read_stats">' . __ ( 'Display stats to', 'wp-piwik' ) . '</label>:</th><td>';
185
+ $filter = self::$settings->getGlobalOption ( 'capability_read_stats' );
186
+ foreach ( $wp_roles->role_names as $key => $name ) {
187
+ echo '<input type="checkbox" ' . (isset ( $filter [$key] ) && $filter [$key] ? 'checked="checked" ' : '') . 'value="1" onchange="$j(\'#capability_read_stats-' . $key . '-input\').val(this.checked?1:0);" />';
188
+ echo '<input id="capability_read_stats-' . $key . '-input" type="hidden" name="wp-piwik[capability_read_stats][' . $key . ']" value="' . ( int ) (isset ( $filter [$key] ) && $filter [$key]) . '" />';
189
+ echo $name . ' &nbsp; ';
190
+ }
191
+ echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#capability_read_stats-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="capability_read_stats-desc">' . __ ( 'Choose user roles allowed to see the statistics page.', 'wp-piwik' ) . '</p></td></tr>';
192
+
193
+ $this->showCheckbox ( 'perpost_stats', __ ( 'Show per post stats', 'wp-piwik' ), __ ( 'Show stats about single posts at the post edit admin page.', 'wp-piwik' ) );
194
+
195
+ $this->showCheckbox ( 'piwik_shortcut', __ ( 'Matomo shortcut', 'wp-piwik' ), __ ( 'Display a shortcut to Matomo itself.', 'wp-piwik' ) );
196
+
197
+ $this->showInput ( 'plugin_display_name', __ ( 'WP-Matomo display name', 'wp-piwik' ), __ ( 'Plugin name shown in WordPress.', 'wp-piwik' ) );
198
+
199
+ $this->showCheckbox ( 'shortcodes', __ ( 'Enable shortcodes', 'wp-piwik' ), __ ( 'Enable shortcodes in post or page content.', 'wp-piwik' ) );
200
+
201
+ echo $submitButton;
202
+
203
+ echo '</tbody></table><table id="tracking" class="wp-piwik_menu-tab hidden"><tbody>';
204
+
205
+ // Tracking Configuration
206
+ $isNotTracking = self::$settings->getGlobalOption ( 'track_mode' ) == 'disabled';
207
+ $isNotGeneratedTracking = $isNotTracking || self::$settings->getGlobalOption ( 'track_mode' ) == 'manually';
208
+ $fullGeneratedTrackingGroup = 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy';
209
+
210
+ $description = sprintf ( '%s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s<br /><strong>%s:</strong> %s', __ ( 'You can choose between four tracking code modes:', 'wp-piwik' ), __ ( 'Disabled', 'wp-piwik' ), __ ( 'WP-Matomo will not add the tracking code. Use this, if you want to add the tracking code to your template files or you use another plugin to add the tracking code.', 'wp-piwik' ), __ ( 'Default tracking', 'wp-piwik' ), __ ( 'WP-Matomo will use Matomo\'s standard tracking code.', 'wp-piwik' ), __ ( 'Use js/index.php', 'wp-piwik' ), __ ( 'You can choose this tracking code, to deliver a minified proxy code and to avoid using the files called piwik.js or piwik.php.', 'wp-piwik' ).' '.sprintf( __( 'See %sreadme file%s.', 'wp-piwik' ), '<a href="http://demo.piwik.org/js/README" target="_BLANK">', '</a>'), __ ( 'Use proxy script', 'wp-piwik' ), __ ( 'Use this tracking code to not reveal the Matomo server URL.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/#faq_132" target="_BLANK">', '</a>' ) , __ ( 'Enter manually', 'wp-piwik' ), __ ( 'Enter your own tracking code manually. You can choose one of the prior options, pre-configure your tracking code and switch to manually editing at last.', 'wp-piwik' ).( self::$wpPiwik->isNetworkMode() ? ' '.__ ( 'Use the placeholder {ID} to add the Matomo site ID.', 'wp-piwik' ) : '' ) );
211
+ $this->showSelect ( 'track_mode', __ ( 'Add tracking code', 'wp-piwik' ), array (
212
+ 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
213
+ 'default' => __ ( 'Default tracking', 'wp-piwik' ),
214
+ 'js' => __ ( 'Use js/index.php', 'wp-piwik' ),
215
+ 'proxy' => __ ( 'Use proxy script', 'wp-piwik' ),
216
+ 'manually' => __ ( 'Enter manually', 'wp-piwik' )
217
+ ), $description, '$j(\'tr.wp-piwik-track-option\').addClass(\'hidden\'); $j(\'tr.wp-piwik-track-option-\' + $j(\'#track_mode\').val()).removeClass(\'hidden\'); $j(\'#tracking_code, #noscript_code\').prop(\'readonly\', $j(\'#track_mode\').val() != \'manually\');' );
218
+
219
+ $this->showTextarea ( 'tracking_code', __ ( 'Tracking code', 'wp-piwik' ), 15, 'This is a preview of your current tracking code. If you choose to enter your tracking code manually, you can change it here.', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false );
220
+
221
+ $this->showSelect ( 'track_codeposition', __ ( 'JavaScript code position', 'wp-piwik' ), array (
222
+ 'footer' => __ ( 'Footer', 'wp-piwik' ),
223
+ 'header' => __ ( 'Header', 'wp-piwik' )
224
+ ), __ ( 'Choose whether the JavaScript code is added to the footer or the header.', 'wp-piwik' ), '', $isNotTracking, 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-proxy wp-piwik-track-option-manually' );
225
+
226
+ $this->showTextarea ( 'noscript_code', __ ( 'Noscript code', 'wp-piwik' ), 2, 'This is a preview of your &lt;noscript&gt; code which is part of your tracking code.', self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually', true, '', (self::$settings->getGlobalOption ( 'track_mode' ) != 'manually'), false );
227
+
228
+ $this->showCheckbox ( 'track_noscript', __ ( 'Add &lt;noscript&gt;', 'wp-piwik' ), __ ( 'Adds the &lt;noscript&gt; code to your footer.', 'wp-piwik' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' );
229
+
230
+ $this->showCheckbox ( 'track_nojavascript', __ ( 'Add rec parameter to noscript code', 'wp-piwik' ), __ ( 'Enable tracking for visitors without JavaScript (not recommended).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/#faq_176" target="_BLANK">', '</a>' ) . ' ' . __ ( 'Disabled in proxy mode.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually' );
231
+
232
+ $this->showSelect ( 'track_content', __ ( 'Enable content tracking', 'wp-piwik' ), array (
233
+ 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
234
+ 'all' => __ ( 'Track all content blocks', 'wp-piwik' ),
235
+ 'visible' => __ ( 'Track only visible content blocks', 'wp-piwik' )
236
+ ), __ ( 'Content tracking allows you to track interaction with the content of a web page or application.' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/content-tracking" target="_BLANK">', '</a>' ), '', $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
237
+
238
+ $this->showCheckbox ( 'track_search', __ ( 'Track search', 'wp-piwik' ), __ ( 'Use Matomo\'s advanced Site Search Analytics feature.' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/site-search/#track-site-search-using-the-tracking-api-advanced-users-only" target="_BLANK">', '</a>' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
239
+
240
+ $this->showCheckbox ( 'track_404', __ ( 'Track 404', 'wp-piwik' ), __ ( 'WP-Matomo can automatically add a 404-category to track 404-page-visits.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo FAQ%s.', 'wp-piwik' ), '<a href="http://piwik.org/faq/how-to/faq_60/" target="_BLANK">', '</a>' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
241
+
242
+ echo '<tr class="' . $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' . ($isNotTracking ? ' hidden' : '') . '">';
243
+ echo '<th scope="row"><label for="add_post_annotations">' . __ ( 'Add annotation on new post of type', 'wp-piwik' ) . '</label>:</th><td>';
244
+ $filter = self::$settings->getGlobalOption ( 'add_post_annotations' );
245
+ foreach ( get_post_types(array(), 'objects') as $post_type )
246
+ echo '<input type="checkbox" ' . (isset ( $filter [$post_type->name] ) && $filter [$post_type->name] ? 'checked="checked" ' : '') . 'value="1" name="wp-piwik[add_post_annotations][' . $post_type->name . ']" /> ' . $post_type->label . ' &nbsp; ';
247
+ echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#add_post_annotations-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="add_post_annotations-desc">' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/annotations/" target="_BLANK">', '</a>' ) . '</p></td></tr>';
248
+
249
+ $this->showCheckbox ( 'add_customvars_box', __ ( 'Show custom variables box', 'wp-piwik' ), __ ( ' Show a &quot;custom variables&quot; edit box on post edit page.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/custom-variables/" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
250
+
251
+ $this->showInput ( 'add_download_extensions', __ ( 'Add new file types for download tracking', 'wp-piwik' ), __ ( 'Add file extensions for download tracking, divided by a vertical bar (&#124;).', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#file-extensions-for-tracking-downloads" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
252
+
253
+ $this->showCheckbox ( 'disable_cookies', __ ( 'Disable cookies', 'wp-piwik' ), __ ( 'Disable all tracking cookies for a visitor.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
254
+
255
+ $this->showCheckbox ( 'limit_cookies', __ ( 'Limit cookie lifetime', 'wp-piwik' ), __ ( 'You can limit the cookie lifetime to avoid tracking your users over a longer period as necessary.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup, true, '$j(\'tr.wp-piwik-cookielifetime-option\').toggleClass(\'wp-piwik-hidden\');' );
256
+
257
+ $this->showInput ( 'limit_cookies_visitor', __ ( 'Visitor timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup.' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
258
+
259
+ $this->showInput ( 'limit_cookies_session', __ ( 'Session timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
260
+
261
+ $this->showInput ( 'limit_cookies_referral', __ ( 'Referral timeout (seconds)', 'wp-piwik' ), false, $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'limit_cookies' ), $fullGeneratedTrackingGroup .' wp-piwik-cookielifetime-option'. (self::$settings->getGlobalOption ( 'limit_cookies' )? '': ' wp-piwik-hidden') );
262
+
263
+ $this->showCheckbox ( 'track_admin', __ ( 'Track admin pages', 'wp-piwik' ), __ ( 'Enable to track users on admin pages (remember to configure the tracking filter appropriately).', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
264
+
265
+ echo '<tr class="' . $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' . ($isNotTracking ? ' hidden' : '') . '">';
266
+ echo '<th scope="row"><label for="capability_stealth">' . __ ( 'Tracking filter', 'wp-piwik' ) . '</label>:</th><td>';
267
+ $filter = self::$settings->getGlobalOption ( 'capability_stealth' );
268
+ foreach ( $wp_roles->role_names as $key => $name )
269
+ echo '<input type="checkbox" ' . (isset ( $filter [$key] ) && $filter [$key] ? 'checked="checked" ' : '') . 'value="1" name="wp-piwik[capability_stealth][' . $key . ']" /> ' . $name . ' &nbsp; ';
270
+ echo '<span class="dashicons dashicons-editor-help" onclick="$j(\'#capability_stealth-desc\').toggleClass(\'hidden\');"></span> <p class="description hidden" id="capability_stealth-desc">' . __ ( 'Choose users by user role you do <strong>not</strong> want to track.', 'wp-piwik' ) . '</p></td></tr>';
271
+
272
+ $this->showCheckbox ( 'track_across', __ ( 'Track subdomains in the same website', 'wp-piwik' ), __ ( 'Adds *.-prefix to cookie domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#tracking-subdomains-in-the-same-website" tagert="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
273
+
274
+ $this->showCheckbox ( 'track_across_alias', __ ( 'Do not count subdomains as outlink', 'wp-piwik' ), __ ( 'Adds *.-prefix to tracked domain.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#outlink-tracking-exclusions" target="_BLANK">', '</a>' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
275
+
276
+ $this->showCheckbox ( 'track_crossdomain_linking', __ ( 'Enable cross domain linking', 'wp-piwik' ), __ ( 'When enabled, it will make sure to use the same visitor ID for the same visitor across several domains. This works only when this feature is enabled because the visitor ID is stored in a cookie and cannot be read on the other domain by default. When this feature is enabled, it will append a URL parameter "pk_vid" that contains the visitor ID when a user clicks on a URL that belongs to one of your domains. For this feature to work, you also have to configure which domains should be treated as local in your Matomo website settings. This feature requires Matomo 3.0.2.', 'wp-piwik' ), self::$settings->getGlobalOption ( 'track_mode' ) == 'proxy', 'wp-piwik-track-option wp-piwik-track-option-default wp-piwik-track-option-js wp-piwik-track-option-manually');
277
+
278
+ $this->showCheckbox ( 'track_feed', __ ( 'Track RSS feeds', 'wp-piwik' ), __ ( 'Enable to track posts in feeds via tracking pixel.', 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually' );
279
+
280
+ $this->showCheckbox ( 'track_feed_addcampaign', __ ( 'Track RSS feed links as campaign', 'wp-piwik' ), __ ( 'This will add Matomo campaign parameters to the RSS feed links.' . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="http://piwik.org/docs/tracking-campaigns/" target="_BLANK">', '</a>' ), 'wp-piwik' ), $isNotTracking, $fullGeneratedTrackingGroup . ' wp-piwik-track-option-manually', true, '$j(\'tr.wp-piwik-feed_campaign-option\').toggle(\'hidden\');' );
281
+
282
+ $this->showInput ( 'track_feed_campaign', __ ( 'RSS feed campaign', 'wp-piwik' ), __ ( 'Keyword: post name.', 'wp-piwik' ), $isNotGeneratedTracking || ! self::$settings->getGlobalOption ( 'track_feed_addcampaign' ), $fullGeneratedTrackingGroup . ' wp-piwik-feed_campaign-option' );
283
+
284
+ $this->showInput ( 'track_heartbeat', __ ( 'Enable heartbeat timer', 'wp-piwik' ), __ ( 'Enable a heartbeat timer to get more accurate visit lengths by sending periodical HTTP ping requests as long as the site is opened. Enter the time between the pings in seconds (Matomo default: 15) to enable or 0 to disable this feature. <strong>Note:</strong> This will cause a lot of additional HTTP requests on your site.', 'wp-piwik' ), $isNotGeneratedTracking, $fullGeneratedTrackingGroup );
285
+
286
+ $this->showSelect ( 'track_user_id', __ ( 'User ID Tracking', 'wp-piwik' ), array (
287
+ 'disabled' => __ ( 'Disabled', 'wp-piwik' ),
288
+ 'uid' => __ ( 'WP User ID', 'wp-piwik' ),
289
+ 'email' => __ ( 'Email Address', 'wp-piwik' ),
290
+ 'username' => __ ( 'Username', 'wp-piwik' ),
291
+ 'displayname' => __ ( 'Display Name (Not Recommended!)', 'wp-piwik' )
292
+ ), __ ( 'When a user is logged in to WordPress, track their &quot;User ID&quot;. You can select which field from the User\'s profile is tracked as the &quot;User ID&quot;. When enabled, Tracking based on Email Address is recommended.', 'wp-piwik' ), '', $isNotTracking, $fullGeneratedTrackingGroup );
293
+
294
+ echo $submitButton;
295
+ echo '</tbody></table><table id="expert" class="wp-piwik_menu-tab hidden"><tbody>';
296
+
297
+ $this->showText ( __ ( 'Usually, you do not need to change these settings. If you want to do so, you should know what you do or you got an expert\'s advice.', 'wp-piwik' ) );
298
+
299
+ $this->showCheckbox ( 'cache', __ ( 'Enable cache', 'wp-piwik' ), __ ( 'Cache API calls, which not contain today\'s values, for a week.', 'wp-piwik' ) );
300
+
301
+ if (function_exists('curl_init') && ini_get('allow_url_fopen'))
302
+ $this->showSelect ( 'http_connection', __ ( 'HTTP connection via', 'wp-piwik' ), array (
303
+ 'curl' => __ ( 'cURL', 'wp-piwik' ),
304
+ 'fopen' => __ ( 'fopen', 'wp-piwik' )
305
+ ), __('Choose whether WP-Matomo should use cURL or fopen to connect to Matomo in HTTP or Cloud mode.', 'wp-piwik' ) );
306
+
307
+ $this->showSelect ( 'http_method', __ ( 'HTTP method', 'wp-piwik' ), array (
308
+ 'post' => __ ( 'POST', 'wp-piwik' ),
309
+ 'get' => __ ( 'GET', 'wp-piwik' )
310
+ ), __('Choose whether WP-Matomo should use POST or GET in HTTP or Cloud mode.', 'wp-piwik' ) );
311
+
312
+ $this->showCheckbox ( 'disable_timelimit', __ ( 'Disable time limit', 'wp-piwik' ), __ ( 'Use set_time_limit(0) if stats page causes a time out.', 'wp-piwik' ) );
313
+
314
+ $this->showInput ( 'connection_timeout', __ ( 'Connection timeout', 'wp-piwik' ), 'Define a connection timeout for all HTTP requests done by WP-Matomo in seconds.' );
315
+
316
+ $this->showCheckbox ( 'disable_ssl_verify', __ ( 'Disable SSL peer verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' );
317
+ $this->showCheckbox ( 'disable_ssl_verify_host', __ ( 'Disable SSL host verification', 'wp-piwik' ), '(' . __ ( 'not recommended', 'wp-piwik' ) . ')' );
318
+
319
+ $this->showSelect ( 'piwik_useragent', __ ( 'User agent', 'wp-piwik' ), array (
320
+ 'php' => __ ( 'Use the PHP default user agent', 'wp-piwik' ) . (ini_get ( 'user_agent' ) ? '(' . ini_get ( 'user_agent' ) . ')' : ' (' . __ ( 'empty', 'wp-piwik' ) . ')'),
321
+ 'own' => __ ( 'Define a specific user agent', 'wp-piwik' )
322
+ ), 'WP-Matomo can send the default user agent defined by your PHP settings or use a specific user agent below. The user agent is send by WP-Matomo if HTTP requests are performed.', '$j(\'tr.wp-piwik-useragent-option\').toggleClass(\'hidden\');' );
323
+ $this->showInput ( 'piwik_useragent_string', __ ( 'Specific user agent', 'wp-piwik' ), 'Define a user agent description which is send by WP-Matomo if HTTP requests are performed.', self::$settings->getGlobalOption ( 'piwik_useragent' ) != 'own', 'wp-piwik-useragent-option' );
324
+
325
+ $this->showCheckbox ( 'dnsprefetch', __ ( 'Enable DNS prefetch', 'wp-piwik' ), __ ( 'Add a DNS prefetch tag.' . ' ' . sprintf ( __ ( 'See %sMatomo Blog%s.', 'wp-piwik' ), '<a target="_BLANK" href="https://piwik.org/blog/2017/04/important-performance-optimizations-load-piwik-javascript-tracker-faster/">', '</a>' ), 'wp-piwik' ) );
326
+
327
+ $this->showCheckbox ( 'track_datacfasync', __ ( 'Add data-cfasync=false', 'wp-piwik' ), __ ( 'Adds data-cfasync=false to the script tag, e.g., to ask Rocket Loader to ignore the script.' . ' ' . sprintf ( __ ( 'See %sCloudFlare Knowledge Base%s.', 'wp-piwik' ), '<a href="https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-my-script-s-in-Automatic-Mode-" target="_BLANK">', '</a>' ), 'wp-piwik' ) );
328
+
329
+ $this->showInput ( 'track_cdnurl', __ ( 'CDN URL', 'wp-piwik' ).' http://', 'Enter URL if you want to load the tracking code via CDN.' );
330
+
331
+ $this->showInput ( 'track_cdnurlssl', __ ( 'CDN URL (SSL)', 'wp-piwik' ).' https://', 'Enter URL if you want to load the tracking code via a separate SSL CDN.' );
332
+
333
+ $this->showSelect ( 'force_protocol', __ ( 'Force Matomo to use a specific protocol', 'wp-piwik' ), array (
334
+ 'disabled' => __ ( 'Disabled (default)', 'wp-piwik' ),
335
+ 'http' => __ ( 'http', 'wp-piwik' ),
336
+ 'https' => __ ( 'https (SSL)', 'wp-piwik' )
337
+ ), __ ( 'Choose if you want to explicitly force Matomo to use HTTP or HTTPS. Does not work with a CDN URL.', 'wp-piwik' ) );
338
+
339
+ $this->showSelect ( 'update_notice', __ ( 'Update notice', 'wp-piwik' ), array (
340
+ 'enabled' => __ ( 'Show always if WP-Matomo is updated', 'wp-piwik' ),
341
+ 'script' => __ ( 'Show only if WP-Matomo is updated and settings were changed', 'wp-piwik' ),
342
+ 'disabled' => __ ( 'Disabled', 'wp-piwik' )
343
+ ), __ ( 'Choose if you want to get an update notice if WP-Matomo is updated.', 'wp-piwik' ) );
344
+
345
+ $this->showInput ( 'set_download_extensions', __ ( 'Define all file types for download tracking', 'wp-piwik' ), __ ( 'Replace Matomo\'s default file extensions for download tracking, divided by a vertical bar (&#124;). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo documentation%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/guides/tracking-javascript-guide#file-extensions-for-tracking-downloads" target="_BLANK">', '</a>' ) );
346
+
347
+ $this->showInput ( 'set_download_classes', __ ( 'Set classes to be treated as downloads', 'wp-piwik' ), __ ( 'Set classes to be treated as downloads (in addition to piwik_download), divided by a vertical bar (&#124;). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo JavaScript Tracking Client reference%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/api-reference/tracking-javascript" target="_BLANK">', '</a>' ) );
348
+
349
+ $this->showInput ( 'set_link_classes', __ ( 'Set classes to be treated as outlinks', 'wp-piwik' ), __ ( 'Set classes to be treated as outlinks (in addition to piwik_link), divided by a vertical bar (&#124;). Leave blank to keep Matomo\'s default settings.', 'wp-piwik' ) . ' ' . sprintf ( __ ( 'See %sMatomo JavaScript Tracking Client reference%s.', 'wp-piwik' ), '<a href="https://developer.piwik.org/api-reference/tracking-javascript" target="_BLANK">', '</a>' ) );
350
+
351
+ echo $submitButton;
352
+ ?>
353
+ </tbody>
354
+ </table>
355
+ <table id="support" class="wp-piwik_menu-tab hidden">
356
+ <tbody>
357
+ <tr><td colspan="2"><?php
358
+ echo $this->showSupport();
359
+ ?></td></tr>
360
+ </tbody>
361
+ </table>
362
+ <table id="credits" class="wp-piwik_menu-tab hidden">
363
+ <tbody>
364
+ <tr><td colspan="2"><?php
365
+ echo $this->showCredits();
366
+ ?></td></tr>
367
+ </tbody>
368
+ </table>
369
+ <input type="hidden" name="wp-piwik[proxy_url]"
370
+ value="<?php echo self::$settings->getGlobalOption('proxy_url'); ?>" />
371
+ </form>
372
+ </div>
373
+ <?php
374
+ }
375
+
376
+ /**
377
+ * Show an option's description
378
+ *
379
+ * @param string $id option id
380
+ * @param string $description option description
381
+ * @param boolean $hideDescription set to false to show description initially (default: true)
382
+ * @return string full description HTML
383
+ */
384
+ private function getDescription($id, $description, $hideDescription = true) {
385
+ return sprintf ( '<span class="dashicons dashicons-editor-help" onclick="$j(\'#%s-desc\').toggleClass(\'hidden\');"></span> <p class="description' . ($hideDescription ? ' hidden' : '') . '" id="%1$s-desc">%s</p>', $id, $description );
386
+ }
387
+
388
+ /**
389
+ * Show a checkbox option
390
+ *
391
+ * @param string $id option id
392
+ * @param string $name descriptive option name
393
+ * @param string $description option description
394
+ * @param boolean $isHidden set to true to initially hide the option (default: false)
395
+ * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
396
+ * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
397
+ * @param string $onChange javascript for onchange event (default: empty)
398
+ */
399
+ private function showCheckbox($id, $name, $description, $isHidden = false, $groupName = '', $hideDescription = true, $onChange = '') {
400
+ printf ( '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s</label>:</th><td><input type="checkbox" value="1"' . (self::$settings->getGlobalOption ( $id ) ? ' checked="checked"' : '') . ' onchange="$j(\'#%s\').val(this.checked?1:0);%s" /><input id="%2$s" type="hidden" name="wp-piwik[%2$s]" value="' . ( int ) self::$settings->getGlobalOption ( $id ) . '" /> %s</td></tr>', $name, $id, $onChange, $this->getDescription ( $id, $description, $hideDescription ) );
401
+ }
402
+
403
+ /**
404
+ * Show a textarea option
405
+ *
406
+ * @param string $id option id
407
+ * @param string $name descriptive option name
408
+ * @param int $rows number of rows to show
409
+ * @param string $description option description
410
+ * @param boolean $isHidden set to true to initially hide the option (default: false)
411
+ * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
412
+ * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
413
+ * @param string $onChange javascript for onchange event (default: empty)
414
+ * @param boolean $isReadonly set textarea to read only (default: false)
415
+ * @param boolean $global set to false if the textarea shows a site-specific option (default: true)
416
+ */
417
+ private function showTextarea($id, $name, $rows, $description, $isHidden, $groupName, $hideDescription = true, $onChange = '', $isReadonly = false, $global = true) {
418
+ printf (
419
+ '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s</label>:</th><td><textarea cols="80" rows="' . $rows . '" id="%s" name="wp-piwik[%2$s]" onchange="%s"' . ($isReadonly ? ' readonly="readonly"' : '') . '>%s</textarea> %s</td></tr>', $name, $id, $onChange, ($global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id )), $this->getDescription ( $id, $description, $hideDescription ) );
420
+ }
421
+
422
+ /**
423
+ * Show a simple text
424
+ *
425
+ * @param string $text Text to show
426
+ */
427
+ private function showText($text) {
428
+ printf ( '<tr><td colspan="2"><p>%s</p></td></tr>', $text );
429
+ }
430
+
431
+ /**
432
+ * Show an input option
433
+ *
434
+ * @param string $id option id
435
+ * @param string $name descriptive option name
436
+ * @param string $description option description
437
+ * @param boolean $isHidden set to true to initially hide the option (default: false)
438
+ * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
439
+ * @param string $rowName define a class name to access the specific option row by javascript (default: empty)
440
+ * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
441
+ * @param boolean $wide Create a wide box (default: false)
442
+ */
443
+ private function showInput($id, $name, $description, $isHidden = false, $groupName = '', $rowName = false, $hideDescription = true, $wide = false) {
444
+ printf ( '<tr class="%s%s"%s><th scope="row"><label for="%5$s">%s:</label></th><td><input '.($wide?'class="wp-piwik-wide" ':'').'name="wp-piwik[%s]" id="%5$s" value="%s" /> %s</td></tr>', $isHidden ? 'hidden ' : '', $groupName ? $groupName : '', $rowName ? ' id="' . $groupName . '-' . $rowName . '"' : '', $name, $id, htmlentities(self::$settings->getGlobalOption( $id ), ENT_QUOTES, 'UTF-8', false), !empty($description) ? $this->getDescription ( $id, $description, $hideDescription ) : '' );
445
+ }
446
+
447
+ /**
448
+ * Show a select box option
449
+ *
450
+ * @param string $id option id
451
+ * @param string $name descriptive option name
452
+ * @param array $options list of options to show array[](option id => descriptive name)
453
+ * @param string $description option description
454
+ * @param string $onChange javascript for onchange event (default: empty)
455
+ * @param boolean $isHidden set to true to initially hide the option (default: false)
456
+ * @param string $groupName define a class name to access a group of option rows by javascript (default: empty)
457
+ * @param boolean $hideDescription $hideDescription set to false to show description initially (default: true)
458
+ * @param boolean $global set to false if the textarea shows a site-specific option (default: true)
459
+ */
460
+ private function showSelect($id, $name, $options = array(), $description = '', $onChange = '', $isHidden = false, $groupName = '', $hideDescription = true, $global = true) {
461
+ $optionList = '';
462
+ $default = $global ? self::$settings->getGlobalOption ( $id ) : self::$settings->getOption ( $id );
463
+ if (is_array ( $options ))
464
+ foreach ( $options as $key => $value )
465
+ $optionList .= sprintf ( '<option value="%s"' . ($key == $default ? ' selected="selected"' : '') . '>%s</option>', $key, $value );
466
+ printf ( '<tr class="' . $groupName . ($isHidden ? ' hidden' : '') . '"><th scope="row"><label for="%2$s">%s:</label></th><td><select name="wp-piwik[%s]" id="%2$s" onchange="%s">%s</select> %s</td></tr>', $name, $id, $onChange, $optionList, $this->getDescription ( $id, $description, $hideDescription ) );
467
+ }
468
+
469
+ /**
470
+ * Show an info box
471
+ *
472
+ * @param string $type box style (e.g., updated, error)
473
+ * @param string $icon box icon, see https://developer.wordpress.org/resource/dashicons/
474
+ * @param string $content box message
475
+ */
476
+ private function showBox($type, $icon, $content) {
477
+ printf ( '<tr><td colspan="2"><div class="%s"><p><span class="dashicons dashicons-%s"></span> %s</p></div></td></tr>', $type, $icon, $content );
478
+ }
479
+
480
+ /**
481
+ * Show headline
482
+ * @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging
483
+ * @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/
484
+ * @param string $headline headline text
485
+ * @param string $addPluginName set to true to add the plugin name to the headline (default: false)
486
+ */
487
+ private function showHeadline($order, $icon, $headline, $addPluginName = false) {
488
+ echo $this->getHeadline ( $order, $icon, $headline, $addPluginName = false );
489
+ }
490
+
491
+ /**
492
+ * Get headline HTML
493
+ *
494
+ * @param int $order headline order (h?-tag), set to 0 to avoid headline-tagging
495
+ * @param string $icon headline icon, see https://developer.wordpress.org/resource/dashicons/
496
+ * @param string $headline headline text
497
+ * @param string $addPluginName set to true to add the plugin name to the headline (default: false)
498
+ */
499
+ private function getHeadline($order, $icon, $headline, $addPluginName = false) {
500
+ echo ($order > 0 ? "<h$order>" : '') . sprintf ( '<span class="dashicons dashicons-%s"></span> %s%s', $icon, ($addPluginName ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' ' : ''), __ ( $headline, 'wp-piwik' ) ) . ($order > 0 ? "</h$order>" : '');
501
+ }
502
+
503
+ /**
504
+ * Show donation info
505
+ */
506
+ private function showDonation() {
507
+ ?>
508
+ <div class="wp-piwik-donate">
509
+ <p>
510
+ <strong><?php _e('Donate','wp-piwik'); ?></strong>
511
+ </p>
512
+ <p>
513
+ <?php _e('If you like WP-Matomo, you can support its development by a donation:', 'wp-piwik'); ?>
514
+ </p>
515
+ <div>
516
+ <script id='fb0ahsp'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//button.flattr.com/view/?fid=mkdp7z&url=https%3A%2F%2Fwww.braekling.de%2Fwp-piwik-wpmu-piwik-wordpress';f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fb0ahsp');</script>
517
+ </div>
518
+ <div>
519
+ Paypal
520
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
521
+ <input type="hidden" name="cmd" value="_s-xclick" />
522
+ <input type="hidden" name="hosted_button_id" value="6046779" />
523
+ <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donateCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online." />
524
+ <img alt="" border="0" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1" />
525
+ </form>
526
+ </div>
527
+ <div>
528
+ <a href="bitcoin:32FMBngRne9wQ7XPFP2CfR25tjp3oa4roN">Bitcoin<br />
529
+ <img style="border:none;" src="<?php echo self::$wpPiwik->getPluginURL(); ?>bitcoin.png" width="100" height="100" alt="Bitcoin Address" title="32FMBngRne9wQ7XPFP2CfR25tjp3oa4roN" /></a>
530
+ </div>
531
+ <div>
532
+ <a href="http://www.amazon.de/gp/registry/wishlist/111VUJT4HP1RA?reveal=unpurchased&amp;filter=all&amp;sort=priority&amp;layout=standard&amp;x=12&amp;y=14"><?php _e('My Amazon.de wishlist', 'wp-piwik'); ?></a>
533
+ </div>
534
+ <div>
535
+ <?php _e('Please don\'t forget to vote the compatibility at the','wp-piwik'); ?> <a target="_BLANK" href="http://wordpress.org/extend/plugins/wp-piwik/">WordPress.org Plugin Directory</a>.
536
+ </div>
537
+ </div><?php
538
+ }
539
+
540
+ /**
541
+ * Register admin scripts
542
+ *
543
+ * @see \WP_Piwik\Admin::printAdminScripts()
544
+ */
545
+ public function printAdminScripts() {
546
+ wp_enqueue_script ( 'jquery' );
547
+ }
548
+
549
+ /**
550
+ * Extend admin header
551
+ *
552
+ * @see \WP_Piwik\Admin::extendAdminHeader()
553
+ */
554
+ public function extendAdminHeader() {
555
+ echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
556
+ }
557
+
558
+ /**
559
+ * Show credits
560
+ */
561
+ public function showCredits() {
562
+ ?>
563
+ <p><strong><?php _e('Thank you very much for your donation', 'wp-piwik'); ?>:</strong> Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., Nicolas, J., Andre M., Steve J., Jakub P., ditho.berlin, Robert R., Simon B., Grzegorz O., <?php _e('the Matomo team itself','wp-piwik');?><?php _e(', and all people flattering this','wp-piwik'); ?>!</p>
564
+ <p><?php _e('Graphs powered by <a href="http://www.jqplot.com/" target="_BLANK">jqPlot</a> (License: GPL 2.0 and MIT) and <a href="http://omnipotent.net/jquery.sparkline/" target="_BLANK">jQuery Sparklines</a> (License: New BSD License).','wp-piwik'); ?></p>
565
+ <p><?php _e('Thank you very much','wp-piwik'); ?>, <?php _e('Transifex and WordPress translation community for your translation work.','wp-piwik'); ?>!</p>
566
+ <p><?php _e('Thank you very much, all users who send me mails containing criticism, commendation, feature requests and bug reports! You help me to make WP-Matomo much better.','wp-piwik'); ?></p>
567
+ <p><?php _e('Thank <strong>you</strong> for using my plugin. It is the best commendation if my piece of code is really used!','wp-piwik'); ?></p>
568
+ <?php
569
+ }
570
+
571
+ /**
572
+ * Show support information
573
+ */
574
+ public function showSupport() {
575
+ ?><ul>
576
+ <li><?php _e('The best place to get help:', 'wp-piwik'); ?> <a href="https://wordpress.org/support/plugin/wp-piwik" target="_BLANK"><?php _e('WP-Matomo support forum','wp-piwik'); ?></a></li>
577
+ <li><?php _e('Please don\'t forget to vote the compatibility at the','wp-piwik'); ?> <a href="http://wordpress.org/extend/plugins/wp-piwik/" target="_BLANK">WordPress.org Plugin Directory</a>.</li>
578
+ </ul>
579
+ <h3><?php _e('Debugging', 'wp-piwik'); ?></h3>
580
+ <p><?php _e('Either allow_url_fopen has to be enabled <em>or</em> cURL has to be available:', 'wp-piwik'); ?></p>
581
+ <ol>
582
+ <li><?php
583
+ _e('cURL is','wp-piwik');
584
+ echo ' <strong>'.(function_exists('curl_init')?'':__('not','wp-piwik')).' ';
585
+ _e('available','wp-piwik');
586
+ ?></strong>.</li>
587
+ <li><?php
588
+ _e('allow_url_fopen is','wp-piwik');
589
+ echo ' <strong>'.(ini_get('allow_url_fopen')?'':__('not','wp-piwik')).' ';
590
+ _e('enabled','wp-piwik');
591
+ ?></strong>.</li>
592
+ <li><strong><?php echo (((function_exists('curl_init') && ini_get('allow_url_fopen') && self::$settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen')))?__('cURL', 'wp-piwik'):__('fopen', 'wp-piwik')).' ('.(self::$settings->getGlobalOption('http_method')=='post'?__('POST','wp-piwik'):__('GET','wp-piwik')).')</strong> '.__('is used.', 'wp-piwik'); ?></li>
593
+ <?php if (self::$settings->getGlobalOption('piwik_mode') == 'php') { ?><li><?php
594
+ _e('Determined Matomo base URL is', 'wp-piwik');
595
+ echo ' <strong>'.(self::$settings->getGlobalOption('proxy_url')).'</strong>';
596
+ ?></li><?php } ?>
597
+ </ol>
598
+ <p><?php _e('Tools', 'wp-piwik'); ?>:</p>
599
+ <ol>
600
+ <li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&testscript=1' ); ?>"><?php _e('Run testscript', 'wp-piwik'); ?></a></li>
601
+ <li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&sitebrowser=1' ); ?>"><?php _e('Sitebrowser', 'wp-piwik'); ?></a></li>
602
+ <li><a href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&clear=1' ); ?>"><?php _e('Clear cache', 'wp-piwik'); ?></a></li>
603
+ <li><a onclick="return confirm('<?php _e('Are you sure you want to clear all settings?', 'wp-piwik'); ?>')" href="<?php echo admin_url( (self::$settings->checkNetworkActivation () ? 'network/settings' : 'options-general').'.php?page='.$_GET['page'].'&clear=2' ); ?>"><?php _e('Reset WP-Matomo', 'wp-piwik'); ?></a></li>
604
+ </ol>
605
+ <h3><?php _e('Latest support threads on WordPress.org', 'wp-piwik'); ?></h3><?php
606
+ $supportThreads = $this->readRSSFeed('http://wordpress.org/support/rss/plugin/wp-piwik');
607
+ if (!empty($supportThreads)) {
608
+ echo '<ol>';
609
+ foreach ($supportThreads as $supportThread)
610
+ echo '<li><a href="'.$supportThread['url'].'">'.$supportThread['title'].'</a></li>';
611
+ echo '</ol>';
612
+ }
613
+ }
614
+
615
+ /**
616
+ * Read RSS feed
617
+ *
618
+ * @param string $feed
619
+ * feed URL
620
+ * @param int $cnt
621
+ * item limit
622
+ * @return array feed items array[](title, url)
623
+ *
624
+ */
625
+ private function readRSSFeed($feed, $cnt = 5) {
626
+ $result = array ();
627
+ if (function_exists ( 'simplexml_load_file' ) && ! empty ( $feed )) {
628
+ $xml = @simplexml_load_file ( $feed );
629
+ if (! $xml || ! isset ( $xml->channel [0]->item ))
630
+ return array (
631
+ array (
632
+ 'title' => 'Can\'t read RSS feed.',
633
+ 'url' => $xml
634
+ )
635
+ );
636
+ foreach ( $xml->channel [0]->item as $item ) {
637
+ if ($cnt -- == 0)
638
+ break;
639
+ $result [] = array (
640
+ 'title' => $item->title [0],
641
+ 'url' => $item->link [0]
642
+ );
643
+ }
644
+ }
645
+ return $result;
646
+ }
647
+
648
+ /**
649
+ * Clear cache and reset settings
650
+ *
651
+ * @param boolean $clearSettings set to true to reset settings (default: false)
652
+ */
653
+ private function clear($clearSettings = false) {
654
+ if ($clearSettings) {
655
+ self::$settings->resetSettings();
656
+ $this->showBox ( 'updated', 'yes', __ ( 'Settings cleared (except connection settings).' ) );
657
+ }
658
+ global $wpdb;
659
+ if (self::$settings->checkNetworkActivation()) {
660
+ $aryBlogs = \WP_Piwik\Settings::getBlogList();
661
+ if (is_array($aryBlogs))
662
+ foreach ($aryBlogs as $aryBlog) {
663
+ switch_to_blog($aryBlog['blog_id']);
664
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'");
665
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'");
666
+ restore_current_blog();
667
+ }
668
+ } else {
669
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_wp-piwik_%'");
670
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_wp-piwik_%'");
671
+ }
672
+ $this->showBox ( 'updated', 'yes', __ ( 'Cache cleared.' ) );
673
+ }
674
+
675
+ /**
676
+ * Execute test script and display results
677
+ */
678
+ private function runTestscript() { ?>
679
+ <div class="wp-piwik-debug">
680
+ <h2>Testscript Result</h2>
681
+ <?php
682
+ if (self::$wpPiwik->isConfigured()) {
683
+ if (isset($_GET['testscript_id']) && $_GET['testscript_id'])
684
+ switch_to_blog((int) $_GET['testscript_id']);
685
+ ?>
686
+ <textarea cols="80" rows="10"><?php
687
+ echo '`WP-Matomo '.self::$wpPiwik->getPluginVersion()."\nMode: ".self::$settings->getGlobalOption('piwik_mode')."\n\n";
688
+ ?>Test 1/3: global.getPiwikVersion<?php
689
+ $GLOBALS ['wp-piwik_debug'] = true;
690
+ $id = \WP_Piwik\Request::register ( 'API.getPiwikVersion', array() );
691
+ echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
692
+ var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
693
+ $GLOBALS ['wp-piwik_debug'] = false;
694
+ ?>Test 2/3: SitesManager.getSitesWithAtLeastViewAccess<?php
695
+ $GLOBALS ['wp-piwik_debug'] = true;
696
+ $id = \WP_Piwik\Request::register ( 'SitesManager.getSitesWithAtLeastViewAccess', array() );
697
+ echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
698
+ var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
699
+ $GLOBALS ['wp-piwik_debug'] = false;
700
+ ?>Test 3/3: SitesManager.getSitesIdFromSiteUrl<?php
701
+ $GLOBALS ['wp-piwik_debug'] = true;
702
+ $id = \WP_Piwik\Request::register ( 'SitesManager.getSitesIdFromSiteUrl', array (
703
+ 'url' => get_bloginfo ( 'url' )
704
+ ) );
705
+ echo "\n\n"; var_dump( self::$wpPiwik->request( $id ) ); echo "\n";
706
+ var_dump( self::$wpPiwik->request( $id, true ) ); echo "\n";
707
+ echo "\n\n"; var_dump( self::$settings->getDebugData() ); echo "`";
708
+ $GLOBALS ['wp-piwik_debug'] = false;
709
+ ?></textarea>
710
+ <?php
711
+ if (isset($_GET['testscript_id']) && $_GET['testscript_id'])
712
+ restore_current_blog();
713
+ } else echo '<p>Please configure WP-Matomo first.</p>';
714
+ ?>
715
+ </div>
716
+ <?php }
717
+
718
+ }
classes/WP_Piwik/Admin/Sitebrowser.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
-
3
- namespace WP_Piwik\Admin;
4
-
5
- if (! class_exists ( 'WP_List_Table' ))
6
- require_once (ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
7
-
8
- class Sitebrowser extends \WP_List_Table {
9
-
10
- private $data = array (), $wpPiwik;
11
-
12
- public function __construct($wpPiwik) {
13
- $this->wpPiwik = $wpPiwik;
14
- if( isset($_POST['s']) ){
15
- $cnt = $this->prepare_items ($_POST['s']);
16
- } else {
17
- $cnt = $this->prepare_items ();
18
- }
19
- global $status, $page;
20
- $this->showSearchForm();
21
- parent::__construct ( array (
22
- 'singular' => __ ( 'site', 'wp-piwik' ),
23
- 'plural' => __ ( 'sites', 'wp-piwik' ),
24
- 'ajax' => false
25
- ) );
26
- if ($cnt > 0)
27
- $this->display ();
28
- else
29
- echo '<p>' . __ ( 'No site configured yet.', 'wp-piwik' ) . '</p>';
30
- }
31
-
32
- public function get_columns() {
33
- $columns = array (
34
- 'id' => __ ( 'Blog ID', 'wp-piwik' ),
35
- 'name' => __ ( 'Title', 'wp-piwik' ),
36
- 'siteurl' => __ ( 'URL', 'wp-piwik' ),
37
- 'piwikid' => __ ( 'Site ID (Piwik)', 'wp-piwik' )
38
- );
39
- return $columns;
40
- }
41
-
42
- public function prepare_items($search = '') {
43
- $current_page = $this->get_pagenum ();
44
- $per_page = 10;
45
- global $blog_id;
46
- global $wpdb;
47
- global $pagenow;
48
- if (is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' )) {
49
- $total_items = $wpdb->get_var ( $wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->blogs . ' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0', $search));
50
- $blogs = \WP_Piwik\Settings::getBlogList($per_page, $current_page, $search);
51
- foreach ( $blogs as $blog ) {
52
- $blogDetails = get_blog_details ( $blog['blog_id'], true );
53
- $this->data [] = array (
54
- 'name' => $blogDetails->blogname,
55
- 'id' => $blogDetails->blog_id,
56
- 'siteurl' => $blogDetails->siteurl,
57
- 'piwikid' => $this->wpPiwik->getPiwikSiteId ( $blogDetails->blog_id )
58
- );
59
- }
60
- } else {
61
- $blogDetails = get_bloginfo ();
62
- $this->data [] = array (
63
- 'name' => get_bloginfo ( 'name' ),
64
- 'id' => '-',
65
- 'siteurl' => get_bloginfo ( 'url' ),
66
- 'piwikid' => $this->wpPiwik->getPiwikSiteId ()
67
- );
68
- $total_items = 1;
69
- }
70
- $columns = $this->get_columns ();
71
- $hidden = array ();
72
- $sortable = array ();
73
- $this->_column_headers = array (
74
- $columns,
75
- $hidden,
76
- $sortable
77
- );
78
- $this->set_pagination_args ( array (
79
- 'total_items' => $total_items,
80
- 'per_page' => $per_page
81
- ) );
82
- foreach ( $this->data as $key => $dataset ) {
83
- if (empty ( $dataset ['piwikid'] ) || $dataset ['piwikid'] == 'n/a')
84
- $this->data [$key] ['piwikid'] = __ ( 'Site not created yet.', 'wp-piwik' );
85
- if ($this->wpPiwik->isNetworkMode ())
86
- $this->data [$key] ['name'] = '<a href="index.php?page=wp-piwik_stats&wpmu_show_stats=' . $dataset ['id'] . '">' . $dataset ['name'] . '</a>';
87
- }
88
- $this->items = $this->data;
89
- return count ( $this->items );
90
- }
91
-
92
- public function column_default($item, $column_name) {
93
- switch ($column_name) {
94
- case 'id' :
95
- case 'name' :
96
- case 'siteurl' :
97
- case 'piwikid' :
98
- return $item [$column_name];
99
- default :
100
- return print_r ( $item, true );
101
- }
102
- }
103
-
104
- private function showSearchForm() {
105
- ?>
106
- <form method="post">
107
- <input type="hidden" name="page" value="<?php echo filter_var($_REQUEST['page'], FILTER_SANITIZE_STRING) ?>" />
108
- <?php $this->search_box('Search domain and path', 'wpPiwikSiteSearch'); ?>
109
- </form>
110
- <?php
111
- }
112
  }
1
+ <?php
2
+
3
+ namespace WP_Piwik\Admin;
4
+
5
+ if (! class_exists ( 'WP_List_Table' ))
6
+ require_once (ABSPATH . 'wp-admin/includes/class-wp-list-table.php');
7
+
8
+ class Sitebrowser extends \WP_List_Table {
9
+
10
+ private $data = array (), $wpPiwik;
11
+
12
+ public function __construct($wpPiwik) {
13
+ $this->wpPiwik = $wpPiwik;
14
+ if( isset($_POST['s']) ){
15
+ $cnt = $this->prepare_items ($_POST['s']);
16
+ } else {
17
+ $cnt = $this->prepare_items ();
18
+ }
19
+ global $status, $page;
20
+ $this->showSearchForm();
21
+ parent::__construct ( array (
22
+ 'singular' => __ ( 'site', 'wp-piwik' ),
23
+ 'plural' => __ ( 'sites', 'wp-piwik' ),
24
+ 'ajax' => false
25
+ ) );
26
+ if ($cnt > 0)
27
+ $this->display ();
28
+ else
29
+ echo '<p>' . __ ( 'No site configured yet.', 'wp-piwik' ) . '</p>';
30
+ }
31
+
32
+ public function get_columns() {
33
+ $columns = array (
34
+ 'id' => __ ( 'Blog ID', 'wp-piwik' ),
35
+ 'name' => __ ( 'Title', 'wp-piwik' ),
36
+ 'siteurl' => __ ( 'URL', 'wp-piwik' ),
37
+ 'piwikid' => __ ( 'Site ID (Piwik)', 'wp-piwik' )
38
+ );
39
+ return $columns;
40
+ }
41
+
42
+ public function prepare_items($search = '') {
43
+ $current_page = $this->get_pagenum ();
44
+ $per_page = 10;
45
+ global $blog_id;
46
+ global $wpdb;
47
+ global $pagenow;
48
+ if (is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' )) {
49
+ $total_items = $wpdb->get_var ( $wpdb->prepare('SELECT COUNT(*) FROM ' . $wpdb->blogs . ' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0', $search));
50
+ $blogs = \WP_Piwik\Settings::getBlogList($per_page, $current_page, $search);
51
+ foreach ( $blogs as $blog ) {
52
+ $blogDetails = get_blog_details ( $blog['blog_id'], true );
53
+ $this->data [] = array (
54
+ 'name' => $blogDetails->blogname,
55
+ 'id' => $blogDetails->blog_id,
56
+ 'siteurl' => $blogDetails->siteurl,
57
+ 'piwikid' => $this->wpPiwik->getPiwikSiteId ( $blogDetails->blog_id )
58
+ );
59
+ }
60
+ } else {
61
+ $blogDetails = get_bloginfo ();
62
+ $this->data [] = array (
63
+ 'name' => get_bloginfo ( 'name' ),
64
+ 'id' => '-',
65
+ 'siteurl' => get_bloginfo ( 'url' ),
66
+ 'piwikid' => $this->wpPiwik->getPiwikSiteId ()
67
+ );
68
+ $total_items = 1;
69
+ }
70
+ $columns = $this->get_columns ();
71
+ $hidden = array ();
72
+ $sortable = array ();
73
+ $this->_column_headers = array (
74
+ $columns,
75
+ $hidden,
76
+ $sortable
77
+ );
78
+ $this->set_pagination_args ( array (
79
+ 'total_items' => $total_items,
80
+ 'per_page' => $per_page
81
+ ) );
82
+ foreach ( $this->data as $key => $dataset ) {
83
+ if (empty ( $dataset ['piwikid'] ) || $dataset ['piwikid'] == 'n/a')
84
+ $this->data [$key] ['piwikid'] = __ ( 'Site not created yet.', 'wp-piwik' );
85
+ if ($this->wpPiwik->isNetworkMode ())
86
+ $this->data [$key] ['name'] = '<a href="index.php?page=wp-piwik_stats&wpmu_show_stats=' . $dataset ['id'] . '">' . $dataset ['name'] . '</a>';
87
+ }
88
+ $this->items = $this->data;
89
+ return count ( $this->items );
90
+ }
91
+
92
+ public function column_default($item, $column_name) {
93
+ switch ($column_name) {
94
+ case 'id' :
95
+ case 'name' :
96
+ case 'siteurl' :
97
+ case 'piwikid' :
98
+ return $item [$column_name];
99
+ default :
100
+ return print_r ( $item, true );
101
+ }
102
+ }
103
+
104
+ private function showSearchForm() {
105
+ ?>
106
+ <form method="post">
107
+ <input type="hidden" name="page" value="<?php echo filter_var($_REQUEST['page'], FILTER_SANITIZE_STRING) ?>" />
108
+ <?php $this->search_box('Search domain and path', 'wpPiwikSiteSearch'); ?>
109
+ </form>
110
+ <?php
111
+ }
112
  }
classes/WP_Piwik/Admin/Statistics.php CHANGED
File without changes
classes/WP_Piwik/Logger.php CHANGED
File without changes
classes/WP_Piwik/Logger/Dummy.php CHANGED
File without changes
classes/WP_Piwik/Logger/File.php CHANGED
File without changes
classes/WP_Piwik/Logger/Screen.php CHANGED
File without changes
classes/WP_Piwik/Request.php CHANGED
File without changes
classes/WP_Piwik/Request/Php.php CHANGED
File without changes
classes/WP_Piwik/Request/Rest.php CHANGED
@@ -8,7 +8,9 @@
8
  $count = 0;
9
  $url = self::$settings->getGlobalOption('piwik_mode') == 'http'?
10
  self::$settings->getGlobalOption('piwik_url'):
11
- 'https://'.self::$settings->getGlobalOption('piwik_user').'.innocraft.cloud/';
 
 
12
  $params = 'module=API&method=API.getBulkRequest&format=json';
13
  foreach (self::$requests as $requestID => $config) {
14
  if (!isset(self::$results[$requestID])) {
8
  $count = 0;
9
  $url = self::$settings->getGlobalOption('piwik_mode') == 'http'?
10
  self::$settings->getGlobalOption('piwik_url'):
11
+ self::$settings->getGlobalOption('piwik_mode') == 'cloud'?
12
+ 'https://'.self::$settings->getGlobalOption('piwik_user').'.innocraft.cloud/':
13
+ 'https://'.self::$settings->getGlobalOption('matomo_user').'.matomo.cloud/';
14
  $params = 'module=API&method=API.getBulkRequest&format=json';
15
  foreach (self::$requests as $requestID => $config) {
16
  if (!isset(self::$results[$requestID])) {
classes/WP_Piwik/Settings.php CHANGED
@@ -1,406 +1,407 @@
1
- <?php
2
-
3
- namespace WP_Piwik;
4
-
5
- /**
6
- * Manage WP-Piwik settings
7
- *
8
- * @author Andr&eacute; Br&auml;kling
9
- * @package WP_Piwik
10
- */
11
- class Settings {
12
-
13
- /**
14
- *
15
- * @var Environment variables and default settings container
16
- */
17
- private static $wpPiwik, $defaultSettings;
18
-
19
- /**
20
- *
21
- * @var Define callback functions for changed settings
22
- */
23
- private $checkSettings = array (
24
- 'piwik_url' => 'checkPiwikUrl',
25
- 'piwik_token' => 'checkPiwikToken',
26
- 'site_id' => 'requestPiwikSiteID',
27
- 'tracking_code' => 'prepareTrackingCode',
28
- 'noscript_code' => 'prepareNocscriptCode'
29
- );
30
-
31
- /**
32
- *
33
- * @var Register default configuration set
34
- */
35
- private $globalSettings = array (
36
- // Plugin settings
37
- 'revision' => 0,
38
- 'last_settings_update' => 0,
39
- // User settings: Piwik configuration
40
- 'piwik_mode' => 'http',
41
- 'piwik_url' => '',
42
- 'piwik_path' => '',
43
- 'piwik_user' => '',
44
- 'piwik_token' => '',
45
- 'auto_site_config' => true,
46
- // User settings: Stats configuration
47
- 'default_date' => 'yesterday',
48
- 'stats_seo' => false,
49
- 'stats_ecommerce' => false,
50
- 'dashboard_widget' => false,
51
- 'dashboard_ecommerce' => false,
52
- 'dashboard_chart' => false,
53
- 'dashboard_seo' => false,
54
- 'toolbar' => false,
55
- 'capability_read_stats' => array (
56
- 'administrator' => true
57
- ),
58
- 'perpost_stats' => false,
59
- 'plugin_display_name' => 'WP-Piwik',
60
- 'piwik_shortcut' => false,
61
- 'shortcodes' => false,
62
- // User settings: Tracking configuration
63
- 'track_mode' => 'disabled',
64
- 'track_codeposition' => 'footer',
65
- 'track_noscript' => false,
66
- 'track_nojavascript' => false,
67
- 'proxy_url' => '',
68
- 'track_content' => 'disabled',
69
- 'track_search' => false,
70
- 'track_404' => false,
71
- 'add_post_annotations' => array(),
72
- 'add_customvars_box' => false,
73
- 'add_download_extensions' => '',
74
- 'set_download_extensions' => '',
75
- 'set_link_classes' => '',
76
- 'set_download_classes' => '',
77
- 'disable_cookies' => false,
78
- 'limit_cookies' => false,
79
- 'limit_cookies_visitor' => 34186669, // Piwik default 13 months
80
- 'limit_cookies_session' => 1800, // Piwik default 30 minutes
81
- 'limit_cookies_referral' => 15778463, // Piwik default 6 months
82
- 'track_admin' => false,
83
- 'capability_stealth' => array (),
84
- 'track_across' => false,
85
- 'track_across_alias' => false,
86
- 'track_crossdomain_linking' => false,
87
- 'track_feed' => false,
88
- 'track_feed_addcampaign' => false,
89
- 'track_feed_campaign' => 'feed',
90
- 'track_heartbeat' => 0,
91
- 'track_user_id' => 'disabled',
92
- // User settings: Expert configuration
93
- 'cache' => true,
94
- 'http_connection' => 'curl',
95
- 'http_method' => 'post',
96
- 'disable_timelimit' => false,
97
- 'connection_timeout' => 5,
98
- 'disable_ssl_verify' => false,
99
- 'disable_ssl_verify_host' => false,
100
- 'piwik_useragent' => 'php',
101
- 'piwik_useragent_string' => 'WP-Piwik',
102
- 'dnsprefetch' => false,
103
- 'track_datacfasync' => false,
104
- 'track_cdnurl' => '',
105
- 'track_cdnurlssl' => '',
106
- 'force_protocol' => 'disabled',
107
- 'update_notice' => 'enabled'
108
- ), $settings = array (
109
- 'name' => '',
110
- 'site_id' => NULL,
111
- 'noscript_code' => '',
112
- 'tracking_code' => '',
113
- 'last_tracking_code_update' => 0,
114
- 'dashboard_revision' => 0
115
- ), $settingsChanged = false;
116
-
117
- /**
118
- * Constructor class to prepare settings manager
119
- *
120
- * @param WP_Piwik $wpPiwik
121
- * active WP-Piwik instance
122
- */
123
- public function __construct($wpPiwik) {
124
- self::$wpPiwik = $wpPiwik;
125
- self::$wpPiwik->log ( 'Store default settings' );
126
- self::$defaultSettings = array (
127
- 'globalSettings' => $this->globalSettings,
128
- 'settings' => $this->settings
129
- );
130
- self::$wpPiwik->log ( 'Load settings' );
131
- foreach ( $this->globalSettings as $key => $default ) {
132
- $this->globalSettings [$key] = ($this->checkNetworkActivation () ? get_site_option ( 'wp-piwik_global-' . $key, $default ) : get_option ( 'wp-piwik_global-' . $key, $default ));
133
- }
134
- foreach ( $this->settings as $key => $default )
135
- $this->settings [$key] = get_option ( 'wp-piwik-' . $key, $default );
136
- }
137
-
138
- /**
139
- * Save all settings as WordPress options
140
- */
141
- public function save() {
142
- if (! $this->settingsChanged) {
143
- self::$wpPiwik->log ( 'No settings changed yet' );
144
- return;
145
- }
146
- self::$wpPiwik->log ( 'Save settings' );
147
- foreach ( $this->globalSettings as $key => $value ) {
148
- if ( $this->checkNetworkActivation() )
149
- update_site_option ( 'wp-piwik_global-' . $key, $value );
150
- else
151
- update_option ( 'wp-piwik_global-' . $key, $value );
152
- }
153
- foreach ( $this->settings as $key => $value ) {
154
- update_option ( 'wp-piwik-' . $key, $value );
155
- }
156
- global $wp_roles;
157
- if (! is_object ( $wp_roles ))
158
- $wp_roles = new \WP_Roles ();
159
- if (! is_object ( $wp_roles ))
160
- die ( "STILL NO OBJECT" );
161
- foreach ( $wp_roles->role_names as $strKey => $strName ) {
162
- $objRole = get_role ( $strKey );
163
- foreach ( array (
164
- 'stealth',
165
- 'read_stats'
166
- ) as $strCap ) {
167
- $aryCaps = $this->getGlobalOption ( 'capability_' . $strCap );
168
- if (isset ( $aryCaps [$strKey] ) && $aryCaps [$strKey])
169
- $wp_roles->add_cap ( $strKey, 'wp-piwik_' . $strCap );
170
- else $wp_roles->remove_cap ( $strKey, 'wp-piwik_' . $strCap );
171
- }
172
- }
173
- $this->settingsChanged = false;
174
- }
175
-
176
- /**
177
- * Get a global option's value
178
- *
179
- * @param string $key
180
- * option key
181
- * @return string option value
182
- */
183
- public function getGlobalOption($key) {
184
- return isset ( $this->globalSettings [$key] ) ? $this->globalSettings [$key] : self::$defaultSettings ['globalSettings'] [$key];
185
- }
186
-
187
- /**
188
- * Get an option's value related to a specific blog
189
- *
190
- * @param string $key
191
- * option key
192
- * @param int $blogID
193
- * blog ID (default: current blog)
194
- * @return \WP_Piwik\Register
195
- */
196
- public function getOption($key, $blogID = null) {
197
- if ($this->checkNetworkActivation () && ! empty ( $blogID )) {
198
- return get_blog_option ( $blogID, 'wp-piwik-'.$key );
199
- }
200
- return isset ( $this->settings [$key] ) ? $this->settings [$key] : self::$defaultSettings ['settings'] [$key];
201
- }
202
-
203
- /**
204
- * Set a global option's value
205
- *
206
- * @param string $key
207
- * option key
208
- * @param string $value
209
- * new option value
210
- */
211
- public function setGlobalOption($key, $value) {
212
- $this->settingsChanged = true;
213
- self::$wpPiwik->log ( 'Changed global option ' . $key . ': ' . (is_array ( $value ) ? serialize ( $value ) : $value) );
214
- $this->globalSettings [$key] = $value;
215
- }
216
-
217
- /**
218
- * Set an option's value related to a specific blog
219
- *
220
- * @param string $key
221
- * option key
222
- * @param int $blogID
223
- * blog ID (default: current blog)
224
- * @param string $value
225
- * new option value
226
- */
227
- public function setOption($key, $value, $blogID = null) {
228
- $this->settingsChanged = true;
229
- self::$wpPiwik->log ( 'Changed option ' . $key . ': ' . $value );
230
- if ($this->checkNetworkActivation () && ! empty ( $blogID )) {
231
- add_blog_option ( $blogID, 'wp-piwik-'.$key, $value );
232
- } else
233
- $this->settings [$key] = $value;
234
- }
235
-
236
- /**
237
- * Reset settings to default
238
- */
239
- public function resetSettings() {
240
- self::$wpPiwik->log ( 'Reset WP-Piwik settings' );
241
- global $wpdb;
242
- if ( $this->checkNetworkActivation() ) {
243
- $aryBlogs = self::getBlogList();
244
- if (is_array($aryBlogs))
245
- foreach ($aryBlogs as $aryBlog) {
246
- switch_to_blog($aryBlog['blog_id']);
247
- $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik-%'");
248
- restore_current_blog();
249
- }
250
- $wpdb->query("DELETE FROM $wpdb->sitemeta WHERE meta_key LIKE 'wp-piwik_global-%'");
251
- }
252
- else $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik_global-%'");
253
- }
254
-
255
- /**
256
- * Get blog list
257
- */
258
- public static function getBlogList($limit = null, $page = null, $search = '') {
259
- if ($limit && $page)
260
- $queryLimit = ' LIMIT '.(int) (($page - 1) * $limit).','.(int) $limit;
261
- global $wpdb;
262
- return $wpdb->get_results($wpdb->prepare('SELECT blog_id FROM '.$wpdb->blogs.' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0 ORDER BY blog_id'.$queryLimit, $search), ARRAY_A);
263
- }
264
-
265
- /**
266
- * Check if plugin is network activated
267
- *
268
- * @return boolean Is network activated?
269
- */
270
- public function checkNetworkActivation() {
271
- if (! function_exists ( "is_plugin_active_for_network" ))
272
- require_once (ABSPATH . 'wp-admin/includes/plugin.php');
273
- return is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' );
274
- }
275
-
276
- /**
277
- * Apply new configuration
278
- *
279
- * @param array $in
280
- * new configuration set
281
- */
282
- public function applyChanges($in) {
283
- if (!self::$wpPiwik->isValidOptionsPost())
284
- die("Invalid config changes.");
285
- $in = $this->checkSettings ( $in );
286
- self::$wpPiwik->log ( 'Apply changed settings:' );
287
- foreach ( self::$defaultSettings ['globalSettings'] as $key => $val )
288
- $this->setGlobalOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val );
289
- foreach ( self::$defaultSettings ['settings'] as $key => $val )
290
- $this->setOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val );
291
- $this->setGlobalOption ( 'last_settings_update', time () );
292
- $this->save ();
293
- }
294
-
295
- /**
296
- * Apply callback function on new settings
297
- *
298
- * @param array $in
299
- * new configuration set
300
- * @return array configuration set after callback functions were applied
301
- */
302
- private function checkSettings($in) {
303
- foreach ( $this->checkSettings as $key => $value )
304
- if (isset ( $in [$key] ))
305
- $in [$key] = call_user_func_array ( array (
306
- $this,
307
- $value
308
- ), array (
309
- $in [$key],
310
- $in
311
- ) );
312
- return $in;
313
- }
314
-
315
- /**
316
- * Add slash to Piwik URL if necessary
317
- *
318
- * @param string $value
319
- * Piwik URL
320
- * @param array $in
321
- * configuration set
322
- * @return string Piwik URL
323
- */
324
- private function checkPiwikUrl($value, $in) {
325
- return substr ( $value, - 1, 1 ) != '/' ? $value . '/' : $value;
326
- }
327
-
328
- /**
329
- * Remove &amp;token_auth= from auth token
330
- *
331
- * @param string $value
332
- * Piwik auth token
333
- * @param array $in
334
- * configuration set
335
- * @return string Piwik auth token
336
- */
337
- private function checkPiwikToken($value, $in) {
338
- return str_replace ( '&token_auth=', '', $value );
339
- }
340
-
341
- /**
342
- * Request the site ID (if not set before)
343
- *
344
- * @param string $value
345
- * tracking code
346
- * @param array $in
347
- * configuration set
348
- * @return int Piwik site ID
349
- */
350
- private function requestPiwikSiteID($value, $in) {
351
- if ($in ['auto_site_config'] && ! $value)
352
- return self::$wpPiwik->getPiwikSiteId();
353
- return $value;
354
- }
355
-
356
- /**
357
- * Prepare the tracking code
358
- *
359
- * @param string $value
360
- * tracking code
361
- * @param array $in
362
- * configuration set
363
- * @return string tracking code
364
- */
365
- private function prepareTrackingCode($value, $in) {
366
- if ($in ['track_mode'] == 'manually' || $in ['track_mode'] == 'disabled') {
367
- $value = stripslashes ( $value );
368
- if ($this->checkNetworkActivation ())
369
- add_site_option ( 'wp-piwik-manually', $value );
370
- return $value;
371
- }
372
- /*$result = self::$wpPiwik->updateTrackingCode ();
373
- echo '<pre>'; print_r($result); echo '</pre>';
374
- $this->setOption ( 'noscript_code', $result ['noscript'] );*/
375
- return; // $result ['script'];
376
- }
377
-
378
- /**
379
- * Prepare the nocscript code
380
- *
381
- * @param string $value
382
- * noscript code
383
- * @param array $in
384
- * configuration set
385
- * @return string noscript code
386
- */
387
- private function prepareNocscriptCode($value, $in) {
388
- if ($in ['track_mode'] == 'manually')
389
- return stripslashes ( $value );
390
- return $this->getOption ( 'noscript_code' );
391
- }
392
-
393
- /**
394
- * Get debug data
395
- *
396
- * @return array WP-Piwik settings for debug output
397
- */
398
- public function getDebugData() {
399
- $debug = array(
400
- 'global_settings' => $this->globalSettings,
401
- 'settings' => $this->settings
402
- );
403
- $debug['global_settings']['piwik_token'] = !empty($debug['global_settings']['piwik_token'])?'set':'not set';
404
- return $debug;
405
- }
406
- }
 
1
+ <?php
2
+
3
+ namespace WP_Piwik;
4
+
5
+ /**
6
+ * Manage WP-Piwik settings
7
+ *
8
+ * @author Andr&eacute; Br&auml;kling
9
+ * @package WP_Piwik
10
+ */
11
+ class Settings {
12
+
13
+ /**
14
+ *
15
+ * @var Environment variables and default settings container
16
+ */
17
+ private static $wpPiwik, $defaultSettings;
18
+
19
+ /**
20
+ *
21
+ * @var Define callback functions for changed settings
22
+ */
23
+ private $checkSettings = array (
24
+ 'piwik_url' => 'checkPiwikUrl',
25
+ 'piwik_token' => 'checkPiwikToken',
26
+ 'site_id' => 'requestPiwikSiteID',
27
+ 'tracking_code' => 'prepareTrackingCode',
28
+ 'noscript_code' => 'prepareNocscriptCode'
29
+ );
30
+
31
+ /**
32
+ *
33
+ * @var Register default configuration set
34
+ */
35
+ private $globalSettings = array (
36
+ // Plugin settings
37
+ 'revision' => 0,
38
+ 'last_settings_update' => 0,
39
+ // User settings: Piwik configuration
40
+ 'piwik_mode' => 'http',
41
+ 'piwik_url' => '',
42
+ 'piwik_path' => '',
43
+ 'piwik_user' => '',
44
+ 'matomo_user' => '',
45
+ 'piwik_token' => '',
46
+ 'auto_site_config' => true,
47
+ // User settings: Stats configuration
48
+ 'default_date' => 'yesterday',
49
+ 'stats_seo' => false,
50
+ 'stats_ecommerce' => false,
51
+ 'dashboard_widget' => false,
52
+ 'dashboard_ecommerce' => false,
53
+ 'dashboard_chart' => false,
54
+ 'dashboard_seo' => false,
55
+ 'toolbar' => false,
56
+ 'capability_read_stats' => array (
57
+ 'administrator' => true
58
+ ),
59
+ 'perpost_stats' => false,
60
+ 'plugin_display_name' => 'WP-Piwik',
61
+ 'piwik_shortcut' => false,
62
+ 'shortcodes' => false,
63
+ // User settings: Tracking configuration
64
+ 'track_mode' => 'disabled',
65
+ 'track_codeposition' => 'footer',
66
+ 'track_noscript' => false,
67
+ 'track_nojavascript' => false,
68
+ 'proxy_url' => '',
69
+ 'track_content' => 'disabled',
70
+ 'track_search' => false,
71
+ 'track_404' => false,
72
+ 'add_post_annotations' => array(),
73
+ 'add_customvars_box' => false,
74
+ 'add_download_extensions' => '',
75
+ 'set_download_extensions' => '',
76
+ 'set_link_classes' => '',
77
+ 'set_download_classes' => '',
78
+ 'disable_cookies' => false,
79
+ 'limit_cookies' => false,
80
+ 'limit_cookies_visitor' => 34186669, // Piwik default 13 months
81
+ 'limit_cookies_session' => 1800, // Piwik default 30 minutes
82
+ 'limit_cookies_referral' => 15778463, // Piwik default 6 months
83
+ 'track_admin' => false,
84
+ 'capability_stealth' => array (),
85
+ 'track_across' => false,
86
+ 'track_across_alias' => false,
87
+ 'track_crossdomain_linking' => false,
88
+ 'track_feed' => false,
89
+ 'track_feed_addcampaign' => false,
90
+ 'track_feed_campaign' => 'feed',
91
+ 'track_heartbeat' => 0,
92
+ 'track_user_id' => 'disabled',
93
+ // User settings: Expert configuration
94
+ 'cache' => true,
95
+ 'http_connection' => 'curl',
96
+ 'http_method' => 'post',
97
+ 'disable_timelimit' => false,
98
+ 'connection_timeout' => 5,
99
+ 'disable_ssl_verify' => false,
100
+ 'disable_ssl_verify_host' => false,
101
+ 'piwik_useragent' => 'php',
102
+ 'piwik_useragent_string' => 'WP-Piwik',
103
+ 'dnsprefetch' => false,
104
+ 'track_datacfasync' => false,
105
+ 'track_cdnurl' => '',
106
+ 'track_cdnurlssl' => '',
107
+ 'force_protocol' => 'disabled',
108
+ 'update_notice' => 'enabled'
109
+ ), $settings = array (
110
+ 'name' => '',
111
+ 'site_id' => NULL,
112
+ 'noscript_code' => '',
113
+ 'tracking_code' => '',
114
+ 'last_tracking_code_update' => 0,
115
+ 'dashboard_revision' => 0
116
+ ), $settingsChanged = false;
117
+
118
+ /**
119
+ * Constructor class to prepare settings manager
120
+ *
121
+ * @param WP_Piwik $wpPiwik
122
+ * active WP-Piwik instance
123
+ */
124
+ public function __construct($wpPiwik) {
125
+ self::$wpPiwik = $wpPiwik;
126
+ self::$wpPiwik->log ( 'Store default settings' );
127
+ self::$defaultSettings = array (
128
+ 'globalSettings' => $this->globalSettings,
129
+ 'settings' => $this->settings
130
+ );
131
+ self::$wpPiwik->log ( 'Load settings' );
132
+ foreach ( $this->globalSettings as $key => $default ) {
133
+ $this->globalSettings [$key] = ($this->checkNetworkActivation () ? get_site_option ( 'wp-piwik_global-' . $key, $default ) : get_option ( 'wp-piwik_global-' . $key, $default ));
134
+ }
135
+ foreach ( $this->settings as $key => $default )
136
+ $this->settings [$key] = get_option ( 'wp-piwik-' . $key, $default );
137
+ }
138
+
139
+ /**
140
+ * Save all settings as WordPress options
141
+ */
142
+ public function save() {
143
+ if (! $this->settingsChanged) {
144
+ self::$wpPiwik->log ( 'No settings changed yet' );
145
+ return;
146
+ }
147
+ self::$wpPiwik->log ( 'Save settings' );
148
+ foreach ( $this->globalSettings as $key => $value ) {
149
+ if ( $this->checkNetworkActivation() )
150
+ update_site_option ( 'wp-piwik_global-' . $key, $value );
151
+ else
152
+ update_option ( 'wp-piwik_global-' . $key, $value );
153
+ }
154
+ foreach ( $this->settings as $key => $value ) {
155
+ update_option ( 'wp-piwik-' . $key, $value );
156
+ }
157
+ global $wp_roles;
158
+ if (! is_object ( $wp_roles ))
159
+ $wp_roles = new \WP_Roles ();
160
+ if (! is_object ( $wp_roles ))
161
+ die ( "STILL NO OBJECT" );
162
+ foreach ( $wp_roles->role_names as $strKey => $strName ) {
163
+ $objRole = get_role ( $strKey );
164
+ foreach ( array (
165
+ 'stealth',
166
+ 'read_stats'
167
+ ) as $strCap ) {
168
+ $aryCaps = $this->getGlobalOption ( 'capability_' . $strCap );
169
+ if (isset ( $aryCaps [$strKey] ) && $aryCaps [$strKey])
170
+ $wp_roles->add_cap ( $strKey, 'wp-piwik_' . $strCap );
171
+ else $wp_roles->remove_cap ( $strKey, 'wp-piwik_' . $strCap );
172
+ }
173
+ }
174
+ $this->settingsChanged = false;
175
+ }
176
+
177
+ /**
178
+ * Get a global option's value
179
+ *
180
+ * @param string $key
181
+ * option key
182
+ * @return string option value
183
+ */
184
+ public function getGlobalOption($key) {
185
+ return isset ( $this->globalSettings [$key] ) ? $this->globalSettings [$key] : self::$defaultSettings ['globalSettings'] [$key];
186
+ }
187
+
188
+ /**
189
+ * Get an option's value related to a specific blog
190
+ *
191
+ * @param string $key
192
+ * option key
193
+ * @param int $blogID
194
+ * blog ID (default: current blog)
195
+ * @return \WP_Piwik\Register
196
+ */
197
+ public function getOption($key, $blogID = null) {
198
+ if ($this->checkNetworkActivation () && ! empty ( $blogID )) {
199
+ return get_blog_option ( $blogID, 'wp-piwik-'.$key );
200
+ }
201
+ return isset ( $this->settings [$key] ) ? $this->settings [$key] : self::$defaultSettings ['settings'] [$key];
202
+ }
203
+
204
+ /**
205
+ * Set a global option's value
206
+ *
207
+ * @param string $key
208
+ * option key
209
+ * @param string $value
210
+ * new option value
211
+ */
212
+ public function setGlobalOption($key, $value) {
213
+ $this->settingsChanged = true;
214
+ self::$wpPiwik->log ( 'Changed global option ' . $key . ': ' . (is_array ( $value ) ? serialize ( $value ) : $value) );
215
+ $this->globalSettings [$key] = $value;
216
+ }
217
+
218
+ /**
219
+ * Set an option's value related to a specific blog
220
+ *
221
+ * @param string $key
222
+ * option key
223
+ * @param int $blogID
224
+ * blog ID (default: current blog)
225
+ * @param string $value
226
+ * new option value
227
+ */
228
+ public function setOption($key, $value, $blogID = null) {
229
+ $this->settingsChanged = true;
230
+ self::$wpPiwik->log ( 'Changed option ' . $key . ': ' . $value );
231
+ if ($this->checkNetworkActivation () && ! empty ( $blogID )) {
232
+ add_blog_option ( $blogID, 'wp-piwik-'.$key, $value );
233
+ } else
234
+ $this->settings [$key] = $value;
235
+ }
236
+
237
+ /**
238
+ * Reset settings to default
239
+ */
240
+ public function resetSettings() {
241
+ self::$wpPiwik->log ( 'Reset WP-Piwik settings' );
242
+ global $wpdb;
243
+ if ( $this->checkNetworkActivation() ) {
244
+ $aryBlogs = self::getBlogList();
245
+ if (is_array($aryBlogs))
246
+ foreach ($aryBlogs as $aryBlog) {
247
+ switch_to_blog($aryBlog['blog_id']);
248
+ $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik-%'");
249
+ restore_current_blog();
250
+ }
251
+ $wpdb->query("DELETE FROM $wpdb->sitemeta WHERE meta_key LIKE 'wp-piwik_global-%'");
252
+ }
253
+ else $wpdb->query("DELETE FROM $wpdb->options WHERE option_name LIKE 'wp-piwik_global-%'");
254
+ }
255
+
256
+ /**
257
+ * Get blog list
258
+ */
259
+ public static function getBlogList($limit = null, $page = null, $search = '') {
260
+ if ($limit && $page)
261
+ $queryLimit = ' LIMIT '.(int) (($page - 1) * $limit).','.(int) $limit;
262
+ global $wpdb;
263
+ return $wpdb->get_results($wpdb->prepare('SELECT blog_id FROM '.$wpdb->blogs.' WHERE CONCAT(domain, path) LIKE "%%%s%%" AND spam = 0 AND deleted = 0 ORDER BY blog_id'.$queryLimit, $search), ARRAY_A);
264
+ }
265
+
266
+ /**
267
+ * Check if plugin is network activated
268
+ *
269
+ * @return boolean Is network activated?
270
+ */
271
+ public function checkNetworkActivation() {
272
+ if (! function_exists ( "is_plugin_active_for_network" ))
273
+ require_once (ABSPATH . 'wp-admin/includes/plugin.php');
274
+ return is_plugin_active_for_network ( 'wp-piwik/wp-piwik.php' );
275
+ }
276
+
277
+ /**
278
+ * Apply new configuration
279
+ *
280
+ * @param array $in
281
+ * new configuration set
282
+ */
283
+ public function applyChanges($in) {
284
+ if (!self::$wpPiwik->isValidOptionsPost())
285
+ die("Invalid config changes.");
286
+ $in = $this->checkSettings ( $in );
287
+ self::$wpPiwik->log ( 'Apply changed settings:' );
288
+ foreach ( self::$defaultSettings ['globalSettings'] as $key => $val )
289
+ $this->setGlobalOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val );
290
+ foreach ( self::$defaultSettings ['settings'] as $key => $val )
291
+ $this->setOption ( $key, isset ( $in [$key] ) ? $in [$key] : $val );
292
+ $this->setGlobalOption ( 'last_settings_update', time () );
293
+ $this->save ();
294
+ }
295
+
296
+ /**
297
+ * Apply callback function on new settings
298
+ *
299
+ * @param array $in
300
+ * new configuration set
301
+ * @return array configuration set after callback functions were applied
302
+ */
303
+ private function checkSettings($in) {
304
+ foreach ( $this->checkSettings as $key => $value )
305
+ if (isset ( $in [$key] ))
306
+ $in [$key] = call_user_func_array ( array (
307
+ $this,
308
+ $value
309
+ ), array (
310
+ $in [$key],
311
+ $in
312
+ ) );
313
+ return $in;
314
+ }
315
+
316
+ /**
317
+ * Add slash to Piwik URL if necessary
318
+ *
319
+ * @param string $value
320
+ * Piwik URL
321
+ * @param array $in
322
+ * configuration set
323
+ * @return string Piwik URL
324
+ */
325
+ private function checkPiwikUrl($value, $in) {
326
+ return substr ( $value, - 1, 1 ) != '/' ? $value . '/' : $value;
327
+ }
328
+
329
+ /**
330
+ * Remove &amp;token_auth= from auth token
331
+ *
332
+ * @param string $value
333
+ * Piwik auth token
334
+ * @param array $in
335
+ * configuration set
336
+ * @return string Piwik auth token
337
+ */
338
+ private function checkPiwikToken($value, $in) {
339
+ return str_replace ( '&token_auth=', '', $value );
340
+ }
341
+
342
+ /**
343
+ * Request the site ID (if not set before)
344
+ *
345
+ * @param string $value
346
+ * tracking code
347
+ * @param array $in
348
+ * configuration set
349
+ * @return int Piwik site ID
350
+ */
351
+ private function requestPiwikSiteID($value, $in) {
352
+ if ($in ['auto_site_config'] && ! $value)
353
+ return self::$wpPiwik->getPiwikSiteId();
354
+ return $value;
355
+ }
356
+
357
+ /**
358
+ * Prepare the tracking code
359
+ *
360
+ * @param string $value
361
+ * tracking code
362
+ * @param array $in
363
+ * configuration set
364
+ * @return string tracking code
365
+ */
366
+ private function prepareTrackingCode($value, $in) {
367
+ if ($in ['track_mode'] == 'manually' || $in ['track_mode'] == 'disabled') {
368
+ $value = stripslashes ( $value );
369
+ if ($this->checkNetworkActivation ())
370
+ add_site_option ( 'wp-piwik-manually', $value );
371
+ return $value;
372
+ }
373
+ /*$result = self::$wpPiwik->updateTrackingCode ();
374
+ echo '<pre>'; print_r($result); echo '</pre>';
375
+ $this->setOption ( 'noscript_code', $result ['noscript'] );*/
376
+ return; // $result ['script'];
377
+ }
378
+
379
+ /**
380
+ * Prepare the nocscript code
381
+ *
382
+ * @param string $value
383
+ * noscript code
384
+ * @param array $in
385
+ * configuration set
386
+ * @return string noscript code
387
+ */
388
+ private function prepareNocscriptCode($value, $in) {
389
+ if ($in ['track_mode'] == 'manually')
390
+ return stripslashes ( $value );
391
+ return $this->getOption ( 'noscript_code' );
392
+ }
393
+
394
+ /**
395
+ * Get debug data
396
+ *
397
+ * @return array WP-Piwik settings for debug output
398
+ */
399
+ public function getDebugData() {
400
+ $debug = array(
401
+ 'global_settings' => $this->globalSettings,
402
+ 'settings' => $this->settings
403
+ );
404
+ $debug['global_settings']['piwik_token'] = !empty($debug['global_settings']['piwik_token'])?'set':'not set';
405
+ return $debug;
406
+ }
407
+ }
classes/WP_Piwik/Shortcode.php CHANGED
File without changes
classes/WP_Piwik/Template.php CHANGED
File without changes
classes/WP_Piwik/Template/MetaBoxCustomVars.php CHANGED
File without changes
classes/WP_Piwik/TrackingCode.php CHANGED
@@ -1,150 +1,150 @@
1
- <?php
2
-
3
- namespace WP_Piwik;
4
-
5
- class TrackingCode {
6
-
7
- private static $wpPiwik, $piwikUrl = false;
8
-
9
- private $trackingCode;
10
-
11
- public $is404 = false, $isSearch = false, $isUsertracking = false;
12
-
13
- public function __construct($wpPiwik) {
14
- self::$wpPiwik = $wpPiwik;
15
- if (! self::$wpPiwik->isCurrentTrackingCode () || ! self::$wpPiwik->getOption ( 'tracking_code' ) || strpos( self::$wpPiwik->getOption ( 'tracking_code' ), '{"result":"error",' ) !== false )
16
- self::$wpPiwik->updateTrackingCode ();
17
- $this->trackingCode = (self::$wpPiwik->isNetworkMode () && self::$wpPiwik->getGlobalOption ( 'track_mode' ) == 'manually') ? get_site_option ( 'wp-piwik-manually' ) : self::$wpPiwik->getOption ( 'tracking_code' );
18
- }
19
-
20
- public function getTrackingCode() {
21
- if ($this->isUsertracking)
22
- $this->applyUserTracking ();
23
- if ($this->is404)
24
- $this->apply404Changes ();
25
- if ($this->isSearch)
26
- $this->applySearchChanges ();
27
- if (is_single () || is_page())
28
- $this->addCustomValues ();
29
- $this->trackingCode = apply_filters('wp-piwik_tracking_code', $this->trackingCode);
30
- return $this->trackingCode;
31
- }
32
-
33
- public static function prepareTrackingCode($code, $settings, $logger) {
34
- global $current_user;
35
- $logger->log ( 'Apply tracking code changes:' );
36
- $settings->setOption ( 'last_tracking_code_update', time () );
37
- if (preg_match ( '/var u="([^"]*)";/', $code, $hits )) {
38
- $fetchedProxyUrl = $hits [1];
39
- } else $fetchedProxyUrl = '';
40
- if ($settings->getGlobalOption ( 'track_mode' ) == 'js')
41
- $code = str_replace ( array (
42
- 'piwik.js',
43
- 'piwik.php'
44
- ), 'js/index.php', $code );
45
- elseif ($settings->getGlobalOption ( 'track_mode' ) == 'proxy') {
46
- $code = str_replace ( 'piwik.js', 'piwik.php', $code );
47
- $proxy = str_replace ( array (
48
- 'https://',
49
- 'http://'
50
- ), '//', plugins_url ( 'wp-piwik' ) . '/proxy' ) . '/';
51
- $code = preg_replace ( '/var u="([^"]*)";/', 'var u="' . $proxy . '"', $code );
52
- $code = preg_replace ( '/img src="([^"]*)piwik.php/', 'img src="' . $proxy . 'piwik.php', $code );
53
- }
54
- if ($settings->getGlobalOption ( 'track_cdnurl' ) || $settings->getGlobalOption ( 'track_cdnurlssl' ))
55
- $code = str_replace ( array (
56
- "var d=doc",
57
- "g.src=u+"
58
- ), array (
59
- "var ucdn=(('https:' == document.location.protocol) ? 'https://" . ($settings->getGlobalOption ( 'track_cdnurlssl' ) ? $settings->getGlobalOption ( 'track_cdnurlssl' ) : $settings->getGlobalOption ( 'track_cdnurl' )) . "/' : 'http://" . ($settings->getGlobalOption ( 'track_cdnurl' ) ? $settings->getGlobalOption ( 'track_cdnurl' ) : $settings->getGlobalOption ( 'track_cdnurlssl' )) . "/');\nvar d=doc",
60
- "g.src=ucdn+"
61
- ), $code );
62
-
63
- if ($settings->getGlobalOption ( 'track_datacfasync' ))
64
- $code = str_replace ( '<script type', '<script data-cfasync="false" type', $code );
65
- if ($settings->getGlobalOption ( 'set_download_extensions' ))
66
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDownloadExtensions', '" . ($settings->getGlobalOption ( 'set_download_extensions' )) . "']);\n_paq.push(['trackPageView']);", $code );
67
- if ($settings->getGlobalOption ( 'add_download_extensions' ))
68
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['addDownloadExtensions', '" . ($settings->getGlobalOption ( 'add_download_extensions' )) . "']);\n_paq.push(['trackPageView']);", $code );
69
- if ($settings->getGlobalOption ( 'set_download_classes' ))
70
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDownloadClasses', '" . ($settings->getGlobalOption ( 'set_download_classes' )) . "']);\n_paq.push(['trackPageView']);", $code );
71
- if ($settings->getGlobalOption ( 'set_link_classes' ))
72
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setLinkClasses', '" . ($settings->getGlobalOption ( 'set_link_classes' )) . "']);\n_paq.push(['trackPageView']);", $code );
73
- if ($settings->getGlobalOption ( 'limit_cookies' ))
74
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setVisitorCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_visitor' ) . "']);\n_paq.push(['setSessionCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_session' ) . "']);\n_paq.push(['setReferralCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_referral' ) . "']);\n_paq.push(['trackPageView']);", $code );
75
- if ($settings->getGlobalOption ( 'force_protocol' ) != 'disabled')
76
- $code = str_replace ( '"//', '"' . $settings->getGlobalOption ( 'force_protocol' ) . '://', $code );
77
- if ($settings->getGlobalOption ( 'track_content' ) == 'all')
78
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['trackAllContentImpressions']);", $code );
79
- elseif ($settings->getGlobalOption ( 'track_content' ) == 'visible')
80
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['trackVisibleContentImpressions']);", $code );
81
- if ((int) $settings->getGlobalOption ( 'track_heartbeat' ) > 0)
82
- $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['enableHeartBeatTimer', ".(int) $settings->getGlobalOption ( 'track_heartbeat' )."]);", $code );
83
-
84
- $noScript = array ();
85
- preg_match ( '/<noscript>(.*)<\/noscript>/', $code, $noScript );
86
- if (isset ( $noScript [0] )) {
87
- if ($settings->getGlobalOption ( 'track_nojavascript' ))
88
- $noScript [0] = str_replace ( '?idsite', '?rec=1&idsite', $noScript [0] );
89
- $noScript = $noScript [0];
90
- } else
91
- $noScript = '';
92
- $script = preg_replace ( '/<noscript>(.*)<\/noscript>/', '', $code );
93
- $script = preg_replace ( '/\s+(\r\n|\r|\n)/', '$1', $script );
94
- $logger->log ( 'Finished tracking code: ' . $script );
95
- $logger->log ( 'Finished noscript code: ' . $noScript );
96
- return array (
97
- 'script' => $script,
98
- 'noscript' => $noScript,
99
- 'proxy' => $fetchedProxyUrl
100
- );
101
- }
102
-
103
- private function apply404Changes() {
104
- self::$wpPiwik->log ( 'Apply 404 changes. Blog ID: ' . get_current_blog_id () . ' Site ID: ' . self::$wpPiwik->getOption ( 'site_id' ) );
105
- $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDocumentTitle', '404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,'%2f') + '/From = ' + String(document.referrer).replace(/\//g,'%2f')]);\n_paq.push(['trackPageView']);", $this->trackingCode );
106
- }
107
-
108
- private function applySearchChanges() {
109
- self::$wpPiwik->log ( 'Apply search tracking changes. Blog ID: ' . get_current_blog_id () . ' Site ID: ' . self::$wpPiwik->getOption ( 'site_id' ) );
110
- $objSearch = new \WP_Query ( "s=" . get_search_query () . '&showposts=-1' );
111
- $intResultCount = $objSearch->post_count;
112
- $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackSiteSearch','" . get_search_query () . "', false, " . $intResultCount . "]);\n_paq.push(['trackPageView']);", $this->trackingCode );
113
- }
114
-
115
- private function applyUserTracking() {
116
- $pkUserId = null;
117
- if (\is_user_logged_in()) {
118
- // Get the User ID Admin option, and the current user's data
119
- $uidFrom = self::$wpPiwik->getGlobalOption ( 'track_user_id' );
120
- $current_user = wp_get_current_user(); // current user
121
- // Get the user ID based on the admin setting
122
- if ( $uidFrom == 'uid' ) {
123
- $pkUserId = $current_user->ID;
124
- } elseif ( $uidFrom == 'email' ) {
125
- $pkUserId = $current_user->user_email;
126
- } elseif ( $uidFrom == 'username' ) {
127
- $pkUserId = $current_user->user_login;
128
- } elseif ( $uidFrom == 'displayname' ) {
129
- $pkUserId = $current_user->display_name;
130
- }
131
- }
132
- $pkUserId = apply_filters('wp-piwik_tracking_user_id', $pkUserId);
133
- // Check we got a User ID to track, and track it
134
- if ( isset( $pkUserId ) && ! empty( $pkUserId ))
135
- $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setUserId', '" . esc_js( $pkUserId ) . "']);\n_paq.push(['trackPageView']);", $this->trackingCode );
136
- }
137
-
138
- private function addCustomValues() {
139
- $customVars = '';
140
- for($i = 1; $i <= 5; $i ++) {
141
- $postId = get_the_ID ();
142
- $metaKey = get_post_meta ( $postId, 'wp-piwik_custom_cat' . $i, true );
143
- $metaVal = get_post_meta ( $postId, 'wp-piwik_custom_val' . $i, true );
144
- if (! empty ( $metaKey ) && ! empty ( $metaVal ))
145
- $customVars .= "_paq.push(['setCustomVariable'," . $i . ", '" . $metaKey . "', '" . $metaVal . "', 'page']);\n";
146
- }
147
- if (! empty ( $customVars ))
148
- $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", $customVars . "_paq.push(['trackPageView']);", $this->trackingCode );
149
- }
150
- }
1
+ <?php
2
+
3
+ namespace WP_Piwik;
4
+
5
+ class TrackingCode {
6
+
7
+ private static $wpPiwik, $piwikUrl = false;
8
+
9
+ private $trackingCode;
10
+
11
+ public $is404 = false, $isSearch = false, $isUsertracking = false;
12
+
13
+ public function __construct($wpPiwik) {
14
+ self::$wpPiwik = $wpPiwik;
15
+ if (! self::$wpPiwik->isCurrentTrackingCode () || ! self::$wpPiwik->getOption ( 'tracking_code' ) || strpos( self::$wpPiwik->getOption ( 'tracking_code' ), '{"result":"error",' ) !== false )
16
+ self::$wpPiwik->updateTrackingCode ();
17
+ $this->trackingCode = (self::$wpPiwik->isNetworkMode () && self::$wpPiwik->getGlobalOption ( 'track_mode' ) == 'manually') ? get_site_option ( 'wp-piwik-manually' ) : self::$wpPiwik->getOption ( 'tracking_code' );
18
+ }
19
+
20
+ public function getTrackingCode() {
21
+ if ($this->isUsertracking)
22
+ $this->applyUserTracking ();
23
+ if ($this->is404)
24
+ $this->apply404Changes ();
25
+ if ($this->isSearch)
26
+ $this->applySearchChanges ();
27
+ if (is_single () || is_page())
28
+ $this->addCustomValues ();
29
+ $this->trackingCode = apply_filters('wp-piwik_tracking_code', $this->trackingCode);
30
+ return $this->trackingCode;
31
+ }
32
+
33
+ public static function prepareTrackingCode($code, $settings, $logger) {
34
+ global $current_user;
35
+ $logger->log ( 'Apply tracking code changes:' );
36
+ $settings->setOption ( 'last_tracking_code_update', time () );
37
+ if (preg_match ( '/var u="([^"]*)";/', $code, $hits )) {
38
+ $fetchedProxyUrl = $hits [1];
39
+ } else $fetchedProxyUrl = '';
40
+ if ($settings->getGlobalOption ( 'track_mode' ) == 'js')
41
+ $code = str_replace ( array (
42
+ 'piwik.js',
43
+ 'piwik.php'
44
+ ), 'js/index.php', $code );
45
+ elseif ($settings->getGlobalOption ( 'track_mode' ) == 'proxy') {
46
+ $code = str_replace ( 'piwik.js', 'piwik.php', $code );
47
+ $proxy = str_replace ( array (
48
+ 'https://',
49
+ 'http://'
50
+ ), '//', plugins_url ( 'wp-piwik' ) . '/proxy' ) . '/';
51
+ $code = preg_replace ( '/var u="([^"]*)";/', 'var u="' . $proxy . '"', $code );
52
+ $code = preg_replace ( '/img src="([^"]*)piwik.php/', 'img src="' . $proxy . 'piwik.php', $code );
53
+ }
54
+ if ($settings->getGlobalOption ( 'track_cdnurl' ) || $settings->getGlobalOption ( 'track_cdnurlssl' ))
55
+ $code = str_replace ( array (
56
+ "var d=doc",
57
+ "g.src=u+"
58
+ ), array (
59
+ "var ucdn=(('https:' == document.location.protocol) ? 'https://" . ($settings->getGlobalOption ( 'track_cdnurlssl' ) ? $settings->getGlobalOption ( 'track_cdnurlssl' ) : $settings->getGlobalOption ( 'track_cdnurl' )) . "/' : 'http://" . ($settings->getGlobalOption ( 'track_cdnurl' ) ? $settings->getGlobalOption ( 'track_cdnurl' ) : $settings->getGlobalOption ( 'track_cdnurlssl' )) . "/');\nvar d=doc",
60
+ "g.src=ucdn+"
61
+ ), $code );
62
+
63
+ if ($settings->getGlobalOption ( 'track_datacfasync' ))
64
+ $code = str_replace ( '<script type', '<script data-cfasync="false" type', $code );
65
+ if ($settings->getGlobalOption ( 'set_download_extensions' ))
66
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDownloadExtensions', '" . ($settings->getGlobalOption ( 'set_download_extensions' )) . "']);\n_paq.push(['trackPageView']);", $code );
67
+ if ($settings->getGlobalOption ( 'add_download_extensions' ))
68
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['addDownloadExtensions', '" . ($settings->getGlobalOption ( 'add_download_extensions' )) . "']);\n_paq.push(['trackPageView']);", $code );
69
+ if ($settings->getGlobalOption ( 'set_download_classes' ))
70
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDownloadClasses', '" . ($settings->getGlobalOption ( 'set_download_classes' )) . "']);\n_paq.push(['trackPageView']);", $code );
71
+ if ($settings->getGlobalOption ( 'set_link_classes' ))
72
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setLinkClasses', '" . ($settings->getGlobalOption ( 'set_link_classes' )) . "']);\n_paq.push(['trackPageView']);", $code );
73
+ if ($settings->getGlobalOption ( 'limit_cookies' ))
74
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setVisitorCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_visitor' ) . "']);\n_paq.push(['setSessionCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_session' ) . "']);\n_paq.push(['setReferralCookieTimeout', '" . $settings->getGlobalOption ( 'limit_cookies_referral' ) . "']);\n_paq.push(['trackPageView']);", $code );
75
+ if ($settings->getGlobalOption ( 'force_protocol' ) != 'disabled')
76
+ $code = str_replace ( '"//', '"' . $settings->getGlobalOption ( 'force_protocol' ) . '://', $code );
77
+ if ($settings->getGlobalOption ( 'track_content' ) == 'all')
78
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['trackAllContentImpressions']);", $code );
79
+ elseif ($settings->getGlobalOption ( 'track_content' ) == 'visible')
80
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['trackVisibleContentImpressions']);", $code );
81
+ if ((int) $settings->getGlobalOption ( 'track_heartbeat' ) > 0)
82
+ $code = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackPageView']);\n_paq.push(['enableHeartBeatTimer', ".(int) $settings->getGlobalOption ( 'track_heartbeat' )."]);", $code );
83
+
84
+ $noScript = array ();
85
+ preg_match ( '/<noscript>(.*)<\/noscript>/', $code, $noScript );
86
+ if (isset ( $noScript [0] )) {
87
+ if ($settings->getGlobalOption ( 'track_nojavascript' ))
88
+ $noScript [0] = str_replace ( '?idsite', '?rec=1&idsite', $noScript [0] );
89
+ $noScript = $noScript [0];
90
+ } else
91
+ $noScript = '';
92
+ $script = preg_replace ( '/<noscript>(.*)<\/noscript>/', '', $code );
93
+ $script = preg_replace ( '/\s+(\r\n|\r|\n)/', '$1', $script );
94
+ $logger->log ( 'Finished tracking code: ' . $script );
95
+ $logger->log ( 'Finished noscript code: ' . $noScript );
96
+ return array (
97
+ 'script' => $script,
98
+ 'noscript' => $noScript,
99
+ 'proxy' => $fetchedProxyUrl
100
+ );
101
+ }
102
+
103
+ private function apply404Changes() {
104
+ self::$wpPiwik->log ( 'Apply 404 changes. Blog ID: ' . get_current_blog_id () . ' Site ID: ' . self::$wpPiwik->getOption ( 'site_id' ) );
105
+ $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setDocumentTitle', '404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,'%2f') + '/From = ' + String(document.referrer).replace(/\//g,'%2f')]);\n_paq.push(['trackPageView']);", $this->trackingCode );
106
+ }
107
+
108
+ private function applySearchChanges() {
109
+ self::$wpPiwik->log ( 'Apply search tracking changes. Blog ID: ' . get_current_blog_id () . ' Site ID: ' . self::$wpPiwik->getOption ( 'site_id' ) );
110
+ $objSearch = new \WP_Query ( "s=" . get_search_query () . '&showposts=-1' );
111
+ $intResultCount = $objSearch->post_count;
112
+ $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['trackSiteSearch','" . get_search_query () . "', false, " . $intResultCount . "]);\n_paq.push(['trackPageView']);", $this->trackingCode );
113
+ }
114
+
115
+ private function applyUserTracking() {
116
+ $pkUserId = null;
117
+ if (\is_user_logged_in()) {
118
+ // Get the User ID Admin option, and the current user's data
119
+ $uidFrom = self::$wpPiwik->getGlobalOption ( 'track_user_id' );
120
+ $current_user = wp_get_current_user(); // current user
121
+ // Get the user ID based on the admin setting
122
+ if ( $uidFrom == 'uid' ) {
123
+ $pkUserId = $current_user->ID;
124
+ } elseif ( $uidFrom == 'email' ) {
125
+ $pkUserId = $current_user->user_email;
126
+ } elseif ( $uidFrom == 'username' ) {
127
+ $pkUserId = $current_user->user_login;
128
+ } elseif ( $uidFrom == 'displayname' ) {
129
+ $pkUserId = $current_user->display_name;
130
+ }
131
+ }
132
+ $pkUserId = apply_filters('wp-piwik_tracking_user_id', $pkUserId);
133
+ // Check we got a User ID to track, and track it
134
+ if ( isset( $pkUserId ) && ! empty( $pkUserId ))
135
+ $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", "_paq.push(['setUserId', '" . esc_js( $pkUserId ) . "']);\n_paq.push(['trackPageView']);", $this->trackingCode );
136
+ }
137
+
138
+ private function addCustomValues() {
139
+ $customVars = '';
140
+ for($i = 1; $i <= 5; $i ++) {
141
+ $postId = get_the_ID ();
142
+ $metaKey = get_post_meta ( $postId, 'wp-piwik_custom_cat' . $i, true );
143
+ $metaVal = get_post_meta ( $postId, 'wp-piwik_custom_val' . $i, true );
144
+ if (! empty ( $metaKey ) && ! empty ( $metaVal ))
145
+ $customVars .= "_paq.push(['setCustomVariable'," . $i . ", '" . $metaKey . "', '" . $metaVal . "', 'page']);\n";
146
+ }
147
+ if (! empty ( $customVars ))
148
+ $this->trackingCode = str_replace ( "_paq.push(['trackPageView']);", $customVars . "_paq.push(['trackPageView']);", $this->trackingCode );
149
+ }
150
+ }
classes/WP_Piwik/Widget.php CHANGED
@@ -1,375 +1,376 @@
1
- <?php
2
-
3
- namespace WP_Piwik;
4
-
5
- /**
6
- * Abstract widget class
7
- *
8
- * @author Andr&eacute; Br&auml;kling
9
- * @package WP_Piwik
10
- */
11
- abstract class Widget {
12
-
13
- /**
14
- *
15
- * @var Environment variables
16
- */
17
- protected static $wpPiwik, $settings;
18
-
19
- /**
20
- *
21
- * @var Configuration parameters
22
- */
23
- protected $isShortcode = false, $method = '', $title = '', $context = 'side', $priority = 'core', $parameter = array (), $apiID = array (), $pageId = 'dashboard', $blogId = null, $name = 'Value', $limit = 10, $content = '', $output = '';
24
-
25
- /**
26
- * Widget constructor
27
- *
28
- * @param WP_Piwik $wpPiwik
29
- * current WP-Piwik object
30
- * @param WP_Piwik\Settings $settings
31
- * current WP-Piwik settings
32
- * @param string $pageId
33
- * WordPress page ID (default: dashboard)
34
- * @param string $context
35
- * WordPress meta box context (defualt: side)
36
- * @param string $priority
37
- * WordPress meta box priority (default: default)
38
- * @param array $params
39
- * widget parameters (default: empty array)
40
- * @param boolean $isShortcode
41
- * is the widget shown inline? (default: false)
42
- */
43
- public function __construct($wpPiwik, $settings, $pageId = 'dashboard', $context = 'side', $priority = 'default', $params = array(), $isShortcode = false) {
44
- self::$wpPiwik = $wpPiwik;
45
- self::$settings = $settings;
46
- $this->pageId = $pageId;
47
- $this->context = $context;
48
- $this->priority = $priority;
49
- if (self::$settings->checkNetworkActivation () && function_exists ( 'is_super_admin' ) && is_super_admin () && isset ( $_GET ['wpmu_show_stats'] )) {
50
- switch_to_blog ( ( int ) $_GET ['wpmu_show_stats'] );
51
- $this->blogId = get_current_blog_id ();
52
- restore_current_blog ();
53
- }
54
- $this->isShortcode = $isShortcode;
55
- $prefix = ($this->pageId == 'dashboard' ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' - ' : '');
56
- $this->configure ( $prefix, $params );
57
- if (is_array ( $this->method ))
58
- foreach ( $this->method as $method ) {
59
- $this->apiID [$method] = \WP_Piwik\Request::register ( $method, $this->parameter );
60
- self::$wpPiwik->log ( "Register request: " . $this->apiID [$method] );
61
- }
62
- else {
63
- $this->apiID [$this->method] = \WP_Piwik\Request::register ( $this->method, $this->parameter );
64
- self::$wpPiwik->log ( "Register request: " . $this->apiID [$this->method] );
65
- }
66
- if ($this->isShortcode)
67
- return;
68
- add_meta_box ( $this->getName (), $this->title, array (
69
- $this,
70
- 'show'
71
- ), $pageId, $this->context, $this->priority );
72
- }
73
-
74
- /**
75
- * Conifguration dummy method
76
- *
77
- * @param string $prefix
78
- * metabox title prefix (default: empty)
79
- * @param array $params
80
- * widget parameters (default: empty array)
81
- */
82
- protected function configure($prefix = '', $params = array()) {
83
- }
84
-
85
- /**
86
- * Default show widget method, handles default Piwik output
87
- */
88
- public function show() {
89
- $response = self::$wpPiwik->request ( $this->apiID [$this->method] );
90
- if (! empty ( $response ['result'] ) && $response ['result'] == 'error')
91
- $this->out( '<strong>' . __ ( 'Piwik error', 'wp-piwik' ) . ':</strong> ' . htmlentities ( $response ['message'], ENT_QUOTES, 'utf-8' ) );
92
- else {
93
- if (isset ( $response [0] ['nb_uniq_visitors'] ))
94
- $unique = 'nb_uniq_visitors';
95
- else
96
- $unique = 'sum_daily_nb_uniq_visitors';
97
- $tableHead = array (
98
- 'label' => __ ( $this->name, 'wp-piwik' )
99
- );
100
- $tableHead [$unique] = __ ( 'Unique', 'wp-piwik' );
101
- if (isset ( $response [0] ['nb_visits'] ))
102
- $tableHead ['nb_visits'] = __ ( 'Visits', 'wp-piwik' );
103
- if (isset ( $response [0] ['nb_hits'] ))
104
- $tableHead ['nb_hits'] = __ ( 'Hits', 'wp-piwik' );
105
- if (isset ( $response [0] ['nb_actions'] ))
106
- $tableHead ['nb_actions'] = __ ( 'Actions', 'wp-piwik' );
107
- $tableBody = array ();
108
- $count = 0;
109
- foreach ( $response as $rowKey => $row ) {
110
- $count ++;
111
- $tableBody [$rowKey] = array ();
112
- foreach ( $tableHead as $key => $value )
113
- $tableBody [$rowKey] [] = isset ( $row [$key] ) ? $row [$key] : '-';
114
- if ($count == 10)
115
- break;
116
- }
117
- $this->table ( $tableHead, $tableBody, null );
118
- }
119
- }
120
-
121
- /**
122
- * Display or store shortcode output
123
- */
124
- protected function out($output) {
125
- if ($this->isShortcode)
126
- $this->output .= $output;
127
- else echo $output;
128
- }
129
-
130
- /**
131
- * Return shortcode output
132
- */
133
- public function get() {
134
- return $this->output;
135
- }
136
-
137
- /**
138
- * Display a HTML table
139
- *
140
- * @param array $thead
141
- * table header content (array of cells)
142
- * @param array $tbody
143
- * table body content (array of rows)
144
- * @param array $tfoot
145
- * table footer content (array of cells)
146
- * @param string $class
147
- * CSSclass name to apply on table sections
148
- * @param string $javaScript
149
- * array of javascript code to apply on body rows
150
- */
151
- protected function table($thead, $tbody = array(), $tfoot = array(), $class = false, $javaScript = array(), $classes = array()) {
152
- $this->out( '<div class="table"><table class="widefat wp-piwik-table">' );
153
- if ($this->isShortcode && $this->title) {
154
- $colspan = !empty ( $tbody ) ? count( $tbody[0] ) : 2 ;
155
- $this->out( '<tr><th colspan="'.$colspan.'">' . $this->title . '</th></tr>' );
156
- }
157
- if (! empty ( $thead ))
158
- $this->tabHead ( $thead, $class );
159
- if (! empty ( $tbody ))
160
- $this->tabBody ( $tbody, $class, $javaScript, $classes );
161
- else
162
- $this->out( '<tr><td colspan="10">' . __ ( 'No data available.', 'wp-piwik' ) . '</td></tr>' );
163
- if (! empty ( $tfoot ))
164
- $this->tabFoot ( $tfoot, $class );
165
- $this->out( '</table></div>' );
166
- }
167
-
168
- /**
169
- * Display a HTML table header
170
- *
171
- * @param array $thead
172
- * array of cells
173
- * @param string $class
174
- * CSS class to apply
175
- */
176
- private function tabHead($thead, $class = false) {
177
- $this->out( '<thead' . ($class ? ' class="' . $class . '"' : '') . '><tr>' );
178
- $count = 0;
179
- foreach ( $thead as $value )
180
- $this->out( '<th' . ($count ++ ? ' class="right"' : '') . '>' . $value . '</th>' );
181
- $this->out( '</tr></thead>' );
182
- }
183
-
184
- /**
185
- * Display a HTML table body
186
- *
187
- * @param array $tbody
188
- * array of rows, each row containing an array of cells
189
- * @param string $class
190
- * CSS class to apply
191
- * @param unknown $javaScript
192
- * array of javascript code to apply (one item per row)
193
- */
194
- private function tabBody($tbody, $class = false, $javaScript = array(), $classes = array()) {
195
- $this->out( '<tbody' . ($class ? ' class="' . $class . '"' : '') . '>' );
196
- foreach ( $tbody as $key => $trow )
197
- $this->tabRow ( $trow, isset( $javaScript [$key] ) ?$javaScript [$key] : '', isset ( $classes [$key] ) ?$classes [$key] : '');
198
- $this->out( '</tbody>' );
199
- }
200
-
201
- /**
202
- * Display a HTML table footer
203
- *
204
- * @param array $tfoor
205
- * array of cells
206
- * @param string $class
207
- * CSS class to apply
208
- */
209
- private function tabFoot($tfoot, $class = false) {
210
- $this->out( '<tfoot' . ($class ? ' class="' . $class . '"' : '') . '><tr>' );
211
- $count = 0;
212
- foreach ( $tfoot as $value )
213
- $this->out( '<td' . ($count ++ ? ' class="right"' : '') . '>' . $value . '</td>' );
214
- $this->out( '</tr></tfoot>' );
215
- }
216
-
217
- /**
218
- * Display a HTML table row
219
- *
220
- * @param array $trow
221
- * array of cells
222
- * @param string $javaScript
223
- * javascript code to apply
224
- */
225
- private function tabRow($trow, $javaScript = '', $class = '') {
226
- $this->out( '<tr' . (! empty ( $javaScript ) ? ' onclick="' . $javaScript . '"' : '') . (! empty ( $class ) ? ' class="' . $class . '"' : '') . '>' );
227
- $count = 0;
228
- foreach ( $trow as $tcell )
229
- $this->out( '<td' . ($count ++ ? ' class="right"' : '') . '>' . $tcell . '</td>' );
230
- $this->out( '</tr>' );
231
- }
232
-
233
- /**
234
- * Get the current request's Piwik time settings
235
- *
236
- * @return array time settings: period => Piwik period, date => requested date, description => time description to show in widget title
237
- */
238
- protected function getTimeSettings() {
239
- switch (self::$settings->getGlobalOption ( 'default_date' )) {
240
- case 'today' :
241
- $period = 'day';
242
- $date = 'today';
243
- $description = __('today', 'wp-piwik' );
244
- break;
245
- case 'current_month' :
246
- $period = 'month';
247
- $date = 'today';
248
- $description = __('current month', 'wp-piwik' );
249
- break;
250
- case 'last_month' :
251
- $period = 'month';
252
- $date = date ( "Y-m-d", strtotime ( "last day of previous month" ) );
253
- $description = __('last month', 'wp-piwik' );
254
- break;
255
- case 'current_week' :
256
- $period = 'week';
257
- $date = 'today';
258
- $description = __('current week', 'wp-piwik' );
259
- break;
260
- case 'last_week' :
261
- $period = 'week';
262
- $date = date ( "Y-m-d", strtotime ( "-1 week" ) );
263
- $description = __('last week', 'wp-piwik' );
264
- break;
265
- case 'yesterday' :
266
- $period = 'day';
267
- $date = 'yesterday';
268
- $description = __('yesterday', 'wp-piwik' );
269
- break;
270
- default :
271
- break;
272
- }
273
- return array (
274
- 'period' => $period,
275
- 'date' => isset ( $_GET ['date'] ) ? ( int ) $_GET ['date'] : $date,
276
- 'description' => isset ( $_GET ['date'] ) ? $this->dateFormat ( $_GET ['date'], $period ) : $description
277
- );
278
- }
279
-
280
- /**
281
- * Format a date to show in widget
282
- *
283
- * @param string $date
284
- * date string
285
- * @param string $period
286
- * Piwik period
287
- * @return string formatted date
288
- */
289
- protected function dateFormat($date, $period = 'day') {
290
- $prefix = '';
291
- switch ($period) {
292
- case 'week' :
293
- $prefix = __ ( 'week', 'wp-piwik' ) . ' ';
294
- $format = 'W/Y';
295
- break;
296
- case 'short_week' :
297
- $format = 'W';
298
- break;
299
- case 'month' :
300
- $format = 'F Y';
301
- $date = date ( 'Y-m-d', strtotime ( $date ) );
302
- break;
303
- default :
304
- $format = get_option ( 'date_format' );
305
- }
306
- return $prefix . date_i18n ( $format, strtotime ( $date ) );
307
- }
308
-
309
- /**
310
- * Format time to show in widget
311
- *
312
- * @param int $time
313
- * time in seconds
314
- * @return string formatted time
315
- */
316
- protected function timeFormat($time) {
317
- return floor ( $time / 3600 ) . 'h ' . floor ( ($time % 3600) / 60 ) . 'm ' . floor ( ($time % 3600) % 60 ) . 's';
318
- }
319
-
320
- /**
321
- * Convert Piwik range into meaningful text
322
- *
323
- * @return string range description
324
- */
325
- public function rangeName() {
326
- switch ($this->parameter ['date']) {
327
- case 'last30' :
328
- return __('last 30 days', 'wp-piwik' );
329
- case 'last12' :
330
- return __('last 12 ' . $this->parameter ['period'] . 's', 'wp-piwik' );
331
- default :
332
- return $this->parameter ['date'];
333
- }
334
- }
335
-
336
- /**
337
- * Get the widget name
338
- *
339
- * @return string widget name
340
- */
341
- public function getName() {
342
- return str_replace ( '\\', '-', get_called_class () );
343
- }
344
-
345
- /**
346
- * Display a pie chart
347
- *
348
- * @param
349
- * array chart data array(array(0 => name, 1 => value))
350
- */
351
- public function pieChart($data) {
352
- $this->out( '<div id="wp-piwik_stats_' . $this->getName () . '_graph" style="height:310px;width:100%"></div>' );
353
- $this->out( '<script type="text/javascript">$plotBrowsers = $j.jqplot("wp-piwik_stats_' . $this->getName () . '_graph", [[' );
354
- $list = '';
355
- foreach ( $data as $key => $dataSet ) {
356
- $list .= '["' . $dataSet [0] . '", ' . $dataSet [1] . '],';
357
- if ($key == 'Others') break;
358
- }
359
- $this->out( substr ( $list, 0, - 1 ) );
360
- $this->out( ']], {seriesDefaults:{renderer:$j.jqplot.PieRenderer, rendererOptions:{sliceMargin:8}},legend:{show:true}});</script>' );
361
- }
362
-
363
- /**
364
- * Return an array value by key, return '-' if not set
365
- *
366
- * @param array $array
367
- * array to get a value from
368
- * @param string $key
369
- * key of the value to get from array
370
- * @return string found value or '-' as a placeholder
371
- */
372
- protected function value($array, $key) {
373
- return (isset ( $array [$key] ) ? $array [$key] : '-');
374
- }
 
375
  }
1
+ <?php
2
+
3
+ namespace WP_Piwik;
4
+
5
+ /**
6
+ * Abstract widget class
7
+ *
8
+ * @author Andr&eacute; Br&auml;kling
9
+ * @package WP_Piwik
10
+ */
11
+ abstract class Widget {
12
+
13
+ /**
14
+ *
15
+ * @var Environment variables
16
+ */
17
+ protected static $wpPiwik, $settings;
18
+
19
+ /**
20
+ *
21
+ * @var Configuration parameters
22
+ */
23
+ protected $isShortcode = false, $method = '', $title = '', $context = 'side', $priority = 'core', $parameter = array (), $apiID = array (), $pageId = 'dashboard', $blogId = null, $name = 'Value', $limit = 10, $content = '', $output = '';
24
+
25
+ /**
26
+ * Widget constructor
27
+ *
28
+ * @param WP_Piwik $wpPiwik
29
+ * current WP-Piwik object
30
+ * @param WP_Piwik\Settings $settings
31
+ * current WP-Piwik settings
32
+ * @param string $pageId
33
+ * WordPress page ID (default: dashboard)
34
+ * @param string $context
35
+ * WordPress meta box context (defualt: side)
36
+ * @param string $priority
37
+ * WordPress meta box priority (default: default)
38
+ * @param array $params
39
+ * widget parameters (default: empty array)
40
+ * @param boolean $isShortcode
41
+ * is the widget shown inline? (default: false)
42
+ */
43
+ public function __construct($wpPiwik, $settings, $pageId = 'dashboard', $context = 'side', $priority = 'default', $params = array(), $isShortcode = false) {
44
+ self::$wpPiwik = $wpPiwik;
45
+ self::$settings = $settings;
46
+ $this->pageId = $pageId;
47
+ $this->context = $context;
48
+ $this->priority = $priority;
49
+ if (self::$settings->checkNetworkActivation () && function_exists ( 'is_super_admin' ) && is_super_admin () && isset ( $_GET ['wpmu_show_stats'] )) {
50
+ switch_to_blog ( ( int ) $_GET ['wpmu_show_stats'] );
51
+ $this->blogId = get_current_blog_id ();
52
+ restore_current_blog ();
53
+ }
54
+ $this->isShortcode = $isShortcode;
55
+ $prefix = ($this->pageId == 'dashboard' ? self::$settings->getGlobalOption ( 'plugin_display_name' ) . ' - ' : '');
56
+ $this->configure ( $prefix, $params );
57
+ if (is_array ( $this->method ))
58
+ foreach ( $this->method as $method ) {
59
+ $this->apiID [$method] = \WP_Piwik\Request::register ( $method, $this->parameter );
60
+ self::$wpPiwik->log ( "Register request: " . $this->apiID [$method] );
61
+ }
62
+ else {
63
+ $this->apiID [$this->method] = \WP_Piwik\Request::register ( $this->method, $this->parameter );
64
+ self::$wpPiwik->log ( "Register request: " . $this->apiID [$this->method] );
65
+ }
66
+ if ($this->isShortcode)
67
+ return;
68
+ add_meta_box ( $this->getName (), $this->title, array (
69
+ $this,
70
+ 'show'
71
+ ), $pageId, $this->context, $this->priority );
72
+ }
73
+
74
+ /**
75
+ * Conifguration dummy method
76
+ *
77
+ * @param string $prefix
78
+ * metabox title prefix (default: empty)
79
+ * @param array $params
80
+ * widget parameters (default: empty array)
81
+ */
82
+ protected function configure($prefix = '', $params = array()) {
83
+ }
84
+
85
+ /**
86
+ * Default show widget method, handles default Piwik output
87
+ */
88
+ public function show() {
89
+ $response = self::$wpPiwik->request ( $this->apiID [$this->method] );
90
+ if (! empty ( $response ['result'] ) && $response ['result'] == 'error')
91
+ $this->out( '<strong>' . __ ( 'Piwik error', 'wp-piwik' ) . ':</strong> ' . htmlentities ( $response ['message'], ENT_QUOTES, 'utf-8' ) );
92
+ else {
93
+ if (isset ( $response [0] ['nb_uniq_visitors'] ))
94
+ $unique = 'nb_uniq_visitors';
95
+ else
96
+ $unique = 'sum_daily_nb_uniq_visitors';
97
+ $tableHead = array (
98
+ 'label' => __ ( $this->name, 'wp-piwik' )
99
+ );
100
+ $tableHead [$unique] = __ ( 'Unique', 'wp-piwik' );
101
+ if (isset ( $response [0] ['nb_visits'] ))
102
+ $tableHead ['nb_visits'] = __ ( 'Visits', 'wp-piwik' );
103
+ if (isset ( $response [0] ['nb_hits'] ))
104
+ $tableHead ['nb_hits'] = __ ( 'Hits', 'wp-piwik' );
105
+ if (isset ( $response [0] ['nb_actions'] ))
106
+ $tableHead ['nb_actions'] = __ ( 'Actions', 'wp-piwik' );
107
+ $tableBody = array ();
108
+ $count = 0;
109
+ if (is_array($response))
110
+ foreach ( $response as $rowKey => $row ) {
111
+ $count ++;
112
+ $tableBody [$rowKey] = array ();
113
+ foreach ( $tableHead as $key => $value )
114
+ $tableBody [$rowKey] [] = isset ( $row [$key] ) ? $row [$key] : '-';
115
+ if ($count == 10)
116
+ break;
117
+ }
118
+ $this->table ( $tableHead, $tableBody, null );
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Display or store shortcode output
124
+ */
125
+ protected function out($output) {
126
+ if ($this->isShortcode)
127
+ $this->output .= $output;
128
+ else echo $output;
129
+ }
130
+
131
+ /**
132
+ * Return shortcode output
133
+ */
134
+ public function get() {
135
+ return $this->output;
136
+ }
137
+
138
+ /**
139
+ * Display a HTML table
140
+ *
141
+ * @param array $thead
142
+ * table header content (array of cells)
143
+ * @param array $tbody
144
+ * table body content (array of rows)
145
+ * @param array $tfoot
146
+ * table footer content (array of cells)
147
+ * @param string $class
148
+ * CSSclass name to apply on table sections
149
+ * @param string $javaScript
150
+ * array of javascript code to apply on body rows
151
+ */
152
+ protected function table($thead, $tbody = array(), $tfoot = array(), $class = false, $javaScript = array(), $classes = array()) {
153
+ $this->out( '<div class="table"><table class="widefat wp-piwik-table">' );
154
+ if ($this->isShortcode && $this->title) {
155
+ $colspan = !empty ( $tbody ) ? count( $tbody[0] ) : 2 ;
156
+ $this->out( '<tr><th colspan="'.$colspan.'">' . $this->title . '</th></tr>' );
157
+ }
158
+ if (! empty ( $thead ))
159
+ $this->tabHead ( $thead, $class );
160
+ if (! empty ( $tbody ))
161
+ $this->tabBody ( $tbody, $class, $javaScript, $classes );
162
+ else
163
+ $this->out( '<tr><td colspan="10">' . __ ( 'No data available.', 'wp-piwik' ) . '</td></tr>' );
164
+ if (! empty ( $tfoot ))
165
+ $this->tabFoot ( $tfoot, $class );
166
+ $this->out( '</table></div>' );
167
+ }
168
+
169
+ /**
170
+ * Display a HTML table header
171
+ *
172
+ * @param array $thead
173
+ * array of cells
174
+ * @param string $class
175
+ * CSS class to apply
176
+ */
177
+ private function tabHead($thead, $class = false) {
178
+ $this->out( '<thead' . ($class ? ' class="' . $class . '"' : '') . '><tr>' );
179
+ $count = 0;
180
+ foreach ( $thead as $value )
181
+ $this->out( '<th' . ($count ++ ? ' class="right"' : '') . '>' . $value . '</th>' );
182
+ $this->out( '</tr></thead>' );
183
+ }
184
+
185
+ /**
186
+ * Display a HTML table body
187
+ *
188
+ * @param array $tbody
189
+ * array of rows, each row containing an array of cells
190
+ * @param string $class
191
+ * CSS class to apply
192
+ * @param unknown $javaScript
193
+ * array of javascript code to apply (one item per row)
194
+ */
195
+ private function tabBody($tbody, $class = false, $javaScript = array(), $classes = array()) {
196
+ $this->out( '<tbody' . ($class ? ' class="' . $class . '"' : '') . '>' );
197
+ foreach ( $tbody as $key => $trow )
198
+ $this->tabRow ( $trow, isset( $javaScript [$key] ) ?$javaScript [$key] : '', isset ( $classes [$key] ) ?$classes [$key] : '');
199
+ $this->out( '</tbody>' );
200
+ }
201
+
202
+ /**
203
+ * Display a HTML table footer
204
+ *
205
+ * @param array $tfoor
206
+ * array of cells
207
+ * @param string $class
208
+ * CSS class to apply
209
+ */
210
+ private function tabFoot($tfoot, $class = false) {
211
+ $this->out( '<tfoot' . ($class ? ' class="' . $class . '"' : '') . '><tr>' );
212
+ $count = 0;
213
+ foreach ( $tfoot as $value )
214
+ $this->out( '<td' . ($count ++ ? ' class="right"' : '') . '>' . $value . '</td>' );
215
+ $this->out( '</tr></tfoot>' );
216
+ }
217
+
218
+ /**
219
+ * Display a HTML table row
220
+ *
221
+ * @param array $trow
222
+ * array of cells
223
+ * @param string $javaScript
224
+ * javascript code to apply
225
+ */
226
+ private function tabRow($trow, $javaScript = '', $class = '') {
227
+ $this->out( '<tr' . (! empty ( $javaScript ) ? ' onclick="' . $javaScript . '"' : '') . (! empty ( $class ) ? ' class="' . $class . '"' : '') . '>' );
228
+ $count = 0;
229
+ foreach ( $trow as $tcell )
230
+ $this->out( '<td' . ($count ++ ? ' class="right"' : '') . '>' . $tcell . '</td>' );
231
+ $this->out( '</tr>' );
232
+ }
233
+
234
+ /**
235
+ * Get the current request's Piwik time settings
236
+ *
237
+ * @return array time settings: period => Piwik period, date => requested date, description => time description to show in widget title
238
+ */
239
+ protected function getTimeSettings() {
240
+ switch (self::$settings->getGlobalOption ( 'default_date' )) {
241
+ case 'today' :
242
+ $period = 'day';
243
+ $date = 'today';
244
+ $description = __('today', 'wp-piwik' );
245
+ break;
246
+ case 'current_month' :
247
+ $period = 'month';
248
+ $date = 'today';
249
+ $description = __('current month', 'wp-piwik' );
250
+ break;
251
+ case 'last_month' :
252
+ $period = 'month';
253
+ $date = date ( "Y-m-d", strtotime ( "last day of previous month" ) );
254
+ $description = __('last month', 'wp-piwik' );
255
+ break;
256
+ case 'current_week' :
257
+ $period = 'week';
258
+ $date = 'today';
259
+ $description = __('current week', 'wp-piwik' );
260
+ break;
261
+ case 'last_week' :
262
+ $period = 'week';
263
+ $date = date ( "Y-m-d", strtotime ( "-1 week" ) );
264
+ $description = __('last week', 'wp-piwik' );
265
+ break;
266
+ case 'yesterday' :
267
+ $period = 'day';
268
+ $date = 'yesterday';
269
+ $description = __('yesterday', 'wp-piwik' );
270
+ break;
271
+ default :
272
+ break;
273
+ }
274
+ return array (
275
+ 'period' => $period,
276
+ 'date' => isset ( $_GET ['date'] ) ? ( int ) $_GET ['date'] : $date,
277
+ 'description' => isset ( $_GET ['date'] ) ? $this->dateFormat ( $_GET ['date'], $period ) : $description
278
+ );
279
+ }
280
+
281
+ /**
282
+ * Format a date to show in widget
283
+ *
284
+ * @param string $date
285
+ * date string
286
+ * @param string $period
287
+ * Piwik period
288
+ * @return string formatted date
289
+ */
290
+ protected function dateFormat($date, $period = 'day') {
291
+ $prefix = '';
292
+ switch ($period) {
293
+ case 'week' :
294
+ $prefix = __ ( 'week', 'wp-piwik' ) . ' ';
295
+ $format = 'W/Y';
296
+ break;
297
+ case 'short_week' :
298
+ $format = 'W';
299
+ break;
300
+ case 'month' :
301
+ $format = 'F Y';
302
+ $date = date ( 'Y-m-d', strtotime ( $date ) );
303
+ break;
304
+ default :
305
+ $format = get_option ( 'date_format' );
306
+ }
307
+ return $prefix . date_i18n ( $format, strtotime ( $date ) );
308
+ }
309
+
310
+ /**
311
+ * Format time to show in widget
312
+ *
313
+ * @param int $time
314
+ * time in seconds
315
+ * @return string formatted time
316
+ */
317
+ protected function timeFormat($time) {
318
+ return floor ( $time / 3600 ) . 'h ' . floor ( ($time % 3600) / 60 ) . 'm ' . floor ( ($time % 3600) % 60 ) . 's';
319
+ }
320
+
321
+ /**
322
+ * Convert Piwik range into meaningful text
323
+ *
324
+ * @return string range description
325
+ */
326
+ public function rangeName() {
327
+ switch ($this->parameter ['date']) {
328
+ case 'last30' :
329
+ return __('last 30 days', 'wp-piwik' );
330
+ case 'last12' :
331
+ return __('last 12 ' . $this->parameter ['period'] . 's', 'wp-piwik' );
332
+ default :
333
+ return $this->parameter ['date'];
334
+ }
335
+ }
336
+
337
+ /**
338
+ * Get the widget name
339
+ *
340
+ * @return string widget name
341
+ */
342
+ public function getName() {
343
+ return str_replace ( '\\', '-', get_called_class () );
344
+ }
345
+
346
+ /**
347
+ * Display a pie chart
348
+ *
349
+ * @param
350
+ * array chart data array(array(0 => name, 1 => value))
351
+ */
352
+ public function pieChart($data) {
353
+ $this->out( '<div id="wp-piwik_stats_' . $this->getName () . '_graph" style="height:310px;width:100%"></div>' );
354
+ $this->out( '<script type="text/javascript">$plotBrowsers = $j.jqplot("wp-piwik_stats_' . $this->getName () . '_graph", [[' );
355
+ $list = '';
356
+ foreach ( $data as $key => $dataSet ) {
357
+ $list .= '["' . $dataSet [0] . '", ' . $dataSet [1] . '],';
358
+ if ($key == 'Others') break;
359
+ }
360
+ $this->out( substr ( $list, 0, - 1 ) );
361
+ $this->out( ']], {seriesDefaults:{renderer:$j.jqplot.PieRenderer, rendererOptions:{sliceMargin:8}},legend:{show:true}});</script>' );
362
+ }
363
+
364
+ /**
365
+ * Return an array value by key, return '-' if not set
366
+ *
367
+ * @param array $array
368
+ * array to get a value from
369
+ * @param string $key
370
+ * key of the value to get from array
371
+ * @return string found value or '-' as a placeholder
372
+ */
373
+ protected function value($array, $key) {
374
+ return (isset ( $array [$key] ) ? $array [$key] : '-');
375
+ }
376
  }
classes/WP_Piwik/Widget/BrowserDetails.php CHANGED
@@ -43,25 +43,26 @@
43
  $sum = 0;
44
  $js = array();
45
  $class = array();
46
- foreach ($response as $row) {
47
- $count++;
48
- $sum += isset($row[$unique])?$row[$unique]:0;
49
- if ($count < $this->limit)
50
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
51
- elseif (!isset($tableBody['Others'])) {
52
- $tableBody['Others'] = array($row['label'], $row[$unique], 0);
53
- $class['Others'] = 'wp-piwik-hideDetails';
54
- $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
55
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
56
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
57
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
58
- } else {
59
- $tableBody['Others'][1] += $row[$unique];
60
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
61
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
62
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
63
- }
64
- }
 
65
  if ($count > $this->limit)
66
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
67
 
43
  $sum = 0;
44
  $js = array();
45
  $class = array();
46
+ if (is_array($response))
47
+ foreach ($response as $row) {
48
+ $count++;
49
+ $sum += isset($row[$unique])?$row[$unique]:0;
50
+ if ($count < $this->limit)
51
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
+ elseif (!isset($tableBody['Others'])) {
53
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
54
+ $class['Others'] = 'wp-piwik-hideDetails';
55
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
+ } else {
60
+ $tableBody['Others'][1] += $row[$unique];
61
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
62
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
63
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
64
+ }
65
+ }
66
  if ($count > $this->limit)
67
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
68
 
classes/WP_Piwik/Widget/Browsers.php CHANGED
@@ -43,25 +43,26 @@
43
  $sum = 0;
44
  $js = array();
45
  $class = array();
46
- foreach ($response as $row) {
47
- $count++;
48
- $sum += isset($row[$unique])?$row[$unique]:0;
49
- if ($count < $this->limit)
50
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
51
- elseif (!isset($tableBody['Others'])) {
52
- $tableBody['Others'] = array($row['label'], $row[$unique], 0);
53
- $class['Others'] = 'wp-piwik-hideDetails';
54
- $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
55
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
56
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
57
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
58
- } else {
59
- $tableBody['Others'][1] += $row[$unique];
60
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
61
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
62
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
63
- }
64
- }
 
65
  if ($count > $this->limit)
66
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
67
  elseif ($count == $this->limit) {
43
  $sum = 0;
44
  $js = array();
45
  $class = array();
46
+ if (is_array($response))
47
+ foreach ($response as $row) {
48
+ $count++;
49
+ $sum += isset($row[$unique])?$row[$unique]:0;
50
+ if ($count < $this->limit)
51
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
+ elseif (!isset($tableBody['Others'])) {
53
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
54
+ $class['Others'] = 'wp-piwik-hideDetails';
55
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
+ } else {
60
+ $tableBody['Others'][1] += $row[$unique];
61
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
62
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
63
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
64
+ }
65
+ }
66
  if ($count > $this->limit)
67
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
68
  elseif ($count == $this->limit) {
classes/WP_Piwik/Widget/Chart.php CHANGED
File without changes
classes/WP_Piwik/Widget/City.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WP_Piwik\Widget;
4
+
5
+ use WP_Piwik\Widget;
6
+
7
+ class City extends Widget {
8
+
9
+ public $className = __CLASS__;
10
+
11
+ protected function configure($prefix = '', $params = array()) {
12
+ $timeSettings = $this->getTimeSettings();
13
+ $this->parameter = array(
14
+ 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
15
+ 'period' => $timeSettings['period'],
16
+ 'date' => $timeSettings['date']
17
+ );
18
+ $this->title = $prefix.__('Countries', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
19
+ $this->method = 'UserCountry.getCity';
20
+ $this->context = 'normal';
21
+ wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
22
+ wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
23
+ wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
24
+ add_action('admin_head-index.php', array($this, 'addHeaderLines'));
25
+ }
26
+
27
+ public function addHeaderLines() {
28
+ echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
29
+ echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
30
+ echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
31
+ }
32
+
33
+ public function show() {
34
+ $response = self::$wpPiwik->request($this->apiID[$this->method]);
35
+ $tableBody = array();
36
+ if (!empty($response['result']) && $response['result'] ='error')
37
+ echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
38
+ else {
39
+ $tableHead = array(__('City', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
40
+ if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
41
+ else $unique = 'sum_daily_nb_uniq_visitors';
42
+ $count = 0;
43
+ $sum = 0;
44
+ $js = array();
45
+ $class = array();
46
+ if (is_array($response))
47
+ foreach ($response as $row) {
48
+ $count++;
49
+ $sum += isset($row[$unique])?$row[$unique]:0;
50
+ if ($count < $this->limit)
51
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
+ elseif (!isset($tableBody['Others'])) {
53
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
54
+ $class['Others'] = 'wp-piwik-hideDetails';
55
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
+ } else {
60
+ $tableBody['Others'][1] += $row[$unique];
61
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
62
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
63
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
64
+ }
65
+ }
66
+ if ($count > $this->limit)
67
+ $tableBody['Others'][0] = __('Others', 'wp-piwik');
68
+ elseif ($count == $this->limit) {
69
+ $class['Others'] = $js['Others'] = '';
70
+ }
71
+
72
+ foreach ($tableBody as $key => $row)
73
+ $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
74
+
75
+ if (!empty($tableBody)) $this->pieChart($tableBody);
76
+ $this->table($tableHead, $tableBody, null, false, $js, $class);
77
+ }
78
+ }
79
+
80
+ }
classes/WP_Piwik/Widget/Country.php CHANGED
@@ -43,25 +43,26 @@
43
  $sum = 0;
44
  $js = array();
45
  $class = array();
46
- foreach ($response as $row) {
47
- $count++;
48
- $sum += isset($row[$unique])?$row[$unique]:0;
49
- if ($count < $this->limit)
50
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
51
- elseif (!isset($tableBody['Others'])) {
52
- $tableBody['Others'] = array($row['label'], $row[$unique], 0);
53
- $class['Others'] = 'wp-piwik-hideDetails';
54
- $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
55
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
56
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
57
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
58
- } else {
59
- $tableBody['Others'][1] += $row[$unique];
60
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
61
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
62
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
63
- }
64
- }
 
65
  if ($count > $this->limit)
66
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
67
  elseif ($count == $this->limit) {
43
  $sum = 0;
44
  $js = array();
45
  $class = array();
46
+ if (is_array($response))
47
+ foreach ($response as $row) {
48
+ $count++;
49
+ $sum += isset($row[$unique])?$row[$unique]:0;
50
+ if ($count < $this->limit)
51
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
+ elseif (!isset($tableBody['Others'])) {
53
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
54
+ $class['Others'] = 'wp-piwik-hideDetails';
55
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
+ } else {
60
+ $tableBody['Others'][1] += $row[$unique];
61
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
62
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
63
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
64
+ }
65
+ }
66
  if ($count > $this->limit)
67
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
68
  elseif ($count == $this->limit) {
classes/WP_Piwik/Widget/Ecommerce.php CHANGED
File without changes
classes/WP_Piwik/Widget/Items.php CHANGED
File without changes
classes/WP_Piwik/Widget/ItemsCategory.php CHANGED
File without changes
classes/WP_Piwik/Widget/Keywords.php CHANGED
File without changes
classes/WP_Piwik/Widget/Models.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WP_Piwik\Widget;
4
+
5
+ use WP_Piwik\Widget;
6
+
7
+ class Models extends Widget {
8
+
9
+ public $className = __CLASS__;
10
+
11
+ protected function configure($prefix = '', $params = array()) {
12
+ $timeSettings = $this->getTimeSettings();
13
+ $this->parameter = array(
14
+ 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
15
+ 'period' => $timeSettings['period'],
16
+ 'date' => $timeSettings['date']
17
+ );
18
+ $this->title = $prefix.__('Models', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
19
+ $this->method = 'DevicesDetection.getModel';
20
+ $this->context = 'normal';
21
+ wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
22
+ wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
23
+ wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
24
+ add_action('admin_head-index.php', array($this, 'addHeaderLines'));
25
+ }
26
+
27
+ public function addHeaderLines() {
28
+ echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
29
+ echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
30
+ echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
31
+ }
32
+
33
+ public function show() {
34
+ $response = self::$wpPiwik->request($this->apiID[$this->method]);
35
+ $tableBody = array();
36
+ if (!empty($response['result']) && $response['result'] ='error')
37
+ echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
38
+ else {
39
+ $tableHead = array(__('Model', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
40
+ if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
41
+ else $unique = 'sum_daily_nb_uniq_visitors';
42
+ $count = 0;
43
+ $sum = 0;
44
+ $js = array();
45
+ $class = array();
46
+ if (is_array($response))
47
+ foreach ($response as $row) {
48
+ $count++;
49
+ $sum += isset($row[$unique])?$row[$unique]:0;
50
+ if ($count < $this->limit)
51
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
+ elseif (!isset($tableBody['Others'])) {
53
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
54
+ $class['Others'] = 'wp-piwik-hideDetails';
55
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
+ } else {
60
+ $tableBody['Others'][1] += $row[$unique];
61
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
62
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
63
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
64
+ }
65
+ }
66
+ if ($count > $this->limit)
67
+ $tableBody['Others'][0] = __('Others', 'wp-piwik');
68
+ elseif ($count == $this->limit) {
69
+ $class['Others'] = $js['Others'] = '';
70
+ }
71
+
72
+ foreach ($tableBody as $key => $row)
73
+ $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
74
+
75
+ if (!empty($tableBody)) $this->pieChart($tableBody);
76
+ $this->table($tableHead, $tableBody, null, false, $js, $class);
77
+ }
78
+ }
79
+
80
+ }
classes/WP_Piwik/Widget/Noresult.php CHANGED
@@ -25,11 +25,12 @@
25
  $tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik'));
26
  $tableBody = array();
27
  $count = 0;
28
- foreach ($response as $row) {
29
- $count++;
30
- $tableBody[] = array($row['label'], $row['nb_visits'], $row['bounce_rate']);
31
- if ($count == 10) break;
32
- }
 
33
  $this->table($tableHead, $tableBody, null);
34
  }
35
  }
25
  $tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik'));
26
  $tableBody = array();
27
  $count = 0;
28
+ if (is_array($response))
29
+ foreach ($response as $row) {
30
+ $count++;
31
+ $tableBody[] = array($row['label'], $row['nb_visits'], $row['bounce_rate']);
32
+ if ($count == 10) break;
33
+ }
34
  $this->table($tableHead, $tableBody, null);
35
  }
36
  }
classes/WP_Piwik/Widget/OptOut.php CHANGED
@@ -19,6 +19,9 @@
19
  case 'cloud' :
20
  $PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud/';
21
  break;
 
 
 
22
  default :
23
  $PIWIK_URL = self::$settings->getGlobalOption ( 'piwik_url' );
24
  }
19
  case 'cloud' :
20
  $PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud/';
21
  break;
22
+ case 'cloud-matomo':
23
+ $PIWIK_URL = 'https://' . self::$settings->getGlobalOption ( 'matomo_user' ) . '.matomo.cloud/';
24
+ break;
25
  default :
26
  $PIWIK_URL = self::$settings->getGlobalOption ( 'piwik_url' );
27
  }
classes/WP_Piwik/Widget/Overview.php CHANGED
File without changes
classes/WP_Piwik/Widget/Pages.php CHANGED
File without changes
classes/WP_Piwik/Widget/Plugins.php CHANGED
@@ -25,11 +25,12 @@
25
  $tableHead = array(__('Plugin', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Percent', 'wp-piwik'));
26
  $tableBody = array();
27
  $count = 0;
28
- foreach ($response as $row) {
29
- $count++;
30
- $tableBody[] = array($row['label'], $row['nb_visits'], $row['nb_visits_percentage']);
31
- if ($count == 10) break;
32
- }
 
33
  $this->table($tableHead, $tableBody, null);
34
  }
35
  }
25
  $tableHead = array(__('Plugin', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Percent', 'wp-piwik'));
26
  $tableBody = array();
27
  $count = 0;
28
+ if (is_array($response))
29
+ foreach ($response as $row) {
30
+ $count++;
31
+ $tableBody[] = array($row['label'], $row['nb_visits'], $row['nb_visits_percentage']);
32
+ if ($count == 10) break;
33
+ }
34
  $this->table($tableHead, $tableBody, null);
35
  }
36
  }
classes/WP_Piwik/Widget/Post.php CHANGED
File without changes
classes/WP_Piwik/Widget/Referrers.php CHANGED
File without changes
classes/WP_Piwik/Widget/Screens.php CHANGED
@@ -41,25 +41,26 @@
41
  $sum = 0;
42
  $js = array();
43
  $class = array();
44
- foreach ($response as $row) {
45
- $count++;
46
- $sum += isset($row[$unique])?$row[$unique]:0;
47
- if ($count < $this->limit)
48
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
49
- elseif (!isset($tableBody['Others'])) {
50
- $tableBody['Others'] = array($row['label'], $row[$unique], 0);
51
- $class['Others'] = 'wp-piwik-hideDetails';
52
- $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
53
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
54
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
55
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
- } else {
57
- $tableBody['Others'][1] += $row[$unique];
58
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
59
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
60
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
61
- }
62
- }
 
63
  if ($count > $this->limit)
64
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
65
 
41
  $sum = 0;
42
  $js = array();
43
  $class = array();
44
+ if (is_array($response))
45
+ foreach ($response as $row) {
46
+ $count++;
47
+ $sum += isset($row[$unique])?$row[$unique]:0;
48
+ if ($count < $this->limit)
49
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
50
+ elseif (!isset($tableBody['Others'])) {
51
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
52
+ $class['Others'] = 'wp-piwik-hideDetails';
53
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
54
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
55
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
56
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
57
+ } else {
58
+ $tableBody['Others'][1] += $row[$unique];
59
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
60
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
61
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
62
+ }
63
+ }
64
  if ($count > $this->limit)
65
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
66
 
classes/WP_Piwik/Widget/Search.php CHANGED
@@ -25,11 +25,12 @@
25
  $tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik'));
26
  $tableBody = array();
27
  $count = 0;
28
- foreach ($response as $row) {
29
- $count++;
30
- $tableBody[] = array(htmlentities($row['label']), $row['nb_visits'], $row['bounce_rate']);
31
- if ($count == 10) break;
32
- }
 
33
  $this->table($tableHead, $tableBody, null);
34
  }
35
  }
25
  $tableHead = array(__('Keyword', 'wp-piwik'), __('Requests', 'wp-piwik'), __('Bounced', 'wp-piwik'));
26
  $tableBody = array();
27
  $count = 0;
28
+ if (is_array($response))
29
+ foreach ($response as $row) {
30
+ $count++;
31
+ $tableBody[] = array(htmlentities($row['label']), $row['nb_visits'], $row['bounce_rate']);
32
+ if ($count == 10) break;
33
+ }
34
  $this->table($tableHead, $tableBody, null);
35
  }
36
  }
classes/WP_Piwik/Widget/Seo.php CHANGED
File without changes
classes/WP_Piwik/Widget/SystemDetails.php CHANGED
@@ -39,25 +39,26 @@
39
  $sum = 0;
40
  $js = array();
41
  $class = array();
42
- foreach ($response as $row) {
43
- $count++;
44
- $sum += isset($row[$unique])?$row[$unique]:0;
45
- if ($count < $this->limit)
46
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
47
- elseif (!isset($tableBody['Others'])) {
48
- $tableBody['Others'] = array($row['label'], $row[$unique], 0);
49
- $class['Others'] = 'wp-piwik-hideDetails';
50
- $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
51
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
53
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
54
- } else {
55
- $tableBody['Others'][1] += $row[$unique];
56
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
- }
60
- }
 
61
  if ($count > $this->limit)
62
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
63
 
39
  $sum = 0;
40
  $js = array();
41
  $class = array();
42
+ if (is_array($response))
43
+ foreach ($response as $row) {
44
+ $count++;
45
+ $sum += isset($row[$unique])?$row[$unique]:0;
46
+ if ($count < $this->limit)
47
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
48
+ elseif (!isset($tableBody['Others'])) {
49
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
50
+ $class['Others'] = 'wp-piwik-hideDetails';
51
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
52
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
53
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
54
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
55
+ } else {
56
+ $tableBody['Others'][1] += $row[$unique];
57
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
58
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
59
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
60
+ }
61
+ }
62
  if ($count > $this->limit)
63
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
64
 
classes/WP_Piwik/Widget/Systems.php CHANGED
@@ -39,25 +39,26 @@
39
  $sum = 0;
40
  $js = array();
41
  $class = array();
42
- foreach ($response as $row) {
43
- $count++;
44
- $sum += isset($row[$unique])?$row[$unique]:0;
45
- if ($count < $this->limit)
46
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
47
- elseif (!isset($tableBody['Others'])) {
48
- $tableBody['Others'] = array($row['label'], $row[$unique], 0);
49
- $class['Others'] = 'wp-piwik-hideDetails';
50
- $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
51
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
53
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
54
- } else {
55
- $tableBody['Others'][1] += $row[$unique];
56
- $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
- $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
- $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
- }
60
- }
 
61
  if ($count > $this->limit)
62
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
63
 
39
  $sum = 0;
40
  $js = array();
41
  $class = array();
42
+ if (is_array($response))
43
+ foreach ($response as $row) {
44
+ $count++;
45
+ $sum += isset($row[$unique])?$row[$unique]:0;
46
+ if ($count < $this->limit)
47
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
48
+ elseif (!isset($tableBody['Others'])) {
49
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
50
+ $class['Others'] = 'wp-piwik-hideDetails';
51
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
52
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
53
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
54
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
55
+ } else {
56
+ $tableBody['Others'][1] += $row[$unique];
57
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
58
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
59
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
60
+ }
61
+ }
62
  if ($count > $this->limit)
63
  $tableBody['Others'][0] = __('Others', 'wp-piwik');
64
 
classes/WP_Piwik/Widget/Types.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WP_Piwik\Widget;
4
+
5
+ use WP_Piwik\Widget;
6
+
7
+ class Types extends Widget {
8
+
9
+ public $className = __CLASS__;
10
+
11
+ protected function configure($prefix = '', $params = array()) {
12
+ $timeSettings = $this->getTimeSettings();
13
+ $this->parameter = array(
14
+ 'idSite' => self::$wpPiwik->getPiwikSiteId($this->blogId),
15
+ 'period' => $timeSettings['period'],
16
+ 'date' => $timeSettings['date']
17
+ );
18
+ $this->title = $prefix.__('Types', 'wp-piwik').' ('.__($timeSettings['description'],'wp-piwik').')';
19
+ $this->method = 'DevicesDetection.getType';
20
+ $this->context = 'normal';
21
+ wp_enqueue_script('wp-piwik', self::$wpPiwik->getPluginURL().'js/wp-piwik.js', array(), self::$wpPiwik->getPluginVersion(), true);
22
+ wp_enqueue_script('wp-piwik-jqplot',self::$wpPiwik->getPluginURL().'js/jqplot/wp-piwik.jqplot.js',array('jquery'));
23
+ wp_enqueue_style('wp-piwik', self::$wpPiwik->getPluginURL().'css/wp-piwik.css',array(),self::$wpPiwik->getPluginVersion());
24
+ add_action('admin_head-index.php', array($this, 'addHeaderLines'));
25
+ }
26
+
27
+ public function addHeaderLines() {
28
+ echo '<!--[if IE]><script language="javascript" type="text/javascript" src="'.self::$wpPiwik->getPluginURL().'js/jqplot/excanvas.min.js"></script><![endif]-->';
29
+ echo '<link rel="stylesheet" href="'.self::$wpPiwik->getPluginURL().'js/jqplot/jquery.jqplot.min.css" type="text/css"/>';
30
+ echo '<script type="text/javascript">var $j = jQuery.noConflict();</script>';
31
+ }
32
+
33
+ public function show() {
34
+ $response = self::$wpPiwik->request($this->apiID[$this->method]);
35
+ $tableBody = array();
36
+ if (!empty($response['result']) && $response['result'] ='error')
37
+ echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response['message'], ENT_QUOTES, 'utf-8');
38
+ else {
39
+ $tableHead = array(__('Type', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Percent', 'wp-piwik'));
40
+ if (isset($response[0]['nb_uniq_visitors'])) $unique = 'nb_uniq_visitors';
41
+ else $unique = 'sum_daily_nb_uniq_visitors';
42
+ $count = 0;
43
+ $sum = 0;
44
+ $js = array();
45
+ $class = array();
46
+ if (is_array($response))
47
+ foreach ($response as $row) {
48
+ $count++;
49
+ $sum += isset($row[$unique])?$row[$unique]:0;
50
+ if ($count < $this->limit)
51
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
52
+ elseif (!isset($tableBody['Others'])) {
53
+ $tableBody['Others'] = array($row['label'], $row[$unique], 0);
54
+ $class['Others'] = 'wp-piwik-hideDetails';
55
+ $js['Others'] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
56
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
57
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
58
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
59
+ } else {
60
+ $tableBody['Others'][1] += $row[$unique];
61
+ $tableBody[$row['label']] = array($row['label'], $row[$unique], 0);
62
+ $class[$row['label']] = 'wp-piwik-hideDetails hidden';
63
+ $js[$row['label']] = '$j'."( '.wp-piwik-hideDetails' ).toggle( 'hidden' );";
64
+ }
65
+ }
66
+ if ($count > $this->limit)
67
+ $tableBody['Others'][0] = __('Others', 'wp-piwik');
68
+ elseif ($count == $this->limit) {
69
+ $class['Others'] = $js['Others'] = '';
70
+ }
71
+
72
+ foreach ($tableBody as $key => $row)
73
+ $tableBody[$key][2] = number_format($row[1]/$sum*100, 2).'%';
74
+
75
+ if (!empty($tableBody)) $this->pieChart($tableBody);
76
+ $this->table($tableHead, $tableBody, null, false, $js, $class);
77
+ }
78
+ }
79
+
80
+ }
classes/WP_Piwik/Widget/Visitors.php CHANGED
@@ -35,30 +35,31 @@
35
  echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response[$method]['message'], ENT_QUOTES, 'utf-8');
36
  else {
37
  $data = array();
38
- foreach ($response['VisitsSummary.getVisits'] as $key => $value) {
39
- if ($this->parameter['period'] == 'week') {
40
- preg_match("/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/", $key, $dateList);
41
- $jsKey = $dateList[0];
42
- $textKey = $this->dateFormat($jsKey, 'week');
43
- } elseif ($this->parameter['period'] == 'month') {
44
- $jsKey = $key.'-01';
45
- $textKey = $key;
46
- } else $jsKey = $textKey = $key;
47
- $data[] = array(
48
- $textKey,
49
- $value,
50
- $response['VisitsSummary.getUniqueVisitors'][$key]?$response['VisitsSummary.getUniqueVisitors'][$key]:'-',
51
- $response['VisitsSummary.getBounceCount'][$key]?$response['VisitsSummary.getBounceCount'][$key]:'-',
52
- $response['VisitsSummary.getActions'][$key]?$response['VisitsSummary.getActions'][$key]:'-'
53
- );
54
- $javaScript[] = 'javascript:wp_piwik_datelink(\''.urlencode('wp-piwik_stats').'\',\''.str_replace('-', '', $jsKey).'\',\''.(isset($_GET['wpmu_show_stats'])?(int) $_GET['wpmu_show_stats']:'').'\');';
55
- }
 
56
  $this->table(
57
  array(__('Date', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Bounced', 'wp-piwik'), __('Page Views', 'wp-piwik')),
58
  array_reverse($data),
59
  array(),
60
  'clickable',
61
- array_reverse($javaScript)
62
  );
63
  }
64
 
35
  echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($response[$method]['message'], ENT_QUOTES, 'utf-8');
36
  else {
37
  $data = array();
38
+ if (is_array($response) && is_array($response['VisitsSummary.getVisits']))
39
+ foreach ($response['VisitsSummary.getVisits'] as $key => $value) {
40
+ if ($this->parameter['period'] == 'week') {
41
+ preg_match("/[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/", $key, $dateList);
42
+ $jsKey = $dateList[0];
43
+ $textKey = $this->dateFormat($jsKey, 'week');
44
+ } elseif ($this->parameter['period'] == 'month') {
45
+ $jsKey = $key.'-01';
46
+ $textKey = $key;
47
+ } else $jsKey = $textKey = $key;
48
+ $data[] = array(
49
+ $textKey,
50
+ $value,
51
+ $response['VisitsSummary.getUniqueVisitors'][$key]?$response['VisitsSummary.getUniqueVisitors'][$key]:'-',
52
+ $response['VisitsSummary.getBounceCount'][$key]?$response['VisitsSummary.getBounceCount'][$key]:'-',
53
+ $response['VisitsSummary.getActions'][$key]?$response['VisitsSummary.getActions'][$key]:'-'
54
+ );
55
+ $javaScript[] = 'javascript:wp_piwik_datelink(\''.urlencode('wp-piwik_stats').'\',\''.str_replace('-', '', $jsKey).'\',\''.(isset($_GET['wpmu_show_stats'])?(int) $_GET['wpmu_show_stats']:'').'\');';
56
+ }
57
  $this->table(
58
  array(__('Date', 'wp-piwik'), __('Visits', 'wp-piwik'), __('Unique', 'wp-piwik'), __('Bounced', 'wp-piwik'), __('Page Views', 'wp-piwik')),
59
  array_reverse($data),
60
  array(),
61
  'clickable',
62
+ array_reverse(isset($javaScript)?$javaScript:[])
63
  );
64
  }
65
 
config.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
-
3
- /******************************************************
4
- * Configure WP-Piwik Logger
5
- * 0: Logger disabled
6
- * 1: Log to screen
7
- * 2: Log to file (logs/YYYYMMDD_wp-piwik.log)
8
- ******************************************************/
9
  define ( 'WP_PIWIK_ACTIVATE_LOGGER', 0 );
1
+ <?php
2
+
3
+ /******************************************************
4
+ * Configure WP-Piwik Logger
5
+ * 0: Logger disabled
6
+ * 1: Log to screen
7
+ * 2: Log to file (logs/YYYYMMDD_wp-piwik.log)
8
+ ******************************************************/
9
  define ( 'WP_PIWIK_ACTIVATE_LOGGER', 0 );
css/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
  // Nothing to see...
1
+ <?php
2
  // Nothing to see...
css/wp-piwik-spark.css CHANGED
@@ -1,3 +1,3 @@
1
- .wp-piwik_dynbar canvas {
2
- padding-top: 5px !important
3
  }
1
+ .wp-piwik_dynbar canvas {
2
+ padding-top: 5px !important
3
  }
css/wp-piwik.css CHANGED
File without changes
gpl-3.0.html CHANGED
@@ -1,692 +1,692 @@
1
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
- <html><head>
3
-
4
-
5
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
- <title>GNU General Public License - GNU Project - Free Software Foundation (FSF)</title>
7
- </head><body>
8
- <h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
9
- <p style="text-align: center;">Version 3, 29 June 2007</p>
10
-
11
- <p>Copyright © 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;</p><p>
12
- Everyone is permitted to copy and distribute verbatim copies
13
- of this license document, but changing it is not allowed.</p>
14
-
15
- <h3><a name="preamble"></a>Preamble</h3>
16
-
17
- <p>The GNU General Public License is a free, copyleft license for
18
- software and other kinds of works.</p>
19
-
20
- <p>The licenses for most software and other practical works are designed
21
- to take away your freedom to share and change the works. By contrast,
22
- the GNU General Public License is intended to guarantee your freedom to
23
- share and change all versions of a program--to make sure it remains free
24
- software for all its users. We, the Free Software Foundation, use the
25
- GNU General Public License for most of our software; it applies also to
26
- any other work released this way by its authors. You can apply it to
27
- your programs, too.</p>
28
-
29
- <p>When we speak of free software, we are referring to freedom, not
30
- price. Our General Public Licenses are designed to make sure that you
31
- have the freedom to distribute copies of free software (and charge for
32
- them if you wish), that you receive source code or can get it if you
33
- want it, that you can change the software or use pieces of it in new
34
- free programs, and that you know you can do these things.</p>
35
-
36
- <p>To protect your rights, we need to prevent others from denying you
37
- these rights or asking you to surrender the rights. Therefore, you have
38
- certain responsibilities if you distribute copies of the software, or if
39
- you modify it: responsibilities to respect the freedom of others.</p>
40
-
41
- <p>For example, if you distribute copies of such a program, whether
42
- gratis or for a fee, you must pass on to the recipients the same
43
- freedoms that you received. You must make sure that they, too, receive
44
- or can get the source code. And you must show them these terms so they
45
- know their rights.</p>
46
-
47
- <p>Developers that use the GNU GPL protect your rights with two steps:
48
- (1) assert copyright on the software, and (2) offer you this License
49
- giving you legal permission to copy, distribute and/or modify it.</p>
50
-
51
- <p>For the developers' and authors' protection, the GPL clearly explains
52
- that there is no warranty for this free software. For both users' and
53
- authors' sake, the GPL requires that modified versions be marked as
54
- changed, so that their problems will not be attributed erroneously to
55
- authors of previous versions.</p>
56
-
57
- <p>Some devices are designed to deny users access to install or run
58
- modified versions of the software inside them, although the manufacturer
59
- can do so. This is fundamentally incompatible with the aim of
60
- protecting users' freedom to change the software. The systematic
61
- pattern of such abuse occurs in the area of products for individuals to
62
- use, which is precisely where it is most unacceptable. Therefore, we
63
- have designed this version of the GPL to prohibit the practice for those
64
- products. If such problems arise substantially in other domains, we
65
- stand ready to extend this provision to those domains in future versions
66
- of the GPL, as needed to protect the freedom of users.</p>
67
-
68
- <p>Finally, every program is threatened constantly by software patents.
69
- States should not allow patents to restrict development and use of
70
- software on general-purpose computers, but in those that do, we wish to
71
- avoid the special danger that patents applied to a free program could
72
- make it effectively proprietary. To prevent this, the GPL assures that
73
- patents cannot be used to render the program non-free.</p>
74
-
75
- <p>The precise terms and conditions for copying, distribution and
76
- modification follow.</p>
77
-
78
- <h3><a name="terms"></a>TERMS AND CONDITIONS</h3>
79
-
80
- <h4><a name="section0"></a>0. Definitions.</h4>
81
-
82
- <p>“This License” refers to version 3 of the GNU General Public License.</p>
83
-
84
- <p>“Copyright” also means copyright-like laws that apply to other kinds of
85
- works, such as semiconductor masks.</p>
86
-
87
- <p>“The Program” refers to any copyrightable work licensed under this
88
- License. Each licensee is addressed as “you”. “Licensees” and
89
- “recipients” may be individuals or organizations.</p>
90
-
91
- <p>To “modify” a work means to copy from or adapt all or part of the work
92
- in a fashion requiring copyright permission, other than the making of an
93
- exact copy. The resulting work is called a “modified version” of the
94
- earlier work or a work “based on” the earlier work.</p>
95
-
96
- <p>A “covered work” means either the unmodified Program or a work based
97
- on the Program.</p>
98
-
99
- <p>To “propagate” a work means to do anything with it that, without
100
- permission, would make you directly or secondarily liable for
101
- infringement under applicable copyright law, except executing it on a
102
- computer or modifying a private copy. Propagation includes copying,
103
- distribution (with or without modification), making available to the
104
- public, and in some countries other activities as well.</p>
105
-
106
- <p>To “convey” a work means any kind of propagation that enables other
107
- parties to make or receive copies. Mere interaction with a user through
108
- a computer network, with no transfer of a copy, is not conveying.</p>
109
-
110
- <p>An interactive user interface displays “Appropriate Legal Notices”
111
- to the extent that it includes a convenient and prominently visible
112
- feature that (1) displays an appropriate copyright notice, and (2)
113
- tells the user that there is no warranty for the work (except to the
114
- extent that warranties are provided), that licensees may convey the
115
- work under this License, and how to view a copy of this License. If
116
- the interface presents a list of user commands or options, such as a
117
- menu, a prominent item in the list meets this criterion.</p>
118
-
119
- <h4><a name="section1"></a>1. Source Code.</h4>
120
-
121
- <p>The “source code” for a work means the preferred form of the work
122
- for making modifications to it. “Object code” means any non-source
123
- form of a work.</p>
124
-
125
- <p>A “Standard Interface” means an interface that either is an official
126
- standard defined by a recognized standards body, or, in the case of
127
- interfaces specified for a particular programming language, one that
128
- is widely used among developers working in that language.</p>
129
-
130
- <p>The “System Libraries” of an executable work include anything, other
131
- than the work as a whole, that (a) is included in the normal form of
132
- packaging a Major Component, but which is not part of that Major
133
- Component, and (b) serves only to enable use of the work with that
134
- Major Component, or to implement a Standard Interface for which an
135
- implementation is available to the public in source code form. A
136
- “Major Component”, in this context, means a major essential component
137
- (kernel, window system, and so on) of the specific operating system
138
- (if any) on which the executable work runs, or a compiler used to
139
- produce the work, or an object code interpreter used to run it.</p>
140
-
141
- <p>The “Corresponding Source” for a work in object code form means all
142
- the source code needed to generate, install, and (for an executable
143
- work) run the object code and to modify the work, including scripts to
144
- control those activities. However, it does not include the work's
145
- System Libraries, or general-purpose tools or generally available free
146
- programs which are used unmodified in performing those activities but
147
- which are not part of the work. For example, Corresponding Source
148
- includes interface definition files associated with source files for
149
- the work, and the source code for shared libraries and dynamically
150
- linked subprograms that the work is specifically designed to require,
151
- such as by intimate data communication or control flow between those
152
- subprograms and other parts of the work.</p>
153
-
154
- <p>The Corresponding Source need not include anything that users
155
- can regenerate automatically from other parts of the Corresponding
156
- Source.</p>
157
-
158
- <p>The Corresponding Source for a work in source code form is that
159
- same work.</p>
160
-
161
- <h4><a name="section2"></a>2. Basic Permissions.</h4>
162
-
163
- <p>All rights granted under this License are granted for the term of
164
- copyright on the Program, and are irrevocable provided the stated
165
- conditions are met. This License explicitly affirms your unlimited
166
- permission to run the unmodified Program. The output from running a
167
- covered work is covered by this License only if the output, given its
168
- content, constitutes a covered work. This License acknowledges your
169
- rights of fair use or other equivalent, as provided by copyright law.</p>
170
-
171
- <p>You may make, run and propagate covered works that you do not
172
- convey, without conditions so long as your license otherwise remains
173
- in force. You may convey covered works to others for the sole purpose
174
- of having them make modifications exclusively for you, or provide you
175
- with facilities for running those works, provided that you comply with
176
- the terms of this License in conveying all material for which you do
177
- not control copyright. Those thus making or running the covered works
178
- for you must do so exclusively on your behalf, under your direction
179
- and control, on terms that prohibit them from making any copies of
180
- your copyrighted material outside their relationship with you.</p>
181
-
182
- <p>Conveying under any other circumstances is permitted solely under
183
- the conditions stated below. Sublicensing is not allowed; section 10
184
- makes it unnecessary.</p>
185
-
186
- <h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
187
-
188
- <p>No covered work shall be deemed part of an effective technological
189
- measure under any applicable law fulfilling obligations under article
190
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
191
- similar laws prohibiting or restricting circumvention of such
192
- measures.</p>
193
-
194
- <p>When you convey a covered work, you waive any legal power to forbid
195
- circumvention of technological measures to the extent such circumvention
196
- is effected by exercising rights under this License with respect to
197
- the covered work, and you disclaim any intention to limit operation or
198
- modification of the work as a means of enforcing, against the work's
199
- users, your or third parties' legal rights to forbid circumvention of
200
- technological measures.</p>
201
-
202
- <h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
203
-
204
- <p>You may convey verbatim copies of the Program's source code as you
205
- receive it, in any medium, provided that you conspicuously and
206
- appropriately publish on each copy an appropriate copyright notice;
207
- keep intact all notices stating that this License and any
208
- non-permissive terms added in accord with section 7 apply to the code;
209
- keep intact all notices of the absence of any warranty; and give all
210
- recipients a copy of this License along with the Program.</p>
211
-
212
- <p>You may charge any price or no price for each copy that you convey,
213
- and you may offer support or warranty protection for a fee.</p>
214
-
215
- <h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
216
-
217
- <p>You may convey a work based on the Program, or the modifications to
218
- produce it from the Program, in the form of source code under the
219
- terms of section 4, provided that you also meet all of these conditions:</p>
220
-
221
- <ul>
222
- <li>a) The work must carry prominent notices stating that you modified
223
- it, and giving a relevant date.</li>
224
-
225
- <li>b) The work must carry prominent notices stating that it is
226
- released under this License and any conditions added under section
227
- 7. This requirement modifies the requirement in section 4 to
228
- “keep intact all notices”.</li>
229
-
230
- <li>c) You must license the entire work, as a whole, under this
231
- License to anyone who comes into possession of a copy. This
232
- License will therefore apply, along with any applicable section 7
233
- additional terms, to the whole of the work, and all its parts,
234
- regardless of how they are packaged. This License gives no
235
- permission to license the work in any other way, but it does not
236
- invalidate such permission if you have separately received it.</li>
237
-
238
- <li>d) If the work has interactive user interfaces, each must display
239
- Appropriate Legal Notices; however, if the Program has interactive
240
- interfaces that do not display Appropriate Legal Notices, your
241
- work need not make them do so.</li>
242
- </ul>
243
-
244
- <p>A compilation of a covered work with other separate and independent
245
- works, which are not by their nature extensions of the covered work,
246
- and which are not combined with it such as to form a larger program,
247
- in or on a volume of a storage or distribution medium, is called an
248
- “aggregate” if the compilation and its resulting copyright are not
249
- used to limit the access or legal rights of the compilation's users
250
- beyond what the individual works permit. Inclusion of a covered work
251
- in an aggregate does not cause this License to apply to the other
252
- parts of the aggregate.</p>
253
-
254
- <h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
255
-
256
- <p>You may convey a covered work in object code form under the terms
257
- of sections 4 and 5, provided that you also convey the
258
- machine-readable Corresponding Source under the terms of this License,
259
- in one of these ways:</p>
260
-
261
- <ul>
262
- <li>a) Convey the object code in, or embodied in, a physical product
263
- (including a physical distribution medium), accompanied by the
264
- Corresponding Source fixed on a durable physical medium
265
- customarily used for software interchange.</li>
266
-
267
- <li>b) Convey the object code in, or embodied in, a physical product
268
- (including a physical distribution medium), accompanied by a
269
- written offer, valid for at least three years and valid for as
270
- long as you offer spare parts or customer support for that product
271
- model, to give anyone who possesses the object code either (1) a
272
- copy of the Corresponding Source for all the software in the
273
- product that is covered by this License, on a durable physical
274
- medium customarily used for software interchange, for a price no
275
- more than your reasonable cost of physically performing this
276
- conveying of source, or (2) access to copy the
277
- Corresponding Source from a network server at no charge.</li>
278
-
279
- <li>c) Convey individual copies of the object code with a copy of the
280
- written offer to provide the Corresponding Source. This
281
- alternative is allowed only occasionally and noncommercially, and
282
- only if you received the object code with such an offer, in accord
283
- with subsection 6b.</li>
284
-
285
- <li>d) Convey the object code by offering access from a designated
286
- place (gratis or for a charge), and offer equivalent access to the
287
- Corresponding Source in the same way through the same place at no
288
- further charge. You need not require recipients to copy the
289
- Corresponding Source along with the object code. If the place to
290
- copy the object code is a network server, the Corresponding Source
291
- may be on a different server (operated by you or a third party)
292
- that supports equivalent copying facilities, provided you maintain
293
- clear directions next to the object code saying where to find the
294
- Corresponding Source. Regardless of what server hosts the
295
- Corresponding Source, you remain obligated to ensure that it is
296
- available for as long as needed to satisfy these requirements.</li>
297
-
298
- <li>e) Convey the object code using peer-to-peer transmission, provided
299
- you inform other peers where the object code and Corresponding
300
- Source of the work are being offered to the general public at no
301
- charge under subsection 6d.</li>
302
- </ul>
303
-
304
- <p>A separable portion of the object code, whose source code is excluded
305
- from the Corresponding Source as a System Library, need not be
306
- included in conveying the object code work.</p>
307
-
308
- <p>A “User Product” is either (1) a “consumer product”, which means any
309
- tangible personal property which is normally used for personal, family,
310
- or household purposes, or (2) anything designed or sold for incorporation
311
- into a dwelling. In determining whether a product is a consumer product,
312
- doubtful cases shall be resolved in favor of coverage. For a particular
313
- product received by a particular user, “normally used” refers to a
314
- typical or common use of that class of product, regardless of the status
315
- of the particular user or of the way in which the particular user
316
- actually uses, or expects or is expected to use, the product. A product
317
- is a consumer product regardless of whether the product has substantial
318
- commercial, industrial or non-consumer uses, unless such uses represent
319
- the only significant mode of use of the product.</p>
320
-
321
- <p>“Installation Information” for a User Product means any methods,
322
- procedures, authorization keys, or other information required to install
323
- and execute modified versions of a covered work in that User Product from
324
- a modified version of its Corresponding Source. The information must
325
- suffice to ensure that the continued functioning of the modified object
326
- code is in no case prevented or interfered with solely because
327
- modification has been made.</p>
328
-
329
- <p>If you convey an object code work under this section in, or with, or
330
- specifically for use in, a User Product, and the conveying occurs as
331
- part of a transaction in which the right of possession and use of the
332
- User Product is transferred to the recipient in perpetuity or for a
333
- fixed term (regardless of how the transaction is characterized), the
334
- Corresponding Source conveyed under this section must be accompanied
335
- by the Installation Information. But this requirement does not apply
336
- if neither you nor any third party retains the ability to install
337
- modified object code on the User Product (for example, the work has
338
- been installed in ROM).</p>
339
-
340
- <p>The requirement to provide Installation Information does not include a
341
- requirement to continue to provide support service, warranty, or updates
342
- for a work that has been modified or installed by the recipient, or for
343
- the User Product in which it has been modified or installed. Access to a
344
- network may be denied when the modification itself materially and
345
- adversely affects the operation of the network or violates the rules and
346
- protocols for communication across the network.</p>
347
-
348
- <p>Corresponding Source conveyed, and Installation Information provided,
349
- in accord with this section must be in a format that is publicly
350
- documented (and with an implementation available to the public in
351
- source code form), and must require no special password or key for
352
- unpacking, reading or copying.</p>
353
-
354
- <h4><a name="section7"></a>7. Additional Terms.</h4>
355
-
356
- <p>“Additional permissions” are terms that supplement the terms of this
357
- License by making exceptions from one or more of its conditions.
358
- Additional permissions that are applicable to the entire Program shall
359
- be treated as though they were included in this License, to the extent
360
- that they are valid under applicable law. If additional permissions
361
- apply only to part of the Program, that part may be used separately
362
- under those permissions, but the entire Program remains governed by
363
- this License without regard to the additional permissions.</p>
364
-
365
- <p>When you convey a copy of a covered work, you may at your option
366
- remove any additional permissions from that copy, or from any part of
367
- it. (Additional permissions may be written to require their own
368
- removal in certain cases when you modify the work.) You may place
369
- additional permissions on material, added by you to a covered work,
370
- for which you have or can give appropriate copyright permission.</p>
371
-
372
- <p>Notwithstanding any other provision of this License, for material you
373
- add to a covered work, you may (if authorized by the copyright holders of
374
- that material) supplement the terms of this License with terms:</p>
375
-
376
- <ul>
377
- <li>a) Disclaiming warranty or limiting liability differently from the
378
- terms of sections 15 and 16 of this License; or</li>
379
-
380
- <li>b) Requiring preservation of specified reasonable legal notices or
381
- author attributions in that material or in the Appropriate Legal
382
- Notices displayed by works containing it; or</li>
383
-
384
- <li>c) Prohibiting misrepresentation of the origin of that material, or
385
- requiring that modified versions of such material be marked in
386
- reasonable ways as different from the original version; or</li>
387
-
388
- <li>d) Limiting the use for publicity purposes of names of licensors or
389
- authors of the material; or</li>
390
-
391
- <li>e) Declining to grant rights under trademark law for use of some
392
- trade names, trademarks, or service marks; or</li>
393
-
394
- <li>f) Requiring indemnification of licensors and authors of that
395
- material by anyone who conveys the material (or modified versions of
396
- it) with contractual assumptions of liability to the recipient, for
397
- any liability that these contractual assumptions directly impose on
398
- those licensors and authors.</li>
399
- </ul>
400
-
401
- <p>All other non-permissive additional terms are considered “further
402
- restrictions” within the meaning of section 10. If the Program as you
403
- received it, or any part of it, contains a notice stating that it is
404
- governed by this License along with a term that is a further
405
- restriction, you may remove that term. If a license document contains
406
- a further restriction but permits relicensing or conveying under this
407
- License, you may add to a covered work material governed by the terms
408
- of that license document, provided that the further restriction does
409
- not survive such relicensing or conveying.</p>
410
-
411
- <p>If you add terms to a covered work in accord with this section, you
412
- must place, in the relevant source files, a statement of the
413
- additional terms that apply to those files, or a notice indicating
414
- where to find the applicable terms.</p>
415
-
416
- <p>Additional terms, permissive or non-permissive, may be stated in the
417
- form of a separately written license, or stated as exceptions;
418
- the above requirements apply either way.</p>
419
-
420
- <h4><a name="section8"></a>8. Termination.</h4>
421
-
422
- <p>You may not propagate or modify a covered work except as expressly
423
- provided under this License. Any attempt otherwise to propagate or
424
- modify it is void, and will automatically terminate your rights under
425
- this License (including any patent licenses granted under the third
426
- paragraph of section 11).</p>
427
-
428
- <p>However, if you cease all violation of this License, then your
429
- license from a particular copyright holder is reinstated (a)
430
- provisionally, unless and until the copyright holder explicitly and
431
- finally terminates your license, and (b) permanently, if the copyright
432
- holder fails to notify you of the violation by some reasonable means
433
- prior to 60 days after the cessation.</p>
434
-
435
- <p>Moreover, your license from a particular copyright holder is
436
- reinstated permanently if the copyright holder notifies you of the
437
- violation by some reasonable means, this is the first time you have
438
- received notice of violation of this License (for any work) from that
439
- copyright holder, and you cure the violation prior to 30 days after
440
- your receipt of the notice.</p>
441
-
442
- <p>Termination of your rights under this section does not terminate the
443
- licenses of parties who have received copies or rights from you under
444
- this License. If your rights have been terminated and not permanently
445
- reinstated, you do not qualify to receive new licenses for the same
446
- material under section 10.</p>
447
-
448
- <h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
449
-
450
- <p>You are not required to accept this License in order to receive or
451
- run a copy of the Program. Ancillary propagation of a covered work
452
- occurring solely as a consequence of using peer-to-peer transmission
453
- to receive a copy likewise does not require acceptance. However,
454
- nothing other than this License grants you permission to propagate or
455
- modify any covered work. These actions infringe copyright if you do
456
- not accept this License. Therefore, by modifying or propagating a
457
- covered work, you indicate your acceptance of this License to do so.</p>
458
-
459
- <h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
460
-
461
- <p>Each time you convey a covered work, the recipient automatically
462
- receives a license from the original licensors, to run, modify and
463
- propagate that work, subject to this License. You are not responsible
464
- for enforcing compliance by third parties with this License.</p>
465
-
466
- <p>An “entity transaction” is a transaction transferring control of an
467
- organization, or substantially all assets of one, or subdividing an
468
- organization, or merging organizations. If propagation of a covered
469
- work results from an entity transaction, each party to that
470
- transaction who receives a copy of the work also receives whatever
471
- licenses to the work the party's predecessor in interest had or could
472
- give under the previous paragraph, plus a right to possession of the
473
- Corresponding Source of the work from the predecessor in interest, if
474
- the predecessor has it or can get it with reasonable efforts.</p>
475
-
476
- <p>You may not impose any further restrictions on the exercise of the
477
- rights granted or affirmed under this License. For example, you may
478
- not impose a license fee, royalty, or other charge for exercise of
479
- rights granted under this License, and you may not initiate litigation
480
- (including a cross-claim or counterclaim in a lawsuit) alleging that
481
- any patent claim is infringed by making, using, selling, offering for
482
- sale, or importing the Program or any portion of it.</p>
483
-
484
- <h4><a name="section11"></a>11. Patents.</h4>
485
-
486
- <p>A “contributor” is a copyright holder who authorizes use under this
487
- License of the Program or a work on which the Program is based. The
488
- work thus licensed is called the contributor's “contributor version”.</p>
489
-
490
- <p>A contributor's “essential patent claims” are all patent claims
491
- owned or controlled by the contributor, whether already acquired or
492
- hereafter acquired, that would be infringed by some manner, permitted
493
- by this License, of making, using, or selling its contributor version,
494
- but do not include claims that would be infringed only as a
495
- consequence of further modification of the contributor version. For
496
- purposes of this definition, “control” includes the right to grant
497
- patent sublicenses in a manner consistent with the requirements of
498
- this License.</p>
499
-
500
- <p>Each contributor grants you a non-exclusive, worldwide, royalty-free
501
- patent license under the contributor's essential patent claims, to
502
- make, use, sell, offer for sale, import and otherwise run, modify and
503
- propagate the contents of its contributor version.</p>
504
-
505
- <p>In the following three paragraphs, a “patent license” is any express
506
- agreement or commitment, however denominated, not to enforce a patent
507
- (such as an express permission to practice a patent or covenant not to
508
- sue for patent infringement). To “grant” such a patent license to a
509
- party means to make such an agreement or commitment not to enforce a
510
- patent against the party.</p>
511
-
512
- <p>If you convey a covered work, knowingly relying on a patent license,
513
- and the Corresponding Source of the work is not available for anyone
514
- to copy, free of charge and under the terms of this License, through a
515
- publicly available network server or other readily accessible means,
516
- then you must either (1) cause the Corresponding Source to be so
517
- available, or (2) arrange to deprive yourself of the benefit of the
518
- patent license for this particular work, or (3) arrange, in a manner
519
- consistent with the requirements of this License, to extend the patent
520
- license to downstream recipients. “Knowingly relying” means you have
521
- actual knowledge that, but for the patent license, your conveying the
522
- covered work in a country, or your recipient's use of the covered work
523
- in a country, would infringe one or more identifiable patents in that
524
- country that you have reason to believe are valid.</p>
525
-
526
- <p>If, pursuant to or in connection with a single transaction or
527
- arrangement, you convey, or propagate by procuring conveyance of, a
528
- covered work, and grant a patent license to some of the parties
529
- receiving the covered work authorizing them to use, propagate, modify
530
- or convey a specific copy of the covered work, then the patent license
531
- you grant is automatically extended to all recipients of the covered
532
- work and works based on it.</p>
533
-
534
- <p>A patent license is “discriminatory” if it does not include within
535
- the scope of its coverage, prohibits the exercise of, or is
536
- conditioned on the non-exercise of one or more of the rights that are
537
- specifically granted under this License. You may not convey a covered
538
- work if you are a party to an arrangement with a third party that is
539
- in the business of distributing software, under which you make payment
540
- to the third party based on the extent of your activity of conveying
541
- the work, and under which the third party grants, to any of the
542
- parties who would receive the covered work from you, a discriminatory
543
- patent license (a) in connection with copies of the covered work
544
- conveyed by you (or copies made from those copies), or (b) primarily
545
- for and in connection with specific products or compilations that
546
- contain the covered work, unless you entered into that arrangement,
547
- or that patent license was granted, prior to 28 March 2007.</p>
548
-
549
- <p>Nothing in this License shall be construed as excluding or limiting
550
- any implied license or other defenses to infringement that may
551
- otherwise be available to you under applicable patent law.</p>
552
-
553
- <h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
554
-
555
- <p>If conditions are imposed on you (whether by court order, agreement or
556
- otherwise) that contradict the conditions of this License, they do not
557
- excuse you from the conditions of this License. If you cannot convey a
558
- covered work so as to satisfy simultaneously your obligations under this
559
- License and any other pertinent obligations, then as a consequence you may
560
- not convey it at all. For example, if you agree to terms that obligate you
561
- to collect a royalty for further conveying from those to whom you convey
562
- the Program, the only way you could satisfy both those terms and this
563
- License would be to refrain entirely from conveying the Program.</p>
564
-
565
- <h4><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
566
-
567
- <p>Notwithstanding any other provision of this License, you have
568
- permission to link or combine any covered work with a work licensed
569
- under version 3 of the GNU Affero General Public License into a single
570
- combined work, and to convey the resulting work. The terms of this
571
- License will continue to apply to the part which is the covered work,
572
- but the special requirements of the GNU Affero General Public License,
573
- section 13, concerning interaction through a network will apply to the
574
- combination as such.</p>
575
-
576
- <h4><a name="section14"></a>14. Revised Versions of this License.</h4>
577
-
578
- <p>The Free Software Foundation may publish revised and/or new versions of
579
- the GNU General Public License from time to time. Such new versions will
580
- be similar in spirit to the present version, but may differ in detail to
581
- address new problems or concerns.</p>
582
-
583
- <p>Each version is given a distinguishing version number. If the
584
- Program specifies that a certain numbered version of the GNU General
585
- Public License “or any later version” applies to it, you have the
586
- option of following the terms and conditions either of that numbered
587
- version or of any later version published by the Free Software
588
- Foundation. If the Program does not specify a version number of the
589
- GNU General Public License, you may choose any version ever published
590
- by the Free Software Foundation.</p>
591
-
592
- <p>If the Program specifies that a proxy can decide which future
593
- versions of the GNU General Public License can be used, that proxy's
594
- public statement of acceptance of a version permanently authorizes you
595
- to choose that version for the Program.</p>
596
-
597
- <p>Later license versions may give you additional or different
598
- permissions. However, no additional obligations are imposed on any
599
- author or copyright holder as a result of your choosing to follow a
600
- later version.</p>
601
-
602
- <h4><a name="section15"></a>15. Disclaimer of Warranty.</h4>
603
-
604
- <p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
605
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
606
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
607
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
608
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
609
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
610
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
611
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
612
-
613
- <h4><a name="section16"></a>16. Limitation of Liability.</h4>
614
-
615
- <p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
616
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
617
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
618
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
619
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
620
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
621
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
622
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
623
- SUCH DAMAGES.</p>
624
-
625
- <h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
626
-
627
- <p>If the disclaimer of warranty and limitation of liability provided
628
- above cannot be given local legal effect according to their terms,
629
- reviewing courts shall apply local law that most closely approximates
630
- an absolute waiver of all civil liability in connection with the
631
- Program, unless a warranty or assumption of liability accompanies a
632
- copy of the Program in return for a fee.</p>
633
-
634
- <p>END OF TERMS AND CONDITIONS</p>
635
-
636
- <h3><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
637
-
638
- <p>If you develop a new program, and you want it to be of the greatest
639
- possible use to the public, the best way to achieve this is to make it
640
- free software which everyone can redistribute and change under these terms.</p>
641
-
642
- <p>To do so, attach the following notices to the program. It is safest
643
- to attach them to the start of each source file to most effectively
644
- state the exclusion of warranty; and each file should have at least
645
- the “copyright” line and a pointer to where the full notice is found.</p>
646
-
647
- <pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
648
- Copyright (C) &lt;year&gt; &lt;name of author&gt;
649
-
650
- This program is free software: you can redistribute it and/or modify
651
- it under the terms of the GNU General Public License as published by
652
- the Free Software Foundation, either version 3 of the License, or
653
- (at your option) any later version.
654
-
655
- This program is distributed in the hope that it will be useful,
656
- but WITHOUT ANY WARRANTY; without even the implied warranty of
657
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
658
- GNU General Public License for more details.
659
-
660
- You should have received a copy of the GNU General Public License
661
- along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
662
- </pre>
663
-
664
- <p>Also add information on how to contact you by electronic and paper mail.</p>
665
-
666
- <p>If the program does terminal interaction, make it output a short
667
- notice like this when it starts in an interactive mode:</p>
668
-
669
- <pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
670
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
671
- This is free software, and you are welcome to redistribute it
672
- under certain conditions; type `show c' for details.
673
- </pre>
674
-
675
- <p>The hypothetical commands `show w' and `show c' should show the appropriate
676
- parts of the General Public License. Of course, your program's commands
677
- might be different; for a GUI interface, you would use an “about box”.</p>
678
-
679
- <p>You should also get your employer (if you work as a programmer) or school,
680
- if any, to sign a “copyright disclaimer” for the program, if necessary.
681
- For more information on this, and how to apply and follow the GNU GPL, see
682
- &lt;http://www.gnu.org/licenses/&gt;.</p>
683
-
684
- <p>The GNU General Public License does not permit incorporating your program
685
- into proprietary programs. If your program is a subroutine library, you
686
- may consider it more useful to permit linking proprietary applications with
687
- the library. If this is what you want to do, use the GNU Lesser General
688
- Public License instead of this License. But first, please read
689
- &lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;.</p>
690
-
691
-
692
  </body></html>
1
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html><head>
3
+
4
+
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
+ <title>GNU General Public License - GNU Project - Free Software Foundation (FSF)</title>
7
+ </head><body>
8
+ <h3 style="text-align: center;">GNU GENERAL PUBLIC LICENSE</h3>
9
+ <p style="text-align: center;">Version 3, 29 June 2007</p>
10
+
11
+ <p>Copyright © 2007 Free Software Foundation, Inc. &lt;http://fsf.org/&gt;</p><p>
12
+ Everyone is permitted to copy and distribute verbatim copies
13
+ of this license document, but changing it is not allowed.</p>
14
+
15
+ <h3><a name="preamble"></a>Preamble</h3>
16
+
17
+ <p>The GNU General Public License is a free, copyleft license for
18
+ software and other kinds of works.</p>
19
+
20
+ <p>The licenses for most software and other practical works are designed
21
+ to take away your freedom to share and change the works. By contrast,
22
+ the GNU General Public License is intended to guarantee your freedom to
23
+ share and change all versions of a program--to make sure it remains free
24
+ software for all its users. We, the Free Software Foundation, use the
25
+ GNU General Public License for most of our software; it applies also to
26
+ any other work released this way by its authors. You can apply it to
27
+ your programs, too.</p>
28
+
29
+ <p>When we speak of free software, we are referring to freedom, not
30
+ price. Our General Public Licenses are designed to make sure that you
31
+ have the freedom to distribute copies of free software (and charge for
32
+ them if you wish), that you receive source code or can get it if you
33
+ want it, that you can change the software or use pieces of it in new
34
+ free programs, and that you know you can do these things.</p>
35
+
36
+ <p>To protect your rights, we need to prevent others from denying you
37
+ these rights or asking you to surrender the rights. Therefore, you have
38
+ certain responsibilities if you distribute copies of the software, or if
39
+ you modify it: responsibilities to respect the freedom of others.</p>
40
+
41
+ <p>For example, if you distribute copies of such a program, whether
42
+ gratis or for a fee, you must pass on to the recipients the same
43
+ freedoms that you received. You must make sure that they, too, receive
44
+ or can get the source code. And you must show them these terms so they
45
+ know their rights.</p>
46
+
47
+ <p>Developers that use the GNU GPL protect your rights with two steps:
48
+ (1) assert copyright on the software, and (2) offer you this License
49
+ giving you legal permission to copy, distribute and/or modify it.</p>
50
+
51
+ <p>For the developers' and authors' protection, the GPL clearly explains
52
+ that there is no warranty for this free software. For both users' and
53
+ authors' sake, the GPL requires that modified versions be marked as
54
+ changed, so that their problems will not be attributed erroneously to
55
+ authors of previous versions.</p>
56
+
57
+ <p>Some devices are designed to deny users access to install or run
58
+ modified versions of the software inside them, although the manufacturer
59
+ can do so. This is fundamentally incompatible with the aim of
60
+ protecting users' freedom to change the software. The systematic
61
+ pattern of such abuse occurs in the area of products for individuals to
62
+ use, which is precisely where it is most unacceptable. Therefore, we
63
+ have designed this version of the GPL to prohibit the practice for those
64
+ products. If such problems arise substantially in other domains, we
65
+ stand ready to extend this provision to those domains in future versions
66
+ of the GPL, as needed to protect the freedom of users.</p>
67
+
68
+ <p>Finally, every program is threatened constantly by software patents.
69
+ States should not allow patents to restrict development and use of
70
+ software on general-purpose computers, but in those that do, we wish to
71
+ avoid the special danger that patents applied to a free program could
72
+ make it effectively proprietary. To prevent this, the GPL assures that
73
+ patents cannot be used to render the program non-free.</p>
74
+
75
+ <p>The precise terms and conditions for copying, distribution and
76
+ modification follow.</p>
77
+
78
+ <h3><a name="terms"></a>TERMS AND CONDITIONS</h3>
79
+
80
+ <h4><a name="section0"></a>0. Definitions.</h4>
81
+
82
+ <p>“This License” refers to version 3 of the GNU General Public License.</p>
83
+
84
+ <p>“Copyright” also means copyright-like laws that apply to other kinds of
85
+ works, such as semiconductor masks.</p>
86
+
87
+ <p>“The Program” refers to any copyrightable work licensed under this
88
+ License. Each licensee is addressed as “you”. “Licensees” and
89
+ “recipients” may be individuals or organizations.</p>
90
+
91
+ <p>To “modify” a work means to copy from or adapt all or part of the work
92
+ in a fashion requiring copyright permission, other than the making of an
93
+ exact copy. The resulting work is called a “modified version” of the
94
+ earlier work or a work “based on” the earlier work.</p>
95
+
96
+ <p>A “covered work” means either the unmodified Program or a work based
97
+ on the Program.</p>
98
+
99
+ <p>To “propagate” a work means to do anything with it that, without
100
+ permission, would make you directly or secondarily liable for
101
+ infringement under applicable copyright law, except executing it on a
102
+ computer or modifying a private copy. Propagation includes copying,
103
+ distribution (with or without modification), making available to the
104
+ public, and in some countries other activities as well.</p>
105
+
106
+ <p>To “convey” a work means any kind of propagation that enables other
107
+ parties to make or receive copies. Mere interaction with a user through
108
+ a computer network, with no transfer of a copy, is not conveying.</p>
109
+
110
+ <p>An interactive user interface displays “Appropriate Legal Notices”
111
+ to the extent that it includes a convenient and prominently visible
112
+ feature that (1) displays an appropriate copyright notice, and (2)
113
+ tells the user that there is no warranty for the work (except to the
114
+ extent that warranties are provided), that licensees may convey the
115
+ work under this License, and how to view a copy of this License. If
116
+ the interface presents a list of user commands or options, such as a
117
+ menu, a prominent item in the list meets this criterion.</p>
118
+
119
+ <h4><a name="section1"></a>1. Source Code.</h4>
120
+
121
+ <p>The “source code” for a work means the preferred form of the work
122
+ for making modifications to it. “Object code” means any non-source
123
+ form of a work.</p>
124
+
125
+ <p>A “Standard Interface” means an interface that either is an official
126
+ standard defined by a recognized standards body, or, in the case of
127
+ interfaces specified for a particular programming language, one that
128
+ is widely used among developers working in that language.</p>
129
+
130
+ <p>The “System Libraries” of an executable work include anything, other
131
+ than the work as a whole, that (a) is included in the normal form of
132
+ packaging a Major Component, but which is not part of that Major
133
+ Component, and (b) serves only to enable use of the work with that
134
+ Major Component, or to implement a Standard Interface for which an
135
+ implementation is available to the public in source code form. A
136
+ “Major Component”, in this context, means a major essential component
137
+ (kernel, window system, and so on) of the specific operating system
138
+ (if any) on which the executable work runs, or a compiler used to
139
+ produce the work, or an object code interpreter used to run it.</p>
140
+
141
+ <p>The “Corresponding Source” for a work in object code form means all
142
+ the source code needed to generate, install, and (for an executable
143
+ work) run the object code and to modify the work, including scripts to
144
+ control those activities. However, it does not include the work's
145
+ System Libraries, or general-purpose tools or generally available free
146
+ programs which are used unmodified in performing those activities but
147
+ which are not part of the work. For example, Corresponding Source
148
+ includes interface definition files associated with source files for
149
+ the work, and the source code for shared libraries and dynamically
150
+ linked subprograms that the work is specifically designed to require,
151
+ such as by intimate data communication or control flow between those
152
+ subprograms and other parts of the work.</p>
153
+
154
+ <p>The Corresponding Source need not include anything that users
155
+ can regenerate automatically from other parts of the Corresponding
156
+ Source.</p>
157
+
158
+ <p>The Corresponding Source for a work in source code form is that
159
+ same work.</p>
160
+
161
+ <h4><a name="section2"></a>2. Basic Permissions.</h4>
162
+
163
+ <p>All rights granted under this License are granted for the term of
164
+ copyright on the Program, and are irrevocable provided the stated
165
+ conditions are met. This License explicitly affirms your unlimited
166
+ permission to run the unmodified Program. The output from running a
167
+ covered work is covered by this License only if the output, given its
168
+ content, constitutes a covered work. This License acknowledges your
169
+ rights of fair use or other equivalent, as provided by copyright law.</p>
170
+
171
+ <p>You may make, run and propagate covered works that you do not
172
+ convey, without conditions so long as your license otherwise remains
173
+ in force. You may convey covered works to others for the sole purpose
174
+ of having them make modifications exclusively for you, or provide you
175
+ with facilities for running those works, provided that you comply with
176
+ the terms of this License in conveying all material for which you do
177
+ not control copyright. Those thus making or running the covered works
178
+ for you must do so exclusively on your behalf, under your direction
179
+ and control, on terms that prohibit them from making any copies of
180
+ your copyrighted material outside their relationship with you.</p>
181
+
182
+ <p>Conveying under any other circumstances is permitted solely under
183
+ the conditions stated below. Sublicensing is not allowed; section 10
184
+ makes it unnecessary.</p>
185
+
186
+ <h4><a name="section3"></a>3. Protecting Users' Legal Rights From Anti-Circumvention Law.</h4>
187
+
188
+ <p>No covered work shall be deemed part of an effective technological
189
+ measure under any applicable law fulfilling obligations under article
190
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
191
+ similar laws prohibiting or restricting circumvention of such
192
+ measures.</p>
193
+
194
+ <p>When you convey a covered work, you waive any legal power to forbid
195
+ circumvention of technological measures to the extent such circumvention
196
+ is effected by exercising rights under this License with respect to
197
+ the covered work, and you disclaim any intention to limit operation or
198
+ modification of the work as a means of enforcing, against the work's
199
+ users, your or third parties' legal rights to forbid circumvention of
200
+ technological measures.</p>
201
+
202
+ <h4><a name="section4"></a>4. Conveying Verbatim Copies.</h4>
203
+
204
+ <p>You may convey verbatim copies of the Program's source code as you
205
+ receive it, in any medium, provided that you conspicuously and
206
+ appropriately publish on each copy an appropriate copyright notice;
207
+ keep intact all notices stating that this License and any
208
+ non-permissive terms added in accord with section 7 apply to the code;
209
+ keep intact all notices of the absence of any warranty; and give all
210
+ recipients a copy of this License along with the Program.</p>
211
+
212
+ <p>You may charge any price or no price for each copy that you convey,
213
+ and you may offer support or warranty protection for a fee.</p>
214
+
215
+ <h4><a name="section5"></a>5. Conveying Modified Source Versions.</h4>
216
+
217
+ <p>You may convey a work based on the Program, or the modifications to
218
+ produce it from the Program, in the form of source code under the
219
+ terms of section 4, provided that you also meet all of these conditions:</p>
220
+
221
+ <ul>
222
+ <li>a) The work must carry prominent notices stating that you modified
223
+ it, and giving a relevant date.</li>
224
+
225
+ <li>b) The work must carry prominent notices stating that it is
226
+ released under this License and any conditions added under section
227
+ 7. This requirement modifies the requirement in section 4 to
228
+ “keep intact all notices”.</li>
229
+
230
+ <li>c) You must license the entire work, as a whole, under this
231
+ License to anyone who comes into possession of a copy. This
232
+ License will therefore apply, along with any applicable section 7
233
+ additional terms, to the whole of the work, and all its parts,
234
+ regardless of how they are packaged. This License gives no
235
+ permission to license the work in any other way, but it does not
236
+ invalidate such permission if you have separately received it.</li>
237
+
238
+ <li>d) If the work has interactive user interfaces, each must display
239
+ Appropriate Legal Notices; however, if the Program has interactive
240
+ interfaces that do not display Appropriate Legal Notices, your
241
+ work need not make them do so.</li>
242
+ </ul>
243
+
244
+ <p>A compilation of a covered work with other separate and independent
245
+ works, which are not by their nature extensions of the covered work,
246
+ and which are not combined with it such as to form a larger program,
247
+ in or on a volume of a storage or distribution medium, is called an
248
+ “aggregate” if the compilation and its resulting copyright are not
249
+ used to limit the access or legal rights of the compilation's users
250
+ beyond what the individual works permit. Inclusion of a covered work
251
+ in an aggregate does not cause this License to apply to the other
252
+ parts of the aggregate.</p>
253
+
254
+ <h4><a name="section6"></a>6. Conveying Non-Source Forms.</h4>
255
+
256
+ <p>You may convey a covered work in object code form under the terms
257
+ of sections 4 and 5, provided that you also convey the
258
+ machine-readable Corresponding Source under the terms of this License,
259
+ in one of these ways:</p>
260
+
261
+ <ul>
262
+ <li>a) Convey the object code in, or embodied in, a physical product
263
+ (including a physical distribution medium), accompanied by the
264
+ Corresponding Source fixed on a durable physical medium
265
+ customarily used for software interchange.</li>
266
+
267
+ <li>b) Convey the object code in, or embodied in, a physical product
268
+ (including a physical distribution medium), accompanied by a
269
+ written offer, valid for at least three years and valid for as
270
+ long as you offer spare parts or customer support for that product
271
+ model, to give anyone who possesses the object code either (1) a
272
+ copy of the Corresponding Source for all the software in the
273
+ product that is covered by this License, on a durable physical
274
+ medium customarily used for software interchange, for a price no
275
+ more than your reasonable cost of physically performing this
276
+ conveying of source, or (2) access to copy the
277
+ Corresponding Source from a network server at no charge.</li>
278
+
279
+ <li>c) Convey individual copies of the object code with a copy of the
280
+ written offer to provide the Corresponding Source. This
281
+ alternative is allowed only occasionally and noncommercially, and
282
+ only if you received the object code with such an offer, in accord
283
+ with subsection 6b.</li>
284
+
285
+ <li>d) Convey the object code by offering access from a designated
286
+ place (gratis or for a charge), and offer equivalent access to the
287
+ Corresponding Source in the same way through the same place at no
288
+ further charge. You need not require recipients to copy the
289
+ Corresponding Source along with the object code. If the place to
290
+ copy the object code is a network server, the Corresponding Source
291
+ may be on a different server (operated by you or a third party)
292
+ that supports equivalent copying facilities, provided you maintain
293
+ clear directions next to the object code saying where to find the
294
+ Corresponding Source. Regardless of what server hosts the
295
+ Corresponding Source, you remain obligated to ensure that it is
296
+ available for as long as needed to satisfy these requirements.</li>
297
+
298
+ <li>e) Convey the object code using peer-to-peer transmission, provided
299
+ you inform other peers where the object code and Corresponding
300
+ Source of the work are being offered to the general public at no
301
+ charge under subsection 6d.</li>
302
+ </ul>
303
+
304
+ <p>A separable portion of the object code, whose source code is excluded
305
+ from the Corresponding Source as a System Library, need not be
306
+ included in conveying the object code work.</p>
307
+
308
+ <p>A “User Product” is either (1) a “consumer product”, which means any
309
+ tangible personal property which is normally used for personal, family,
310
+ or household purposes, or (2) anything designed or sold for incorporation
311
+ into a dwelling. In determining whether a product is a consumer product,
312
+ doubtful cases shall be resolved in favor of coverage. For a particular
313
+ product received by a particular user, “normally used” refers to a
314
+ typical or common use of that class of product, regardless of the status
315
+ of the particular user or of the way in which the particular user
316
+ actually uses, or expects or is expected to use, the product. A product
317
+ is a consumer product regardless of whether the product has substantial
318
+ commercial, industrial or non-consumer uses, unless such uses represent
319
+ the only significant mode of use of the product.</p>
320
+
321
+ <p>“Installation Information” for a User Product means any methods,
322
+ procedures, authorization keys, or other information required to install
323
+ and execute modified versions of a covered work in that User Product from
324
+ a modified version of its Corresponding Source. The information must
325
+ suffice to ensure that the continued functioning of the modified object
326
+ code is in no case prevented or interfered with solely because
327
+ modification has been made.</p>
328
+
329
+ <p>If you convey an object code work under this section in, or with, or
330
+ specifically for use in, a User Product, and the conveying occurs as
331
+ part of a transaction in which the right of possession and use of the
332
+ User Product is transferred to the recipient in perpetuity or for a
333
+ fixed term (regardless of how the transaction is characterized), the
334
+ Corresponding Source conveyed under this section must be accompanied
335
+ by the Installation Information. But this requirement does not apply
336
+ if neither you nor any third party retains the ability to install
337
+ modified object code on the User Product (for example, the work has
338
+ been installed in ROM).</p>
339
+
340
+ <p>The requirement to provide Installation Information does not include a
341
+ requirement to continue to provide support service, warranty, or updates
342
+ for a work that has been modified or installed by the recipient, or for
343
+ the User Product in which it has been modified or installed. Access to a
344
+ network may be denied when the modification itself materially and
345
+ adversely affects the operation of the network or violates the rules and
346
+ protocols for communication across the network.</p>
347
+
348
+ <p>Corresponding Source conveyed, and Installation Information provided,
349
+ in accord with this section must be in a format that is publicly
350
+ documented (and with an implementation available to the public in
351
+ source code form), and must require no special password or key for
352
+ unpacking, reading or copying.</p>
353
+
354
+ <h4><a name="section7"></a>7. Additional Terms.</h4>
355
+
356
+ <p>“Additional permissions” are terms that supplement the terms of this
357
+ License by making exceptions from one or more of its conditions.
358
+ Additional permissions that are applicable to the entire Program shall
359
+ be treated as though they were included in this License, to the extent
360
+ that they are valid under applicable law. If additional permissions
361
+ apply only to part of the Program, that part may be used separately
362
+ under those permissions, but the entire Program remains governed by
363
+ this License without regard to the additional permissions.</p>
364
+
365
+ <p>When you convey a copy of a covered work, you may at your option
366
+ remove any additional permissions from that copy, or from any part of
367
+ it. (Additional permissions may be written to require their own
368
+ removal in certain cases when you modify the work.) You may place
369
+ additional permissions on material, added by you to a covered work,
370
+ for which you have or can give appropriate copyright permission.</p>
371
+
372
+ <p>Notwithstanding any other provision of this License, for material you
373
+ add to a covered work, you may (if authorized by the copyright holders of
374
+ that material) supplement the terms of this License with terms:</p>
375
+
376
+ <ul>
377
+ <li>a) Disclaiming warranty or limiting liability differently from the
378
+ terms of sections 15 and 16 of this License; or</li>
379
+
380
+ <li>b) Requiring preservation of specified reasonable legal notices or
381
+ author attributions in that material or in the Appropriate Legal
382
+ Notices displayed by works containing it; or</li>
383
+
384
+ <li>c) Prohibiting misrepresentation of the origin of that material, or
385
+ requiring that modified versions of such material be marked in
386
+ reasonable ways as different from the original version; or</li>
387
+
388
+ <li>d) Limiting the use for publicity purposes of names of licensors or
389
+ authors of the material; or</li>
390
+
391
+ <li>e) Declining to grant rights under trademark law for use of some
392
+ trade names, trademarks, or service marks; or</li>
393
+
394
+ <li>f) Requiring indemnification of licensors and authors of that
395
+ material by anyone who conveys the material (or modified versions of
396
+ it) with contractual assumptions of liability to the recipient, for
397
+ any liability that these contractual assumptions directly impose on
398
+ those licensors and authors.</li>
399
+ </ul>
400
+
401
+ <p>All other non-permissive additional terms are considered “further
402
+ restrictions” within the meaning of section 10. If the Program as you
403
+ received it, or any part of it, contains a notice stating that it is
404
+ governed by this License along with a term that is a further
405
+ restriction, you may remove that term. If a license document contains
406
+ a further restriction but permits relicensing or conveying under this
407
+ License, you may add to a covered work material governed by the terms
408
+ of that license document, provided that the further restriction does
409
+ not survive such relicensing or conveying.</p>
410
+
411
+ <p>If you add terms to a covered work in accord with this section, you
412
+ must place, in the relevant source files, a statement of the
413
+ additional terms that apply to those files, or a notice indicating
414
+ where to find the applicable terms.</p>
415
+
416
+ <p>Additional terms, permissive or non-permissive, may be stated in the
417
+ form of a separately written license, or stated as exceptions;
418
+ the above requirements apply either way.</p>
419
+
420
+ <h4><a name="section8"></a>8. Termination.</h4>
421
+
422
+ <p>You may not propagate or modify a covered work except as expressly
423
+ provided under this License. Any attempt otherwise to propagate or
424
+ modify it is void, and will automatically terminate your rights under
425
+ this License (including any patent licenses granted under the third
426
+ paragraph of section 11).</p>
427
+
428
+ <p>However, if you cease all violation of this License, then your
429
+ license from a particular copyright holder is reinstated (a)
430
+ provisionally, unless and until the copyright holder explicitly and
431
+ finally terminates your license, and (b) permanently, if the copyright
432
+ holder fails to notify you of the violation by some reasonable means
433
+ prior to 60 days after the cessation.</p>
434
+
435
+ <p>Moreover, your license from a particular copyright holder is
436
+ reinstated permanently if the copyright holder notifies you of the
437
+ violation by some reasonable means, this is the first time you have
438
+ received notice of violation of this License (for any work) from that
439
+ copyright holder, and you cure the violation prior to 30 days after
440
+ your receipt of the notice.</p>
441
+
442
+ <p>Termination of your rights under this section does not terminate the
443
+ licenses of parties who have received copies or rights from you under
444
+ this License. If your rights have been terminated and not permanently
445
+ reinstated, you do not qualify to receive new licenses for the same
446
+ material under section 10.</p>
447
+
448
+ <h4><a name="section9"></a>9. Acceptance Not Required for Having Copies.</h4>
449
+
450
+ <p>You are not required to accept this License in order to receive or
451
+ run a copy of the Program. Ancillary propagation of a covered work
452
+ occurring solely as a consequence of using peer-to-peer transmission
453
+ to receive a copy likewise does not require acceptance. However,
454
+ nothing other than this License grants you permission to propagate or
455
+ modify any covered work. These actions infringe copyright if you do
456
+ not accept this License. Therefore, by modifying or propagating a
457
+ covered work, you indicate your acceptance of this License to do so.</p>
458
+
459
+ <h4><a name="section10"></a>10. Automatic Licensing of Downstream Recipients.</h4>
460
+
461
+ <p>Each time you convey a covered work, the recipient automatically
462
+ receives a license from the original licensors, to run, modify and
463
+ propagate that work, subject to this License. You are not responsible
464
+ for enforcing compliance by third parties with this License.</p>
465
+
466
+ <p>An “entity transaction” is a transaction transferring control of an
467
+ organization, or substantially all assets of one, or subdividing an
468
+ organization, or merging organizations. If propagation of a covered
469
+ work results from an entity transaction, each party to that
470
+ transaction who receives a copy of the work also receives whatever
471
+ licenses to the work the party's predecessor in interest had or could
472
+ give under the previous paragraph, plus a right to possession of the
473
+ Corresponding Source of the work from the predecessor in interest, if
474
+ the predecessor has it or can get it with reasonable efforts.</p>
475
+
476
+ <p>You may not impose any further restrictions on the exercise of the
477
+ rights granted or affirmed under this License. For example, you may
478
+ not impose a license fee, royalty, or other charge for exercise of
479
+ rights granted under this License, and you may not initiate litigation
480
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
481
+ any patent claim is infringed by making, using, selling, offering for
482
+ sale, or importing the Program or any portion of it.</p>
483
+
484
+ <h4><a name="section11"></a>11. Patents.</h4>
485
+
486
+ <p>A “contributor” is a copyright holder who authorizes use under this
487
+ License of the Program or a work on which the Program is based. The
488
+ work thus licensed is called the contributor's “contributor version”.</p>
489
+
490
+ <p>A contributor's “essential patent claims” are all patent claims
491
+ owned or controlled by the contributor, whether already acquired or
492
+ hereafter acquired, that would be infringed by some manner, permitted
493
+ by this License, of making, using, or selling its contributor version,
494
+ but do not include claims that would be infringed only as a
495
+ consequence of further modification of the contributor version. For
496
+ purposes of this definition, “control” includes the right to grant
497
+ patent sublicenses in a manner consistent with the requirements of
498
+ this License.</p>
499
+
500
+ <p>Each contributor grants you a non-exclusive, worldwide, royalty-free
501
+ patent license under the contributor's essential patent claims, to
502
+ make, use, sell, offer for sale, import and otherwise run, modify and
503
+ propagate the contents of its contributor version.</p>
504
+
505
+ <p>In the following three paragraphs, a “patent license” is any express
506
+ agreement or commitment, however denominated, not to enforce a patent
507
+ (such as an express permission to practice a patent or covenant not to
508
+ sue for patent infringement). To “grant” such a patent license to a
509
+ party means to make such an agreement or commitment not to enforce a
510
+ patent against the party.</p>
511
+
512
+ <p>If you convey a covered work, knowingly relying on a patent license,
513
+ and the Corresponding Source of the work is not available for anyone
514
+ to copy, free of charge and under the terms of this License, through a
515
+ publicly available network server or other readily accessible means,
516
+ then you must either (1) cause the Corresponding Source to be so
517
+ available, or (2) arrange to deprive yourself of the benefit of the
518
+ patent license for this particular work, or (3) arrange, in a manner
519
+ consistent with the requirements of this License, to extend the patent
520
+ license to downstream recipients. “Knowingly relying” means you have
521
+ actual knowledge that, but for the patent license, your conveying the
522
+ covered work in a country, or your recipient's use of the covered work
523
+ in a country, would infringe one or more identifiable patents in that
524
+ country that you have reason to believe are valid.</p>
525
+
526
+ <p>If, pursuant to or in connection with a single transaction or
527
+ arrangement, you convey, or propagate by procuring conveyance of, a
528
+ covered work, and grant a patent license to some of the parties
529
+ receiving the covered work authorizing them to use, propagate, modify
530
+ or convey a specific copy of the covered work, then the patent license
531
+ you grant is automatically extended to all recipients of the covered
532
+ work and works based on it.</p>
533
+
534
+ <p>A patent license is “discriminatory” if it does not include within
535
+ the scope of its coverage, prohibits the exercise of, or is
536
+ conditioned on the non-exercise of one or more of the rights that are
537
+ specifically granted under this License. You may not convey a covered
538
+ work if you are a party to an arrangement with a third party that is
539
+ in the business of distributing software, under which you make payment
540
+ to the third party based on the extent of your activity of conveying
541
+ the work, and under which the third party grants, to any of the
542
+ parties who would receive the covered work from you, a discriminatory
543
+ patent license (a) in connection with copies of the covered work
544
+ conveyed by you (or copies made from those copies), or (b) primarily
545
+ for and in connection with specific products or compilations that
546
+ contain the covered work, unless you entered into that arrangement,
547
+ or that patent license was granted, prior to 28 March 2007.</p>
548
+
549
+ <p>Nothing in this License shall be construed as excluding or limiting
550
+ any implied license or other defenses to infringement that may
551
+ otherwise be available to you under applicable patent law.</p>
552
+
553
+ <h4><a name="section12"></a>12. No Surrender of Others' Freedom.</h4>
554
+
555
+ <p>If conditions are imposed on you (whether by court order, agreement or
556
+ otherwise) that contradict the conditions of this License, they do not
557
+ excuse you from the conditions of this License. If you cannot convey a
558
+ covered work so as to satisfy simultaneously your obligations under this
559
+ License and any other pertinent obligations, then as a consequence you may
560
+ not convey it at all. For example, if you agree to terms that obligate you
561
+ to collect a royalty for further conveying from those to whom you convey
562
+ the Program, the only way you could satisfy both those terms and this
563
+ License would be to refrain entirely from conveying the Program.</p>
564
+
565
+ <h4><a name="section13"></a>13. Use with the GNU Affero General Public License.</h4>
566
+
567
+ <p>Notwithstanding any other provision of this License, you have
568
+ permission to link or combine any covered work with a work licensed
569
+ under version 3 of the GNU Affero General Public License into a single
570
+ combined work, and to convey the resulting work. The terms of this
571
+ License will continue to apply to the part which is the covered work,
572
+ but the special requirements of the GNU Affero General Public License,
573
+ section 13, concerning interaction through a network will apply to the
574
+ combination as such.</p>
575
+
576
+ <h4><a name="section14"></a>14. Revised Versions of this License.</h4>
577
+
578
+ <p>The Free Software Foundation may publish revised and/or new versions of
579
+ the GNU General Public License from time to time. Such new versions will
580
+ be similar in spirit to the present version, but may differ in detail to
581
+ address new problems or concerns.</p>
582
+
583
+ <p>Each version is given a distinguishing version number. If the
584
+ Program specifies that a certain numbered version of the GNU General
585
+ Public License “or any later version” applies to it, you have the
586
+ option of following the terms and conditions either of that numbered
587
+ version or of any later version published by the Free Software
588
+ Foundation. If the Program does not specify a version number of the
589
+ GNU General Public License, you may choose any version ever published
590
+ by the Free Software Foundation.</p>
591
+
592
+ <p>If the Program specifies that a proxy can decide which future
593
+ versions of the GNU General Public License can be used, that proxy's
594
+ public statement of acceptance of a version permanently authorizes you
595
+ to choose that version for the Program.</p>
596
+
597
+ <p>Later license versions may give you additional or different
598
+ permissions. However, no additional obligations are imposed on any
599
+ author or copyright holder as a result of your choosing to follow a
600
+ later version.</p>
601
+
602
+ <h4><a name="section15"></a>15. Disclaimer of Warranty.</h4>
603
+
604
+ <p>THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
605
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
606
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
607
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
608
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
609
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
610
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
611
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.</p>
612
+
613
+ <h4><a name="section16"></a>16. Limitation of Liability.</h4>
614
+
615
+ <p>IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
616
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
617
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
618
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
619
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
620
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
621
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
622
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
623
+ SUCH DAMAGES.</p>
624
+
625
+ <h4><a name="section17"></a>17. Interpretation of Sections 15 and 16.</h4>
626
+
627
+ <p>If the disclaimer of warranty and limitation of liability provided
628
+ above cannot be given local legal effect according to their terms,
629
+ reviewing courts shall apply local law that most closely approximates
630
+ an absolute waiver of all civil liability in connection with the
631
+ Program, unless a warranty or assumption of liability accompanies a
632
+ copy of the Program in return for a fee.</p>
633
+
634
+ <p>END OF TERMS AND CONDITIONS</p>
635
+
636
+ <h3><a name="howto"></a>How to Apply These Terms to Your New Programs</h3>
637
+
638
+ <p>If you develop a new program, and you want it to be of the greatest
639
+ possible use to the public, the best way to achieve this is to make it
640
+ free software which everyone can redistribute and change under these terms.</p>
641
+
642
+ <p>To do so, attach the following notices to the program. It is safest
643
+ to attach them to the start of each source file to most effectively
644
+ state the exclusion of warranty; and each file should have at least
645
+ the “copyright” line and a pointer to where the full notice is found.</p>
646
+
647
+ <pre> &lt;one line to give the program's name and a brief idea of what it does.&gt;
648
+ Copyright (C) &lt;year&gt; &lt;name of author&gt;
649
+
650
+ This program is free software: you can redistribute it and/or modify
651
+ it under the terms of the GNU General Public License as published by
652
+ the Free Software Foundation, either version 3 of the License, or
653
+ (at your option) any later version.
654
+
655
+ This program is distributed in the hope that it will be useful,
656
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
657
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
658
+ GNU General Public License for more details.
659
+
660
+ You should have received a copy of the GNU General Public License
661
+ along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
662
+ </pre>
663
+
664
+ <p>Also add information on how to contact you by electronic and paper mail.</p>
665
+
666
+ <p>If the program does terminal interaction, make it output a short
667
+ notice like this when it starts in an interactive mode:</p>
668
+
669
+ <pre> &lt;program&gt; Copyright (C) &lt;year&gt; &lt;name of author&gt;
670
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
671
+ This is free software, and you are welcome to redistribute it
672
+ under certain conditions; type `show c' for details.
673
+ </pre>
674
+
675
+ <p>The hypothetical commands `show w' and `show c' should show the appropriate
676
+ parts of the General Public License. Of course, your program's commands
677
+ might be different; for a GUI interface, you would use an “about box”.</p>
678
+
679
+ <p>You should also get your employer (if you work as a programmer) or school,
680
+ if any, to sign a “copyright disclaimer” for the program, if necessary.
681
+ For more information on this, and how to apply and follow the GNU GPL, see
682
+ &lt;http://www.gnu.org/licenses/&gt;.</p>
683
+
684
+ <p>The GNU General Public License does not permit incorporating your program
685
+ into proprietary programs. If your program is a subroutine library, you
686
+ may consider it more useful to permit linking proprietary applications with
687
+ the library. If this is what you want to do, use the GNU Lesser General
688
+ Public License instead of this License. But first, please read
689
+ &lt;http://www.gnu.org/philosophy/why-not-lgpl.html&gt;.</p>
690
+
691
+
692
  </body></html>
index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
  // Nothing to see...
1
+ <?php
2
  // Nothing to see...
js/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
  // Nothing to see...
1
+ <?php
2
  // Nothing to see...
js/jqplot/IMPORTANT_NOTICE.txt CHANGED
File without changes
js/jqplot/MIT-LICENSE.txt CHANGED
File without changes
js/jqplot/README.txt CHANGED
File without changes
js/jqplot/changes.txt CHANGED
File without changes
js/jqplot/copyright.txt CHANGED
File without changes
js/jqplot/excanvas.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /* jqPlot @VERSION | (c) 2009-2013 Chris Leonello | jplot.com
2
- jsDate | (c) 2010-2013 Chris Leonello
3
  */if(!document.createElement("canvas").getContext){(function(){var ab=Math;var n=ab.round;var l=ab.sin;var A=ab.cos;var H=ab.abs;var N=ab.sqrt;var d=10;var f=d/2;var z=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];function y(){return this.context_||(this.context_=new D(this))}var t=Array.prototype.slice;function g(j,m,p){var i=t.call(arguments,2);return function(){return j.apply(m,i.concat(t.call(arguments)))}}function af(i){return String(i).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function Y(m,j,i){if(!m.namespaces[j]){m.namespaces.add(j,i,"#default#VML")}}function R(j){Y(j,"g_vml_","urn:schemas-microsoft-com:vml");Y(j,"g_o_","urn:schemas-microsoft-com:office:office");if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j<m.length;j++){this.initElement(m[j])}},initElement:function(j){if(!j.getContext){j.getContext=y;R(j.ownerDocument);j.innerHTML="";j.attachEvent("onpropertychange",x);j.attachEvent("onresize",W);var i=j.attributes;if(i.width&&i.width.specified){j.style.width=i.width.nodeValue+"px"}else{j.width=j.clientWidth}if(i.height&&i.height.specified){j.style.height=i.height.nodeValue+"px"}else{j.height=j.clientHeight}}return j},uninitElement:function(j){if(j.getContext){var i=j.getContext();delete i.element_;delete i.canvas;j.innerHTML="";j.context_=null;j.getContext=null;j.detachEvent("onpropertychange",x);j.detachEvent("onresize",W)}}};function x(j){var i=j.srcElement;switch(j.propertyName){case"width":i.getContext().clearRect();i.style.width=i.attributes.width.nodeValue+"px";i.firstChild.style.width=i.clientWidth+"px";break;case"height":i.getContext().clearRect();i.style.height=i.attributes.height.nodeValue+"px";i.firstChild.style.height=i.clientHeight+"px";break}}function W(j){var i=j.srcElement;if(i.firstChild){i.firstChild.style.width=i.clientWidth+"px";i.firstChild.style.height=i.clientHeight+"px"}}e.init();var k=[];for(var ae=0;ae<16;ae++){for(var ad=0;ad<16;ad++){k[ae*16+ad]=ae.toString(16)+ad.toString(16)}}function B(){return[[1,0,0],[0,1,0],[0,0,1]]}function J(p,m){var j=B();for(var i=0;i<3;i++){for(var ah=0;ah<3;ah++){var Z=0;for(var ag=0;ag<3;ag++){Z+=p[i][ag]*m[ag][ah]}j[i][ah]=Z}}return j}function v(j,i){i.fillStyle=j.fillStyle;i.lineCap=j.lineCap;i.lineJoin=j.lineJoin;i.lineWidth=j.lineWidth;i.miterLimit=j.miterLimit;i.shadowBlur=j.shadowBlur;i.shadowColor=j.shadowColor;i.shadowOffsetX=j.shadowOffsetX;i.shadowOffsetY=j.shadowOffsetY;i.strokeStyle=j.strokeStyle;i.globalAlpha=j.globalAlpha;i.font=j.font;i.textAlign=j.textAlign;i.textBaseline=j.textBaseline;i.arcScaleX_=j.arcScaleX_;i.arcScaleY_=j.arcScaleY_;i.lineScale_=j.lineScale_}var b={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"};function M(j){var p=j.indexOf("(",3);var i=j.indexOf(")",p+1);var m=j.substring(p+1,i).split(",");if(m.length!=4||j.charAt(3)!="a"){m[3]=1}return m}function c(i){return parseFloat(i)/100}function r(j,m,i){return Math.min(i,Math.max(m,j))}function I(ag){var i,ai,aj,ah,ak,Z;ah=parseFloat(ag[0])/360%360;if(ah<0){ah++}ak=r(c(ag[1]),0,1);Z=r(c(ag[2]),0,1);if(ak==0){i=ai=aj=Z}else{var j=Z<0.5?Z*(1+ak):Z+ak-Z*ak;var m=2*Z-j;i=a(m,j,ah+1/3);ai=a(m,j,ah);aj=a(m,j,ah-1/3)}return"#"+k[Math.floor(i*255)]+k[Math.floor(ai*255)]+k[Math.floor(aj*255)]}function a(j,i,m){if(m<0){m++}if(m>1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}var C={};function F(j){if(j in C){return C[j]}var ag,Z=1;j=String(j);if(j.charAt(0)=="#"){ag=j}else{if(/^rgb/.test(j)){var p=M(j);var ag="#",ah;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){ah=Math.floor(c(p[m])*255)}else{ah=+p[m]}ag+=k[r(ah,0,255)]}Z=+p[3]}else{if(/^hsl/.test(j)){var p=M(j);ag=I(p);Z=p[3]}else{ag=b[j]||j}}}return C[j]={color:ag,alpha:Z}}var o={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||o.style,variant:m.fontVariant||o.variant,weight:m.fontWeight||o.weight,size:m.fontSize||o.size,family:m.fontFamily||o.family}}function u(m,j){var i={};for(var ah in m){i[ah]=m[ah]}var ag=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ag*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ag/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=Z/0.75}else{i.size=ag}}}}}i.size*=0.981;i.family="'"+i.family.replace(/(\'|\")/g,"").replace(/\s*,\s*/g,"', '")+"'";return i}function ac(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}var s={butt:"flat",round:"round"};function S(i){return s[i]||"square"}function D(i){this.m_=B();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var m="width:"+i.clientWidth+"px;height:"+i.clientHeight+"px;overflow:hidden;position:absolute";var j=i.ownerDocument.createElement("div");j.style.cssText=m;i.appendChild(j);var p=j.cloneNode(false);p.style.backgroundColor="red";p.style.filter="alpha(opacity=0)";i.appendChild(p);this.element_=j;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var q=D.prototype;q.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};q.beginPath=function(){this.currentPath_=[]};q.moveTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.lineTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.bezierCurveTo=function(m,j,ak,aj,ai,ag){var i=V(this,ai,ag);var ah=V(this,m,j);var Z=V(this,ak,aj);K(this,ah,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}q.quadraticCurveTo=function(ai,m,j,i){var ah=V(this,ai,m);var ag=V(this,j,i);var aj={x:this.currentX_+2/3*(ah.x-this.currentX_),y:this.currentY_+2/3*(ah.y-this.currentY_)};var Z={x:aj.x+(ag.x-this.currentX_)/3,y:aj.y+(ag.y-this.currentY_)/3};K(this,aj,Z,ag)};q.arc=function(al,aj,ak,ag,j,m){ak*=d;var ap=m?"at":"wa";var am=al+A(ag)*ak-f;var ao=aj+l(ag)*ak-f;var i=al+A(j)*ak-f;var an=aj+l(j)*ak-f;if(am==i&&!m){am+=0.125}var Z=V(this,al,aj);var ai=V(this,am,ao);var ah=V(this,i,an);this.currentPath_.push({type:ap,x:Z.x,y:Z.y,radius:ak,xStart:ai.x,yStart:ai.y,xEnd:ah.x,yEnd:ah.y})};q.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};q.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};q.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};q.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};q.createRadialGradient=function(p,ag,m,j,Z,i){var ah=new U("gradientradial");ah.x0_=p;ah.y0_=ag;ah.r0_=m;ah.x1_=j;ah.y1_=Z;ah.r1_=i;return ah};q.drawImage=function(aq,m){var aj,ah,al,ay,ao,am,at,aA;var ak=aq.runtimeStyle.width;var ap=aq.runtimeStyle.height;aq.runtimeStyle.width="auto";aq.runtimeStyle.height="auto";var ai=aq.width;var aw=aq.height;aq.runtimeStyle.width=ak;aq.runtimeStyle.height=ap;if(arguments.length==3){aj=arguments[1];ah=arguments[2];ao=am=0;at=al=ai;aA=ay=aw}else{if(arguments.length==5){aj=arguments[1];ah=arguments[2];al=arguments[3];ay=arguments[4];ao=am=0;at=ai;aA=aw}else{if(arguments.length==9){ao=arguments[1];am=arguments[2];at=arguments[3];aA=arguments[4];aj=arguments[5];ah=arguments[6];al=arguments[7];ay=arguments[8]}else{throw Error("Invalid number of arguments")}}}var az=V(this,aj,ah);var p=at/2;var j=aA/2;var ax=[];var i=10;var ag=10;ax.push(" <g_vml_:group",' coordsize="',d*i,",",d*ag,'"',' coordorigin="0,0"',' style="width:',i,"px;height:",ag,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]||this.m_[1][1]!=1||this.m_[1][0]){var Z=[];Z.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",n(az.x/d),",","Dy=",n(az.y/d),"");var av=az;var au=V(this,aj+al,ah);var ar=V(this,aj,ah+ay);var an=V(this,aj+al,ah+ay);av.x=ab.max(av.x,au.x,ar.x,an.x);av.y=ab.max(av.y,au.y,ar.y,an.y);ax.push("padding:0 ",n(av.x/d),"px ",n(av.y/d),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",Z.join(""),", sizingmethod='clip');")}else{ax.push("top:",n(az.y/d),"px;left:",n(az.x/d),"px;")}ax.push(' ">','<g_vml_:image src="',aq.src,'"',' style="width:',d*al,"px;"," height:",d*ay,'px"',' cropleft="',ao/ai,'"',' croptop="',am/aw,'"',' cropright="',(ai-ao-at)/ai,'"',' cropbottom="',(aw-am-aA)/aw,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",ax.join(""))};q.stroke=function(al){var aj=[];var Z=false;var m=10;var am=10;aj.push("<g_vml_:shape",' filled="',!!al,'"',' style="position:absolute;width:',m,"px;height:",am,'px;"',' coordorigin="0,0"',' coordsize="',d*m,",",d*am,'"',' stroked="',!al,'"',' path="');var an=false;var ag={x:null,y:null};var ak={x:null,y:null};for(var ah=0;ah<this.currentPath_.length;ah++){var j=this.currentPath_[ah];var ai;switch(j.type){case"moveTo":ai=j;aj.push(" m ",n(j.x),",",n(j.y));break;case"lineTo":aj.push(" l ",n(j.x),",",n(j.y));break;case"close":aj.push(" x ");j=null;break;case"bezierCurveTo":aj.push(" c ",n(j.cp1x),",",n(j.cp1y),",",n(j.cp2x),",",n(j.cp2y),",",n(j.x),",",n(j.y));break;case"at":case"wa":aj.push(" ",j.type," ",n(j.x-this.arcScaleX_*j.radius),",",n(j.y-this.arcScaleY_*j.radius)," ",n(j.x+this.arcScaleX_*j.radius),",",n(j.y+this.arcScaleY_*j.radius)," ",n(j.xStart),",",n(j.yStart)," ",n(j.xEnd),",",n(j.yEnd));break}if(j){if(ag.x==null||j.x<ag.x){ag.x=j.x}if(ak.x==null||j.x>ak.x){ak.x=j.x}if(ag.y==null||j.y<ag.y){ag.y=j.y}if(ak.y==null||j.y>ak.y){ak.y=j.y}}}aj.push(' ">');if(!al){w(this,aj)}else{G(this,aj,ag,ak)}aj.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",aj.join(""))};function w(m,ag){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ag.push("<g_vml_:stroke",' opacity="',Z,'"',' joinstyle="',m.lineJoin,'"',' miterlimit="',m.miterLimit,'"',' endcap="',S(m.lineCap),'"',' weight="',i,'px"',' color="',p,'" />')}function G(aq,ai,aK,ar){var aj=aq.fillStyle;var aB=aq.arcScaleX_;var aA=aq.arcScaleY_;var j=ar.x-aK.x;var p=ar.y-aK.y;if(aj instanceof U){var an=0;var aF={x:0,y:0};var ax=0;var am=1;if(aj.type_=="gradient"){var al=aj.x0_/aB;var m=aj.y0_/aA;var ak=aj.x1_/aB;var aM=aj.y1_/aA;var aJ=V(aq,al,m);var aI=V(aq,ak,aM);var ag=aI.x-aJ.x;var Z=aI.y-aJ.y;an=Math.atan2(ag,Z)*180/Math.PI;if(an<0){an+=360}if(an<0.000001){an=0}}else{var aJ=V(aq,aj.x0_,aj.y0_);aF={x:(aJ.x-aK.x)/j,y:(aJ.y-aK.y)/p};j/=aB*d;p/=aA*d;var aD=ab.max(j,p);ax=2*aj.r0_/aD;am=2*aj.r1_/aD-ax}var av=aj.colors_;av.sort(function(aN,i){return aN.offset-i.offset});var ap=av.length;var au=av[0].color;var at=av[ap-1].color;var az=av[0].alpha*aq.globalAlpha;var ay=av[ap-1].alpha*aq.globalAlpha;var aE=[];for(var aH=0;aH<ap;aH++){var ao=av[aH];aE.push(ao.offset*am+ax+" "+ao.color)}ai.push('<g_vml_:fill type="',aj.type_,'"',' method="none" focus="100%"',' color="',au,'"',' color2="',at,'"',' colors="',aE.join(","),'"',' opacity="',ay,'"',' g_o_:opacity2="',az,'"',' angle="',an,'"',' focusposition="',aF.x,",",aF.y,'" />')}else{if(aj instanceof T){if(j&&p){var ah=-aK.x;var aC=-aK.y;ai.push("<g_vml_:fill",' position="',ah/j*aB*aB,",",aC/p*aA*aA,'"',' type="tile"',' src="',aj.src_,'" />')}}else{var aL=F(aq.fillStyle);var aw=aL.color;var aG=aL.alpha*aq.globalAlpha;ai.push('<g_vml_:fill color="',aw,'" opacity="',aG,'" />')}}}q.fill=function(){this.stroke(true)};q.closePath=function(){this.currentPath_.push({type:"close"})};function V(j,Z,p){var i=j.m_;return{x:d*(Z*i[0][0]+p*i[1][0]+i[2][0])-f,y:d*(Z*i[0][1]+p*i[1][1]+i[2][1])-f}}q.save=function(){var i={};v(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(B(),this.m_)};q.restore=function(){if(this.aStack_.length){v(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function h(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function aa(j,i,p){if(!h(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}q.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];aa(this,J(i,this.m_),false)};q.rotate=function(j){var p=A(j);var m=l(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];aa(this,J(i,this.m_),false)};q.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];aa(this,J(i,this.m_),true)};q.transform=function(Z,p,ah,ag,j,i){var m=[[Z,p,0],[ah,ag,0],[j,i,1]];aa(this,J(m,this.m_),true)};q.setTransform=function(ag,Z,ai,ah,p,j){var i=[[ag,Z,0],[ai,ah,0],[p,j,1]];aa(this,i,true)};q.drawText_=function(am,ak,aj,ap,ai){var ao=this.m_,at=1000,j=0,ar=at,ah={x:0,y:0},ag=[];var i=u(E(this.font),this.element_);var p=ac(i);var au=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=au.direction=="ltr"?"right":"left";break;case"start":Z=au.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":ah.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":ah.y=-i.size/2.25;break}switch(Z){case"right":j=at;ar=0.05;break;case"center":j=ar=at/2;break}var aq=V(this,ak+ah.x,aj+ah.y);ag.push('<g_vml_:line from="',-j,' 0" to="',ar,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!ai,'" stroked="',!!ai,'" style="position:absolute;width:1px;height:1px;">');if(ai){w(this,ag)}else{G(this,ag,{x:-j,y:0},{x:ar,y:i.size})}var an=ao[0][0].toFixed(3)+","+ao[1][0].toFixed(3)+","+ao[0][1].toFixed(3)+","+ao[1][1].toFixed(3)+",0,0";var al=n(aq.x/d+1-ao[0][0])+","+n(aq.y/d-2*ao[1][0]);ag.push('<g_vml_:skew on="t" matrix="',an,'" ',' offset="',al,'" origin="',j,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',af(am),'" style="v-text-align:',Z,";font:",af(p),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",ag.join(""))};q.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};q.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};q.measureText=function(m){if(!this.textMeasureEl_){var i='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};q.clip=function(){};q.arcTo=function(){};q.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var X=P.prototype=new Error;X.INDEX_SIZE_ERR=1;X.DOMSTRING_SIZE_ERR=2;X.HIERARCHY_REQUEST_ERR=3;X.WRONG_DOCUMENT_ERR=4;X.INVALID_CHARACTER_ERR=5;X.NO_DATA_ALLOWED_ERR=6;X.NO_MODIFICATION_ALLOWED_ERR=7;X.NOT_FOUND_ERR=8;X.NOT_SUPPORTED_ERR=9;X.INUSE_ATTRIBUTE_ERR=10;X.INVALID_STATE_ERR=11;X.SYNTAX_ERR=12;X.INVALID_MODIFICATION_ERR=13;X.NAMESPACE_ERR=14;X.INVALID_ACCESS_ERR=15;X.VALIDATION_ERR=16;X.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P;G_vmlCanvasManager._version=888})()};
1
+ /* jqPlot @VERSION | (c) 2009-2013 Chris Leonello | jplot.com
2
+ jsDate | (c) 2010-2013 Chris Leonello
3
  */if(!document.createElement("canvas").getContext){(function(){var ab=Math;var n=ab.round;var l=ab.sin;var A=ab.cos;var H=ab.abs;var N=ab.sqrt;var d=10;var f=d/2;var z=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];function y(){return this.context_||(this.context_=new D(this))}var t=Array.prototype.slice;function g(j,m,p){var i=t.call(arguments,2);return function(){return j.apply(m,i.concat(t.call(arguments)))}}function af(i){return String(i).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function Y(m,j,i){if(!m.namespaces[j]){m.namespaces.add(j,i,"#default#VML")}}function R(j){Y(j,"g_vml_","urn:schemas-microsoft-com:vml");Y(j,"g_o_","urn:schemas-microsoft-com:office:office");if(!j.styleSheets.ex_canvas_){var i=j.createStyleSheet();i.owningElement.id="ex_canvas_";i.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}R(document);var e={init:function(i){var j=i||document;j.createElement("canvas");j.attachEvent("onreadystatechange",g(this.init_,this,j))},init_:function(p){var m=p.getElementsByTagName("canvas");for(var j=0;j<m.length;j++){this.initElement(m[j])}},initElement:function(j){if(!j.getContext){j.getContext=y;R(j.ownerDocument);j.innerHTML="";j.attachEvent("onpropertychange",x);j.attachEvent("onresize",W);var i=j.attributes;if(i.width&&i.width.specified){j.style.width=i.width.nodeValue+"px"}else{j.width=j.clientWidth}if(i.height&&i.height.specified){j.style.height=i.height.nodeValue+"px"}else{j.height=j.clientHeight}}return j},uninitElement:function(j){if(j.getContext){var i=j.getContext();delete i.element_;delete i.canvas;j.innerHTML="";j.context_=null;j.getContext=null;j.detachEvent("onpropertychange",x);j.detachEvent("onresize",W)}}};function x(j){var i=j.srcElement;switch(j.propertyName){case"width":i.getContext().clearRect();i.style.width=i.attributes.width.nodeValue+"px";i.firstChild.style.width=i.clientWidth+"px";break;case"height":i.getContext().clearRect();i.style.height=i.attributes.height.nodeValue+"px";i.firstChild.style.height=i.clientHeight+"px";break}}function W(j){var i=j.srcElement;if(i.firstChild){i.firstChild.style.width=i.clientWidth+"px";i.firstChild.style.height=i.clientHeight+"px"}}e.init();var k=[];for(var ae=0;ae<16;ae++){for(var ad=0;ad<16;ad++){k[ae*16+ad]=ae.toString(16)+ad.toString(16)}}function B(){return[[1,0,0],[0,1,0],[0,0,1]]}function J(p,m){var j=B();for(var i=0;i<3;i++){for(var ah=0;ah<3;ah++){var Z=0;for(var ag=0;ag<3;ag++){Z+=p[i][ag]*m[ag][ah]}j[i][ah]=Z}}return j}function v(j,i){i.fillStyle=j.fillStyle;i.lineCap=j.lineCap;i.lineJoin=j.lineJoin;i.lineWidth=j.lineWidth;i.miterLimit=j.miterLimit;i.shadowBlur=j.shadowBlur;i.shadowColor=j.shadowColor;i.shadowOffsetX=j.shadowOffsetX;i.shadowOffsetY=j.shadowOffsetY;i.strokeStyle=j.strokeStyle;i.globalAlpha=j.globalAlpha;i.font=j.font;i.textAlign=j.textAlign;i.textBaseline=j.textBaseline;i.arcScaleX_=j.arcScaleX_;i.arcScaleY_=j.arcScaleY_;i.lineScale_=j.lineScale_}var b={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"};function M(j){var p=j.indexOf("(",3);var i=j.indexOf(")",p+1);var m=j.substring(p+1,i).split(",");if(m.length!=4||j.charAt(3)!="a"){m[3]=1}return m}function c(i){return parseFloat(i)/100}function r(j,m,i){return Math.min(i,Math.max(m,j))}function I(ag){var i,ai,aj,ah,ak,Z;ah=parseFloat(ag[0])/360%360;if(ah<0){ah++}ak=r(c(ag[1]),0,1);Z=r(c(ag[2]),0,1);if(ak==0){i=ai=aj=Z}else{var j=Z<0.5?Z*(1+ak):Z+ak-Z*ak;var m=2*Z-j;i=a(m,j,ah+1/3);ai=a(m,j,ah);aj=a(m,j,ah-1/3)}return"#"+k[Math.floor(i*255)]+k[Math.floor(ai*255)]+k[Math.floor(aj*255)]}function a(j,i,m){if(m<0){m++}if(m>1){m--}if(6*m<1){return j+(i-j)*6*m}else{if(2*m<1){return i}else{if(3*m<2){return j+(i-j)*(2/3-m)*6}else{return j}}}}var C={};function F(j){if(j in C){return C[j]}var ag,Z=1;j=String(j);if(j.charAt(0)=="#"){ag=j}else{if(/^rgb/.test(j)){var p=M(j);var ag="#",ah;for(var m=0;m<3;m++){if(p[m].indexOf("%")!=-1){ah=Math.floor(c(p[m])*255)}else{ah=+p[m]}ag+=k[r(ah,0,255)]}Z=+p[3]}else{if(/^hsl/.test(j)){var p=M(j);ag=I(p);Z=p[3]}else{ag=b[j]||j}}}return C[j]={color:ag,alpha:Z}}var o={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"};var L={};function E(i){if(L[i]){return L[i]}var p=document.createElement("div");var m=p.style;try{m.font=i}catch(j){}return L[i]={style:m.fontStyle||o.style,variant:m.fontVariant||o.variant,weight:m.fontWeight||o.weight,size:m.fontSize||o.size,family:m.fontFamily||o.family}}function u(m,j){var i={};for(var ah in m){i[ah]=m[ah]}var ag=parseFloat(j.currentStyle.fontSize),Z=parseFloat(m.size);if(typeof m.size=="number"){i.size=m.size}else{if(m.size.indexOf("px")!=-1){i.size=Z}else{if(m.size.indexOf("em")!=-1){i.size=ag*Z}else{if(m.size.indexOf("%")!=-1){i.size=(ag/100)*Z}else{if(m.size.indexOf("pt")!=-1){i.size=Z/0.75}else{i.size=ag}}}}}i.size*=0.981;i.family="'"+i.family.replace(/(\'|\")/g,"").replace(/\s*,\s*/g,"', '")+"'";return i}function ac(i){return i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family}var s={butt:"flat",round:"round"};function S(i){return s[i]||"square"}function D(i){this.m_=B();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.strokeStyle="#000";this.fillStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=d*1;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=i;var m="width:"+i.clientWidth+"px;height:"+i.clientHeight+"px;overflow:hidden;position:absolute";var j=i.ownerDocument.createElement("div");j.style.cssText=m;i.appendChild(j);var p=j.cloneNode(false);p.style.backgroundColor="red";p.style.filter="alpha(opacity=0)";i.appendChild(p);this.element_=j;this.arcScaleX_=1;this.arcScaleY_=1;this.lineScale_=1}var q=D.prototype;q.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);this.textMeasureEl_=null}this.element_.innerHTML=""};q.beginPath=function(){this.currentPath_=[]};q.moveTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"moveTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.lineTo=function(j,i){var m=V(this,j,i);this.currentPath_.push({type:"lineTo",x:m.x,y:m.y});this.currentX_=m.x;this.currentY_=m.y};q.bezierCurveTo=function(m,j,ak,aj,ai,ag){var i=V(this,ai,ag);var ah=V(this,m,j);var Z=V(this,ak,aj);K(this,ah,Z,i)};function K(i,Z,m,j){i.currentPath_.push({type:"bezierCurveTo",cp1x:Z.x,cp1y:Z.y,cp2x:m.x,cp2y:m.y,x:j.x,y:j.y});i.currentX_=j.x;i.currentY_=j.y}q.quadraticCurveTo=function(ai,m,j,i){var ah=V(this,ai,m);var ag=V(this,j,i);var aj={x:this.currentX_+2/3*(ah.x-this.currentX_),y:this.currentY_+2/3*(ah.y-this.currentY_)};var Z={x:aj.x+(ag.x-this.currentX_)/3,y:aj.y+(ag.y-this.currentY_)/3};K(this,aj,Z,ag)};q.arc=function(al,aj,ak,ag,j,m){ak*=d;var ap=m?"at":"wa";var am=al+A(ag)*ak-f;var ao=aj+l(ag)*ak-f;var i=al+A(j)*ak-f;var an=aj+l(j)*ak-f;if(am==i&&!m){am+=0.125}var Z=V(this,al,aj);var ai=V(this,am,ao);var ah=V(this,i,an);this.currentPath_.push({type:ap,x:Z.x,y:Z.y,radius:ak,xStart:ai.x,yStart:ai.y,xEnd:ah.x,yEnd:ah.y})};q.rect=function(m,j,i,p){this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath()};q.strokeRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.stroke();this.currentPath_=Z};q.fillRect=function(m,j,i,p){var Z=this.currentPath_;this.beginPath();this.moveTo(m,j);this.lineTo(m+i,j);this.lineTo(m+i,j+p);this.lineTo(m,j+p);this.closePath();this.fill();this.currentPath_=Z};q.createLinearGradient=function(j,p,i,m){var Z=new U("gradient");Z.x0_=j;Z.y0_=p;Z.x1_=i;Z.y1_=m;return Z};q.createRadialGradient=function(p,ag,m,j,Z,i){var ah=new U("gradientradial");ah.x0_=p;ah.y0_=ag;ah.r0_=m;ah.x1_=j;ah.y1_=Z;ah.r1_=i;return ah};q.drawImage=function(aq,m){var aj,ah,al,ay,ao,am,at,aA;var ak=aq.runtimeStyle.width;var ap=aq.runtimeStyle.height;aq.runtimeStyle.width="auto";aq.runtimeStyle.height="auto";var ai=aq.width;var aw=aq.height;aq.runtimeStyle.width=ak;aq.runtimeStyle.height=ap;if(arguments.length==3){aj=arguments[1];ah=arguments[2];ao=am=0;at=al=ai;aA=ay=aw}else{if(arguments.length==5){aj=arguments[1];ah=arguments[2];al=arguments[3];ay=arguments[4];ao=am=0;at=ai;aA=aw}else{if(arguments.length==9){ao=arguments[1];am=arguments[2];at=arguments[3];aA=arguments[4];aj=arguments[5];ah=arguments[6];al=arguments[7];ay=arguments[8]}else{throw Error("Invalid number of arguments")}}}var az=V(this,aj,ah);var p=at/2;var j=aA/2;var ax=[];var i=10;var ag=10;ax.push(" <g_vml_:group",' coordsize="',d*i,",",d*ag,'"',' coordorigin="0,0"',' style="width:',i,"px;height:",ag,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]||this.m_[1][1]!=1||this.m_[1][0]){var Z=[];Z.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",n(az.x/d),",","Dy=",n(az.y/d),"");var av=az;var au=V(this,aj+al,ah);var ar=V(this,aj,ah+ay);var an=V(this,aj+al,ah+ay);av.x=ab.max(av.x,au.x,ar.x,an.x);av.y=ab.max(av.y,au.y,ar.y,an.y);ax.push("padding:0 ",n(av.x/d),"px ",n(av.y/d),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",Z.join(""),", sizingmethod='clip');")}else{ax.push("top:",n(az.y/d),"px;left:",n(az.x/d),"px;")}ax.push(' ">','<g_vml_:image src="',aq.src,'"',' style="width:',d*al,"px;"," height:",d*ay,'px"',' cropleft="',ao/ai,'"',' croptop="',am/aw,'"',' cropright="',(ai-ao-at)/ai,'"',' cropbottom="',(aw-am-aA)/aw,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",ax.join(""))};q.stroke=function(al){var aj=[];var Z=false;var m=10;var am=10;aj.push("<g_vml_:shape",' filled="',!!al,'"',' style="position:absolute;width:',m,"px;height:",am,'px;"',' coordorigin="0,0"',' coordsize="',d*m,",",d*am,'"',' stroked="',!al,'"',' path="');var an=false;var ag={x:null,y:null};var ak={x:null,y:null};for(var ah=0;ah<this.currentPath_.length;ah++){var j=this.currentPath_[ah];var ai;switch(j.type){case"moveTo":ai=j;aj.push(" m ",n(j.x),",",n(j.y));break;case"lineTo":aj.push(" l ",n(j.x),",",n(j.y));break;case"close":aj.push(" x ");j=null;break;case"bezierCurveTo":aj.push(" c ",n(j.cp1x),",",n(j.cp1y),",",n(j.cp2x),",",n(j.cp2y),",",n(j.x),",",n(j.y));break;case"at":case"wa":aj.push(" ",j.type," ",n(j.x-this.arcScaleX_*j.radius),",",n(j.y-this.arcScaleY_*j.radius)," ",n(j.x+this.arcScaleX_*j.radius),",",n(j.y+this.arcScaleY_*j.radius)," ",n(j.xStart),",",n(j.yStart)," ",n(j.xEnd),",",n(j.yEnd));break}if(j){if(ag.x==null||j.x<ag.x){ag.x=j.x}if(ak.x==null||j.x>ak.x){ak.x=j.x}if(ag.y==null||j.y<ag.y){ag.y=j.y}if(ak.y==null||j.y>ak.y){ak.y=j.y}}}aj.push(' ">');if(!al){w(this,aj)}else{G(this,aj,ag,ak)}aj.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",aj.join(""))};function w(m,ag){var j=F(m.strokeStyle);var p=j.color;var Z=j.alpha*m.globalAlpha;var i=m.lineScale_*m.lineWidth;if(i<1){Z*=i}ag.push("<g_vml_:stroke",' opacity="',Z,'"',' joinstyle="',m.lineJoin,'"',' miterlimit="',m.miterLimit,'"',' endcap="',S(m.lineCap),'"',' weight="',i,'px"',' color="',p,'" />')}function G(aq,ai,aK,ar){var aj=aq.fillStyle;var aB=aq.arcScaleX_;var aA=aq.arcScaleY_;var j=ar.x-aK.x;var p=ar.y-aK.y;if(aj instanceof U){var an=0;var aF={x:0,y:0};var ax=0;var am=1;if(aj.type_=="gradient"){var al=aj.x0_/aB;var m=aj.y0_/aA;var ak=aj.x1_/aB;var aM=aj.y1_/aA;var aJ=V(aq,al,m);var aI=V(aq,ak,aM);var ag=aI.x-aJ.x;var Z=aI.y-aJ.y;an=Math.atan2(ag,Z)*180/Math.PI;if(an<0){an+=360}if(an<0.000001){an=0}}else{var aJ=V(aq,aj.x0_,aj.y0_);aF={x:(aJ.x-aK.x)/j,y:(aJ.y-aK.y)/p};j/=aB*d;p/=aA*d;var aD=ab.max(j,p);ax=2*aj.r0_/aD;am=2*aj.r1_/aD-ax}var av=aj.colors_;av.sort(function(aN,i){return aN.offset-i.offset});var ap=av.length;var au=av[0].color;var at=av[ap-1].color;var az=av[0].alpha*aq.globalAlpha;var ay=av[ap-1].alpha*aq.globalAlpha;var aE=[];for(var aH=0;aH<ap;aH++){var ao=av[aH];aE.push(ao.offset*am+ax+" "+ao.color)}ai.push('<g_vml_:fill type="',aj.type_,'"',' method="none" focus="100%"',' color="',au,'"',' color2="',at,'"',' colors="',aE.join(","),'"',' opacity="',ay,'"',' g_o_:opacity2="',az,'"',' angle="',an,'"',' focusposition="',aF.x,",",aF.y,'" />')}else{if(aj instanceof T){if(j&&p){var ah=-aK.x;var aC=-aK.y;ai.push("<g_vml_:fill",' position="',ah/j*aB*aB,",",aC/p*aA*aA,'"',' type="tile"',' src="',aj.src_,'" />')}}else{var aL=F(aq.fillStyle);var aw=aL.color;var aG=aL.alpha*aq.globalAlpha;ai.push('<g_vml_:fill color="',aw,'" opacity="',aG,'" />')}}}q.fill=function(){this.stroke(true)};q.closePath=function(){this.currentPath_.push({type:"close"})};function V(j,Z,p){var i=j.m_;return{x:d*(Z*i[0][0]+p*i[1][0]+i[2][0])-f,y:d*(Z*i[0][1]+p*i[1][1]+i[2][1])-f}}q.save=function(){var i={};v(this,i);this.aStack_.push(i);this.mStack_.push(this.m_);this.m_=J(B(),this.m_)};q.restore=function(){if(this.aStack_.length){v(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};function h(i){return isFinite(i[0][0])&&isFinite(i[0][1])&&isFinite(i[1][0])&&isFinite(i[1][1])&&isFinite(i[2][0])&&isFinite(i[2][1])}function aa(j,i,p){if(!h(i)){return}j.m_=i;if(p){var Z=i[0][0]*i[1][1]-i[0][1]*i[1][0];j.lineScale_=N(H(Z))}}q.translate=function(m,j){var i=[[1,0,0],[0,1,0],[m,j,1]];aa(this,J(i,this.m_),false)};q.rotate=function(j){var p=A(j);var m=l(j);var i=[[p,m,0],[-m,p,0],[0,0,1]];aa(this,J(i,this.m_),false)};q.scale=function(m,j){this.arcScaleX_*=m;this.arcScaleY_*=j;var i=[[m,0,0],[0,j,0],[0,0,1]];aa(this,J(i,this.m_),true)};q.transform=function(Z,p,ah,ag,j,i){var m=[[Z,p,0],[ah,ag,0],[j,i,1]];aa(this,J(m,this.m_),true)};q.setTransform=function(ag,Z,ai,ah,p,j){var i=[[ag,Z,0],[ai,ah,0],[p,j,1]];aa(this,i,true)};q.drawText_=function(am,ak,aj,ap,ai){var ao=this.m_,at=1000,j=0,ar=at,ah={x:0,y:0},ag=[];var i=u(E(this.font),this.element_);var p=ac(i);var au=this.element_.currentStyle;var Z=this.textAlign.toLowerCase();switch(Z){case"left":case"center":case"right":break;case"end":Z=au.direction=="ltr"?"right":"left";break;case"start":Z=au.direction=="rtl"?"right":"left";break;default:Z="left"}switch(this.textBaseline){case"hanging":case"top":ah.y=i.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":ah.y=-i.size/2.25;break}switch(Z){case"right":j=at;ar=0.05;break;case"center":j=ar=at/2;break}var aq=V(this,ak+ah.x,aj+ah.y);ag.push('<g_vml_:line from="',-j,' 0" to="',ar,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!ai,'" stroked="',!!ai,'" style="position:absolute;width:1px;height:1px;">');if(ai){w(this,ag)}else{G(this,ag,{x:-j,y:0},{x:ar,y:i.size})}var an=ao[0][0].toFixed(3)+","+ao[1][0].toFixed(3)+","+ao[0][1].toFixed(3)+","+ao[1][1].toFixed(3)+",0,0";var al=n(aq.x/d+1-ao[0][0])+","+n(aq.y/d-2*ao[1][0]);ag.push('<g_vml_:skew on="t" matrix="',an,'" ',' offset="',al,'" origin="',j,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',af(am),'" style="v-text-align:',Z,";font:",af(p),'" /></g_vml_:line>');this.element_.insertAdjacentHTML("beforeEnd",ag.join(""))};q.fillText=function(m,i,p,j){this.drawText_(m,i,p,j,false)};q.strokeText=function(m,i,p,j){this.drawText_(m,i,p,j,true)};q.measureText=function(m){if(!this.textMeasureEl_){var i='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",i);this.textMeasureEl_=this.element_.lastChild}var j=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(j.createTextNode(m));return{width:this.textMeasureEl_.offsetWidth}};q.clip=function(){};q.arcTo=function(){};q.createPattern=function(j,i){return new T(j,i)};function U(i){this.type_=i;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}U.prototype.addColorStop=function(j,i){i=F(i);this.colors_.push({offset:j,color:i.color,alpha:i.alpha})};function T(j,i){Q(j);switch(i){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=i;break;default:O("SYNTAX_ERR")}this.src_=j.src;this.width_=j.width;this.height_=j.height}function O(i){throw new P(i)}function Q(i){if(!i||i.nodeType!=1||i.tagName!="IMG"){O("TYPE_MISMATCH_ERR")}if(i.readyState!="complete"){O("INVALID_STATE_ERR")}}function P(i){this.code=this[i];this.message=i+": DOM Exception "+this.code}var X=P.prototype=new Error;X.INDEX_SIZE_ERR=1;X.DOMSTRING_SIZE_ERR=2;X.HIERARCHY_REQUEST_ERR=3;X.WRONG_DOCUMENT_ERR=4;X.INVALID_CHARACTER_ERR=5;X.NO_DATA_ALLOWED_ERR=6;X.NO_MODIFICATION_ALLOWED_ERR=7;X.NOT_FOUND_ERR=8;X.NOT_SUPPORTED_ERR=9;X.INUSE_ATTRIBUTE_ERR=10;X.INVALID_STATE_ERR=11;X.SYNTAX_ERR=12;X.INVALID_MODIFICATION_ERR=13;X.NAMESPACE_ERR=14;X.INVALID_ACCESS_ERR=15;X.VALIDATION_ERR=16;X.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=e;CanvasRenderingContext2D=D;CanvasGradient=U;CanvasPattern=T;DOMException=P;G_vmlCanvasManager._version=888})()};
js/jqplot/gpl-2.0.txt CHANGED
File without changes
js/jqplot/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
  // Nothing to see...
1
+ <?php
2
  // Nothing to see...
js/jqplot/jquery.jqplot.min.css CHANGED
File without changes
js/jqplot/jquery.jqplot.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2
- jsDate | (c) 2010-2013 Chris Leonello
3
  */(function(L){var u;L.fn.emptyForce=function(){for(var ah=0,ai;(ai=L(this)[ah])!=null;ah++){if(ai.nodeType===1){L.cleanData(ai.getElementsByTagName("*"))}if(L.jqplot.use_excanvas){ai.outerHTML=""}else{while(ai.firstChild){ai.removeChild(ai.firstChild)}}ai=null}return L(this)};L.fn.removeChildForce=function(ah){while(ah.firstChild){this.removeChildForce(ah.firstChild);ah.removeChild(ah.firstChild)}};L.fn.jqplot=function(){var ah=[];var aj=[];for(var ak=0,ai=arguments.length;ak<ai;ak++){if(L.isArray(arguments[ak])){ah.push(arguments[ak])}else{if(L.isPlainObject(arguments[ak])){aj.push(arguments[ak])}}}return this.each(function(an){var at,ar,aq=L(this),am=ah.length,al=aj.length,ap,ao;if(an<am){ap=ah[an]}else{ap=am?ah[am-1]:null}if(an<al){ao=aj[an]}else{ao=al?aj[al-1]:null}at=aq.attr("id");if(at===u){at="jqplot_target_"+L.jqplot.targetCounter++;aq.attr("id",at)}ar=L.jqplot(at,ap,ao);aq.data("jqplot",ar)})};L.jqplot=function(an,ak,ai){var aj=null,ah=null;if(arguments.length===3){aj=ak;ah=ai}else{if(arguments.length===2){if(L.isArray(ak)){aj=ak}else{if(L.isPlainObject(ak)){ah=ak}}}}if(aj===null&&ah!==null&&ah.data){aj=ah.data}var am=new R();L("#"+an).removeClass("jqplot-error");if(L.jqplot.config.catchErrors){try{am.init(an,aj,ah);am.draw();am.themeEngine.init.call(am);return am}catch(al){var ao=L.jqplot.config.errorMessage||al.message;L("#"+an).append('<div class="jqplot-error-message">'+ao+"</div>");L("#"+an).addClass("jqplot-error");document.getElementById(an).style.background=L.jqplot.config.errorBackground;document.getElementById(an).style.border=L.jqplot.config.errorBorder;document.getElementById(an).style.fontFamily=L.jqplot.config.errorFontFamily;document.getElementById(an).style.fontSize=L.jqplot.config.errorFontSize;document.getElementById(an).style.fontStyle=L.jqplot.config.errorFontStyle;document.getElementById(an).style.fontWeight=L.jqplot.config.errorFontWeight}}else{am.init(an,aj,ah);am.draw();am.themeEngine.init.call(am);return am}};L.jqplot.version="1.0.8";L.jqplot.revision="1250";L.jqplot.targetCounter=1;L.jqplot.CanvasManager=function(){if(typeof L.jqplot.CanvasManager.canvases=="undefined"){L.jqplot.CanvasManager.canvases=[];L.jqplot.CanvasManager.free=[]}var ah=[];this.getCanvas=function(){var ak;var aj=true;if(!L.jqplot.use_excanvas){for(var al=0,ai=L.jqplot.CanvasManager.canvases.length;al<ai;al++){if(L.jqplot.CanvasManager.free[al]===true){aj=false;ak=L.jqplot.CanvasManager.canvases[al];L.jqplot.CanvasManager.free[al]=false;ah.push(al);break}}}if(aj){ak=document.createElement("canvas");ah.push(L.jqplot.CanvasManager.canvases.length);L.jqplot.CanvasManager.canvases.push(ak);L.jqplot.CanvasManager.free.push(false)}return ak};this.initCanvas=function(ai){if(L.jqplot.use_excanvas){return window.G_vmlCanvasManager.initElement(ai)}return ai};this.freeAllCanvases=function(){for(var aj=0,ai=ah.length;aj<ai;aj++){this.freeCanvas(ah[aj])}ah=[]};this.freeCanvas=function(ai){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(L.jqplot.CanvasManager.canvases[ai]);L.jqplot.CanvasManager.canvases[ai]=null}else{var aj=L.jqplot.CanvasManager.canvases[ai];aj.getContext("2d").clearRect(0,0,aj.width,aj.height);L(aj).unbind().removeAttr("class").removeAttr("style");L(aj).css({left:"",top:"",position:""});aj.width=0;aj.height=0;L.jqplot.CanvasManager.free[ai]=true}}};L.jqplot.log=function(){if(window.console){window.console.log.apply(window.console,arguments)}};L.jqplot.config={addDomReference:false,enablePlugins:false,defaultHeight:300,defaultWidth:400,UTCAdjust:false,timezoneOffset:new Date(new Date().getTimezoneOffset()*60000),errorMessage:"",errorBackground:"",errorBorder:"",errorFontFamily:"",errorFontSize:"",errorFontStyle:"",errorFontWeight:"",catchErrors:false,defaultTickFormatString:"%.1f",defaultColors:["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"],defaultNegativeColors:["#498991","#C08840","#9F9274","#546D61","#646C4A","#6F6621","#6E3F5F","#4F64B0","#A89050","#C45923","#187399","#945381","#959E5C","#C7AF7B","#478396","#907294"],dashLength:4,gapLength:4,dotGapLength:2.5,srcLocation:"jqplot/src/",pluginLocation:"jqplot/src/plugins/"};L.jqplot.arrayMax=function(ah){return Math.max.apply(Math,ah)};L.jqplot.arrayMin=function(ah){return Math.min.apply(Math,ah)};L.jqplot.enablePlugins=L.jqplot.config.enablePlugins;L.jqplot.support_canvas=function(){if(typeof L.jqplot.support_canvas.result=="undefined"){L.jqplot.support_canvas.result=!!document.createElement("canvas").getContext}return L.jqplot.support_canvas.result};L.jqplot.support_canvas_text=function(){if(typeof L.jqplot.support_canvas_text.result=="undefined"){if(window.G_vmlCanvasManager!==u&&window.G_vmlCanvasManager._version>887){L.jqplot.support_canvas_text.result=true}else{L.jqplot.support_canvas_text.result=!!(document.createElement("canvas").getContext&&typeof document.createElement("canvas").getContext("2d").fillText=="function")}}return L.jqplot.support_canvas_text.result};L.jqplot.use_excanvas=((!L.support.boxModel||!L.support.objectAll||!$support.leadingWhitespace)&&!L.jqplot.support_canvas())?true:false;L.jqplot.preInitHooks=[];L.jqplot.postInitHooks=[];L.jqplot.preParseOptionsHooks=[];L.jqplot.postParseOptionsHooks=[];L.jqplot.preDrawHooks=[];L.jqplot.postDrawHooks=[];L.jqplot.preDrawSeriesHooks=[];L.jqplot.postDrawSeriesHooks=[];L.jqplot.preDrawLegendHooks=[];L.jqplot.addLegendRowHooks=[];L.jqplot.preSeriesInitHooks=[];L.jqplot.postSeriesInitHooks=[];L.jqplot.preParseSeriesOptionsHooks=[];L.jqplot.postParseSeriesOptionsHooks=[];L.jqplot.eventListenerHooks=[];L.jqplot.preDrawSeriesShadowHooks=[];L.jqplot.postDrawSeriesShadowHooks=[];L.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};L.jqplot.ElemContainer.prototype.createElement=function(ak,am,ai,aj,an){this._offsets=am;var ah=ai||"jqplot";var al=document.createElement(ak);this._elem=L(al);this._elem.addClass(ah);this._elem.css(aj);this._elem.attr(an);al=null;return this._elem};L.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};L.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};L.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};L.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};L.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};L.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};L.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function w(ah){L.jqplot.ElemContainer.call(this);this.name=ah;this._series=[];this.show=false;this.tickRenderer=L.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=L.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=L.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.drawMajorGridlines=true;this.drawMinorGridlines=false;this.drawMajorTickMarks=true;this.drawMinorTickMarks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this.scaleToHiddenSeries=false;this._dataBounds={min:null,max:null};this._intervalStats=[];this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null;this._options={}}w.prototype=new L.jqplot.ElemContainer();w.prototype.constructor=w;w.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.tickOptions.axis=this.name;if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTicks}if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTickMarks}if(this.tickOptions.showLabel==null){this.tickOptions.showLabel=this.showTicks}if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};w.prototype.draw=function(ah,ai){if(this.__ticks){this.__ticks=null}return this.renderer.draw.call(this,ah,ai)};w.prototype.set=function(){this.renderer.set.call(this)};w.prototype.pack=function(ai,ah){if(this.show){this.renderer.pack.call(this,ai,ah)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};w.prototype.reset=function(){this.renderer.reset.call(this)};w.prototype.resetScale=function(ah){L.extend(true,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},ah);this.resetDataBounds()};w.prototype.resetDataBounds=function(){var ao=this._dataBounds;ao.min=null;ao.max=null;var ai,ap,am;var aj=(this.show)?true:false;for(var al=0;al<this._series.length;al++){ap=this._series[al];if(ap.show||this.scaleToHiddenSeries){am=ap._plotData;if(ap._type==="line"&&ap.renderer.bands.show&&this.name.charAt(0)!=="x"){am=[[0,ap.renderer.bands._min],[1,ap.renderer.bands._max]]}var ah=1,an=1;if(ap._type!=null&&ap._type=="ohlc"){ah=3;an=2}for(var ak=0,ai=am.length;ak<ai;ak++){if(this.name=="xaxis"||this.name=="x2axis"){if((am[ak][0]!=null&&am[ak][0]<ao.min)||ao.min==null){ao.min=am[ak][0]}if((am[ak][0]!=null&&am[ak][0]>ao.max)||ao.max==null){ao.max=am[ak][0]}}else{if((am[ak][ah]!=null&&am[ak][ah]<ao.min)||ao.min==null){ao.min=am[ak][ah]}if((am[ak][an]!=null&&am[ak][an]>ao.max)||ao.max==null){ao.max=am[ak][an]}}}if(aj&&ap.renderer.constructor!==L.jqplot.BarRenderer){aj=false}else{if(aj&&this._options.hasOwnProperty("forceTickAt0")&&this._options.forceTickAt0==false){aj=false}else{if(aj&&ap.renderer.constructor===L.jqplot.BarRenderer){if(ap.barDirection=="vertical"&&this.name!="xaxis"&&this.name!="x2axis"){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}else{if(ap.barDirection=="horizontal"&&(this.name=="xaxis"||this.name=="x2axis")){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}}}}}}}if(aj&&this.renderer.constructor===L.jqplot.LinearAxisRenderer&&ao.min>=0){this.padMin=1;this.forceTickAt0=true}};function q(ah){L.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.labels=[];this.showLabels=true;this.showSwatches=true;this.placement="insideGrid";this.xoffset=0;this.yoffset=0;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=L.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.marginTop=null;this.marginRight=null;this.marginBottom=null;this.marginLeft=null;this.escapeHtml=false;this._series=[];L.extend(true,this,ah)}q.prototype=new L.jqplot.ElemContainer();q.prototype.constructor=q;q.prototype.setOptions=function(ah){L.extend(true,this,ah);if(this.placement=="inside"){this.placement="insideGrid"}if(this.xoffset>0){if(this.placement=="insideGrid"){switch(this.location){case"nw":case"w":case"sw":if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break;case"ne":case"e":case"se":default:if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break}}else{if(this.placement=="outside"){switch(this.location){case"nw":case"w":case"sw":if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break;case"ne":case"e":case"se":default:if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break}}}this.xoffset=0}if(this.yoffset>0){if(this.placement=="outside"){switch(this.location){case"sw":case"s":case"se":if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break;case"ne":case"n":case"nw":default:if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break}}else{if(this.placement=="insideGrid"){switch(this.location){case"sw":case"s":case"se":if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break;case"ne":case"n":case"nw":default:if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break}}}this.yoffset=0}};q.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};q.prototype.draw=function(ai,aj){for(var ah=0;ah<L.jqplot.preDrawLegendHooks.length;ah++){L.jqplot.preDrawLegendHooks[ah].call(this,ai)}return this.renderer.draw.call(this,ai,aj)};q.prototype.pack=function(ah){this.renderer.pack.call(this,ah)};function y(ah){L.jqplot.ElemContainer.call(this);this.text=ah;this.show=true;this.fontFamily;this.fontSize;this.textAlign;this.textColor;this.renderer=L.jqplot.DivTitleRenderer;this.rendererOptions={};this.escapeHtml=false}y.prototype=new L.jqplot.ElemContainer();y.prototype.constructor=y;y.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};y.prototype.draw=function(ah){return this.renderer.draw.call(this,ah)};y.prototype.pack=function(){this.renderer.pack.call(this)};function S(ah){ah=ah||{};L.jqplot.ElemContainer.call(this);this.show=true;this.xaxis="xaxis";this._xaxis;this.yaxis="yaxis";this._yaxis;this.gridBorderWidth=2;this.renderer=L.jqplot.LineRenderer;this.rendererOptions={};this.data=[];this.gridData=[];this.label="";this.showLabel=true;this.color;this.negativeColor;this.lineWidth=2.5;this.lineJoin="round";this.lineCap="round";this.linePattern="solid";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.25;this.shadowDepth=3;this.shadowAlpha="0.1";this.breakOnNull=false;this.markerRenderer=L.jqplot.MarkerRenderer;this.markerOptions={};this.showLine=true;this.showMarker=true;this.index;this.fill=false;this.fillColor;this.fillAlpha;this.fillAndStroke=false;this.disableStack=false;this._stack=false;this.neighborThreshold=4;this.fillToZero=false;this.fillToValue=0;this.fillAxis="y";this.useNegativeColors=true;this._stackData=[];this._plotData=[];this._plotValues={x:[],y:[]};this._intervals={x:{},y:{}};this._prevPlotData=[];this._prevGridData=[];this._stackAxis="y";this._primaryAxis="_xaxis";this.canvas=new L.jqplot.GenericCanvas();this.shadowCanvas=new L.jqplot.GenericCanvas();this.plugins={};this._sumy=0;this._sumx=0;this._type=""}S.prototype=new L.jqplot.ElemContainer();S.prototype.constructor=S;S.prototype.init=function(ak,ao,am){this.index=ak;this.gridBorderWidth=ao;var an=this.data;var aj=[],al,ah;for(al=0,ah=an.length;al<ah;al++){if(!this.breakOnNull){if(an[al]==null||an[al][0]==null||an[al][1]==null){continue}else{aj.push(an[al])}}else{aj.push(an[al])}}this.data=aj;if(!this.color){this.color=am.colorGenerator.get(this.index)}if(!this.negativeColor){this.negativeColor=am.negativeColorGenerator.get(this.index)}if(!this.fillColor){this.fillColor=this.color}if(this.fillAlpha){var ai=L.jqplot.normalize2rgb(this.fillColor);var ai=L.jqplot.getColorComponents(ai);this.fillColor="rgba("+ai[0]+","+ai[1]+","+ai[2]+","+this.fillAlpha+")"}if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions,am);this.markerRenderer=new this.markerRenderer();if(!this.markerOptions.color){this.markerOptions.color=this.color}if(this.markerOptions.show==null){this.markerOptions.show=this.showMarker}this.showMarker=this.markerOptions.show;this.markerRenderer.init(this.markerOptions)};S.prototype.draw=function(an,ak,am){var ai=(ak==u)?{}:ak;an=(an==u)?this.canvas._ctx:an;var ah,al,aj;for(ah=0;ah<L.jqplot.preDrawSeriesHooks.length;ah++){L.jqplot.preDrawSeriesHooks[ah].call(this,an,ai)}if(this.show){this.renderer.setGridData.call(this,am);if(!ai.preventJqPlotSeriesDrawTrigger){L(an.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData])}al=[];if(ai.data){al=ai.data}else{if(!this._stack){al=this.data}else{al=this._plotData}}aj=ai.gridData||this.renderer.makeGridData.call(this,al,am);if(this._type==="line"&&this.renderer.smooth&&this.renderer._smoothedData.length){aj=this.renderer._smoothedData}this.renderer.draw.call(this,an,aj,ai,am)}for(ah=0;ah<L.jqplot.postDrawSeriesHooks.length;ah++){L.jqplot.postDrawSeriesHooks[ah].call(this,an,ai,am)}an=ak=am=ah=al=aj=null};S.prototype.drawShadow=function(an,ak,am){var ai=(ak==u)?{}:ak;an=(an==u)?this.shadowCanvas._ctx:an;var ah,al,aj;for(ah=0;ah<L.jqplot.preDrawSeriesShadowHooks.length;ah++){L.jqplot.preDrawSeriesShadowHooks[ah].call(this,an,ai)}if(this.shadow){this.renderer.setGridData.call(this,am);al=[];if(ai.data){al=ai.data}else{if(!this._stack){al=this.data}else{al=this._plotData}}aj=ai.gridData||this.renderer.makeGridData.call(this,al,am);this.renderer.drawShadow.call(this,an,aj,ai,am)}for(ah=0;ah<L.jqplot.postDrawSeriesShadowHooks.length;ah++){L.jqplot.postDrawSeriesShadowHooks[ah].call(this,an,ai)}an=ak=am=ah=al=aj=null};S.prototype.toggleDisplay=function(ai,ak){var ah,aj;if(ai.data.series){ah=ai.data.series}else{ah=this}if(ai.data.speed){aj=ai.data.speed}if(aj){if(ah.canvas._elem.is(":hidden")||!ah.show){ah.show=true;ah.canvas._elem.removeClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.fadeIn(aj)}ah.canvas._elem.fadeIn(aj,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).fadeIn(aj)}else{ah.show=false;ah.canvas._elem.addClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.fadeOut(aj)}ah.canvas._elem.fadeOut(aj,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).fadeOut(aj)}}else{if(ah.canvas._elem.is(":hidden")||!ah.show){ah.show=true;ah.canvas._elem.removeClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.show()}ah.canvas._elem.show(0,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).show()}else{ah.show=false;ah.canvas._elem.addClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.hide()}ah.canvas._elem.hide(0,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).hide()}}};function M(){L.jqplot.ElemContainer.call(this);this.drawGridlines=true;this.gridLineColor="#cccccc";this.gridLineWidth=1;this.background="#fffdf6";this.borderColor="#999999";this.borderWidth=2;this.drawBorder=true;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.5;this.shadowWidth=3;this.shadowDepth=3;this.shadowColor=null;this.shadowAlpha="0.07";this._left;this._top;this._right;this._bottom;this._width;this._height;this._axes=[];this.renderer=L.jqplot.CanvasGridRenderer;this.rendererOptions={};this._offsets={top:null,bottom:null,left:null,right:null}}M.prototype=new L.jqplot.ElemContainer();M.prototype.constructor=M;M.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};M.prototype.createElement=function(ah,ai){this._offsets=ah;return this.renderer.createElement.call(this,ai)};M.prototype.draw=function(){this.renderer.draw.call(this)};L.jqplot.GenericCanvas=function(){L.jqplot.ElemContainer.call(this);this._ctx};L.jqplot.GenericCanvas.prototype=new L.jqplot.ElemContainer();L.jqplot.GenericCanvas.prototype.constructor=L.jqplot.GenericCanvas;L.jqplot.GenericCanvas.prototype.createElement=function(al,aj,ai,am){this._offsets=al;var ah="jqplot";if(aj!=u){ah=aj}var ak;ak=am.canvasManager.getCanvas();if(ai!=null){this._plotDimensions=ai}ak.width=this._plotDimensions.width-this._offsets.left-this._offsets.right;ak.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom;this._elem=L(ak);this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top});this._elem.addClass(ah);ak=am.canvasManager.initCanvas(ak);ak=null;return this._elem};L.jqplot.GenericCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};L.jqplot.GenericCanvas.prototype.resetCanvas=function(){if(this._elem){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce()}this._ctx=null};L.jqplot.HooksManager=function(){this.hooks=[];this.args=[]};L.jqplot.HooksManager.prototype.addOnce=function(ak,ai){ai=ai||[];var al=false;for(var aj=0,ah=this.hooks.length;aj<ah;aj++){if(this.hooks[aj]==ak){al=true}}if(!al){this.hooks.push(ak);this.args.push(ai)}};L.jqplot.HooksManager.prototype.add=function(ai,ah){ah=ah||[];this.hooks.push(ai);this.args.push(ah)};L.jqplot.EventListenerManager=function(){this.hooks=[]};L.jqplot.EventListenerManager.prototype.addOnce=function(al,ak){var am=false,aj,ai;for(var ai=0,ah=this.hooks.length;ai<ah;ai++){aj=this.hooks[ai];if(aj[0]==al&&aj[1]==ak){am=true}}if(!am){this.hooks.push([al,ak])}};L.jqplot.EventListenerManager.prototype.add=function(ai,ah){this.hooks.push([ai,ah])};var U=["yMidAxis","xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];function R(){this.animate=false;this.animateReplot=false;this.axes={xaxis:new w("xaxis"),yaxis:new w("yaxis"),x2axis:new w("x2axis"),y2axis:new w("y2axis"),y3axis:new w("y3axis"),y4axis:new w("y4axis"),y5axis:new w("y5axis"),y6axis:new w("y6axis"),y7axis:new w("y7axis"),y8axis:new w("y8axis"),y9axis:new w("y9axis"),yMidAxis:new w("yMidAxis")};this.baseCanvas=new L.jqplot.GenericCanvas();this.captureRightClick=false;this.data=[];this.dataRenderer;this.dataRendererOptions;this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{},yMidAxis:{}},seriesDefaults:{},series:[]};this.defaultAxisStart=1;this.drawIfHidden=false;this.eventCanvas=new L.jqplot.GenericCanvas();this.fillBetween={series1:null,series2:null,color:null,baseSeries:0,fill:true};this.fontFamily;this.fontSize;this.grid=new M();this.legend=new q();this.noDataIndicator={show:false,indicator:"Loading Data...",axes:{xaxis:{min:0,max:10,tickInterval:2,show:true},yaxis:{min:0,max:12,tickInterval:3,show:true}}};this.negativeSeriesColors=L.jqplot.config.defaultNegativeColors;this.options={};this.previousSeriesStack=[];this.plugins={};this.series=[];this.seriesStack=[];this.seriesColors=L.jqplot.config.defaultColors;this.sortData=true;this.stackSeries=false;this.syncXTicks=true;this.syncYTicks=true;this.target=null;this.targetId=null;this.textColor;this.title=new y();this._drawCount=0;this._sumy=0;this._sumx=0;this._stackData=[];this._plotData=[];this._width=null;this._height=null;this._plotDimensions={height:null,width:null};this._gridPadding={top:null,right:null,bottom:null,left:null};this._defaultGridPadding={top:10,right:10,bottom:23,left:10};this._addDomReference=L.jqplot.config.addDomReference;this.preInitHooks=new L.jqplot.HooksManager();this.postInitHooks=new L.jqplot.HooksManager();this.preParseOptionsHooks=new L.jqplot.HooksManager();this.postParseOptionsHooks=new L.jqplot.HooksManager();this.preDrawHooks=new L.jqplot.HooksManager();this.postDrawHooks=new L.jqplot.HooksManager();this.preDrawSeriesHooks=new L.jqplot.HooksManager();this.postDrawSeriesHooks=new L.jqplot.HooksManager();this.preDrawLegendHooks=new L.jqplot.HooksManager();this.addLegendRowHooks=new L.jqplot.HooksManager();this.preSeriesInitHooks=new L.jqplot.HooksManager();this.postSeriesInitHooks=new L.jqplot.HooksManager();this.preParseSeriesOptionsHooks=new L.jqplot.HooksManager();this.postParseSeriesOptionsHooks=new L.jqplot.HooksManager();this.eventListenerHooks=new L.jqplot.EventListenerManager();this.preDrawSeriesShadowHooks=new L.jqplot.HooksManager();this.postDrawSeriesShadowHooks=new L.jqplot.HooksManager();this.colorGenerator=new L.jqplot.ColorGenerator();this.negativeColorGenerator=new L.jqplot.ColorGenerator();this.canvasManager=new L.jqplot.CanvasManager();this.themeEngine=new L.jqplot.ThemeEngine();var aj=0;this.init=function(av,ar,ay){ay=ay||{};for(var at=0;at<L.jqplot.preInitHooks.length;at++){L.jqplot.preInitHooks[at].call(this,av,ar,ay)}for(var at=0;at<this.preInitHooks.hooks.length;at++){this.preInitHooks.hooks[at].call(this,av,ar,ay)}this.targetId="#"+av;this.target=L("#"+av);if(this._addDomReference){this.target.data("jqplot",this)}this.target.removeClass("jqplot-error");if(!this.target.get(0)){throw new Error("No plot target specified")}if(this.target.css("position")=="static"){this.target.css("position","relative")}if(!this.target.hasClass("jqplot-target")){this.target.addClass("jqplot-target")}if(!this.target.height()){var au;if(ay&&ay.height){au=parseInt(ay.height,10)}else{if(this.target.attr("data-height")){au=parseInt(this.target.attr("data-height"),10)}else{au=parseInt(L.jqplot.config.defaultHeight,10)}}this._height=au;this.target.css("height",au+"px")}else{this._height=au=this.target.height()}if(!this.target.width()){var aw;if(ay&&ay.width){aw=parseInt(ay.width,10)}else{if(this.target.attr("data-width")){aw=parseInt(this.target.attr("data-width"),10)}else{aw=parseInt(L.jqplot.config.defaultWidth,10)}}this._width=aw;this.target.css("width",aw+"px")}else{this._width=aw=this.target.width()}for(var at=0,ap=U.length;at<ap;at++){this.axes[U[at]]=new w(U[at])}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;if(this._height<=0||this._width<=0||!this._height||!this._width){throw new Error("Canvas dimension not set")}if(ay.dataRenderer&&L.isFunction(ay.dataRenderer)){if(ay.dataRendererOptions){this.dataRendererOptions=ay.dataRendererOptions}this.dataRenderer=ay.dataRenderer;ar=this.dataRenderer(ar,this,this.dataRendererOptions)}if(ay.noDataIndicator&&L.isPlainObject(ay.noDataIndicator)){L.extend(true,this.noDataIndicator,ay.noDataIndicator)}if(ar==null||L.isArray(ar)==false||ar.length==0||L.isArray(ar[0])==false||ar[0].length==0){if(this.noDataIndicator.show==false){throw new Error("No data specified")}else{for(var al in this.noDataIndicator.axes){for(var an in this.noDataIndicator.axes[al]){this.axes[al][an]=this.noDataIndicator.axes[al][an]}}this.postDrawHooks.add(function(){var aD=this.eventCanvas.getHeight();var aA=this.eventCanvas.getWidth();var az=L('<div class="jqplot-noData-container" style="position:absolute;"></div>');this.target.append(az);az.height(aD);az.width(aA);az.css("top",this.eventCanvas._offsets.top);az.css("left",this.eventCanvas._offsets.left);var aC=L('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');az.append(aC);aC.html(this.noDataIndicator.indicator);var aB=aC.height();var ax=aC.width();aC.height(aB);aC.width(ax);aC.css("top",(aD-aB)/2+"px")})}}this.data=L.extend(true,[],ar);this.parseOptions(ay);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;this.computePlotData();for(var at=0;at<this.series.length;at++){this.seriesStack.push(at);this.previousSeriesStack.push(at);this.series[at].shadowCanvas._plotDimensions=this._plotDimensions;this.series[at].canvas._plotDimensions=this._plotDimensions;for(var aq=0;aq<L.jqplot.preSeriesInitHooks.length;aq++){L.jqplot.preSeriesInitHooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}for(var aq=0;aq<this.preSeriesInitHooks.hooks.length;aq++){this.preSeriesInitHooks.hooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}this.series[at]._plotDimensions=this._plotDimensions;this.series[at].init(at,this.grid.borderWidth,this);for(var aq=0;aq<L.jqplot.postSeriesInitHooks.length;aq++){L.jqplot.postSeriesInitHooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}for(var aq=0;aq<this.postSeriesInitHooks.hooks.length;aq++){this.postSeriesInitHooks.hooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}this._sumy+=this.series[at]._sumy;this._sumx+=this.series[at]._sumx}var am,ao;for(var at=0,ap=U.length;at<ap;at++){am=U[at];ao=this.axes[am];ao._plotDimensions=this._plotDimensions;ao.init();if(this.axes[am].borderColor==null){if(am.charAt(0)!=="x"&&ao.useSeriesColor===true&&ao.show){ao.borderColor=ao._series[0].color}else{ao.borderColor=this.grid.borderColor}}}if(this.sortData){ah(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var at=0;at<L.jqplot.postInitHooks.length;at++){L.jqplot.postInitHooks[at].call(this,av,this.data,ay)}for(var at=0;at<this.postInitHooks.hooks.length;at++){this.postInitHooks.hooks[at].call(this,av,this.data,ay)}};this.resetAxesScale=function(aq,am){var ao=am||{};var ap=aq||this.axes;if(ap===true){ap=this.axes}if(L.isArray(ap)){for(var an=0;an<ap.length;an++){this.axes[ap[an]].resetScale(ao[ap[an]])}}else{if(typeof(ap)==="object"){for(var al in ap){this.axes[al].resetScale(ao[al])}}}};this.reInitialize=function(au,al){var ay=L.extend(true,{},this.options,al);var aw=this.targetId.substr(1);var ar=(au==null)?this.data:au;for(var av=0;av<L.jqplot.preInitHooks.length;av++){L.jqplot.preInitHooks[av].call(this,aw,ar,ay)}for(var av=0;av<this.preInitHooks.hooks.length;av++){this.preInitHooks.hooks[av].call(this,aw,ar,ay)}this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw new Error("Target dimension not set")}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;var am,ax,at,ao;for(var av=0,aq=U.length;av<aq;av++){am=U[av];ao=this.axes[am];ax=ao._ticks;for(var at=0,ap=ax.length;at<ap;at++){var an=ax[at]._elem;if(an){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(an.get(0))}an.emptyForce();an=null;ax._elem=null}}ax=null;delete ao.ticks;delete ao._ticks;this.axes[am]=new w(am);this.axes[am]._plotWidth=this._width;this.axes[am]._plotHeight=this._height}if(au){if(ay.dataRenderer&&L.isFunction(ay.dataRenderer)){if(ay.dataRendererOptions){this.dataRendererOptions=ay.dataRendererOptions}this.dataRenderer=ay.dataRenderer;au=this.dataRenderer(au,this,this.dataRendererOptions)}this.data=L.extend(true,[],au)}if(al){this.parseOptions(ay)}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;this.seriesStack=[];this.previousSeriesStack=[];this.computePlotData();for(var av=0,aq=this.series.length;av<aq;av++){this.seriesStack.push(av);this.previousSeriesStack.push(av);this.series[av].shadowCanvas._plotDimensions=this._plotDimensions;this.series[av].canvas._plotDimensions=this._plotDimensions;for(var at=0;at<L.jqplot.preSeriesInitHooks.length;at++){L.jqplot.preSeriesInitHooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}for(var at=0;at<this.preSeriesInitHooks.hooks.length;at++){this.preSeriesInitHooks.hooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}this.series[av]._plotDimensions=this._plotDimensions;this.series[av].init(av,this.grid.borderWidth,this);for(var at=0;at<L.jqplot.postSeriesInitHooks.length;at++){L.jqplot.postSeriesInitHooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}for(var at=0;at<this.postSeriesInitHooks.hooks.length;at++){this.postSeriesInitHooks.hooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}this._sumy+=this.series[av]._sumy;this._sumx+=this.series[av]._sumx}for(var av=0,aq=U.length;av<aq;av++){am=U[av];ao=this.axes[am];ao._plotDimensions=this._plotDimensions;ao.init();if(ao.borderColor==null){if(am.charAt(0)!=="x"&&ao.useSeriesColor===true&&ao.show){ao.borderColor=ao._series[0].color}else{ao.borderColor=this.grid.borderColor}}}if(this.sortData){ah(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var av=0,aq=L.jqplot.postInitHooks.length;av<aq;av++){L.jqplot.postInitHooks[av].call(this,aw,this.data,ay)}for(var av=0,aq=this.postInitHooks.hooks.length;av<aq;av++){this.postInitHooks.hooks[av].call(this,aw,this.data,ay)}};this.quickInit=function(){this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw new Error("Target dimension not set")}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;for(var aq in this.axes){this.axes[aq]._plotWidth=this._width;this.axes[aq]._plotHeight=this._height}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this._sumy=0;this._sumx=0;this.computePlotData();for(var ao=0;ao<this.series.length;ao++){if(this.series[ao]._type==="line"&&this.series[ao].renderer.bands.show){this.series[ao].renderer.initBands.call(this.series[ao],this.series[ao].renderer.options,this)}this.series[ao]._plotDimensions=this._plotDimensions;this.series[ao].canvas._plotDimensions=this._plotDimensions;this._sumy+=this.series[ao]._sumy;this._sumx+=this.series[ao]._sumx}var am;for(var al=0;al<12;al++){am=U[al];var an=this.axes[am]._ticks;for(var ao=0;ao<an.length;ao++){var ap=an[ao]._elem;if(ap){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(ap.get(0))}ap.emptyForce();ap=null;an._elem=null}}an=null;this.axes[am]._plotDimensions=this._plotDimensions;this.axes[am]._ticks=[]}if(this.sortData){ah(this.series)}this.grid._axes=this.axes;this.legend._series=this.series};function ah(ap){var au,av,aw,al,at;for(var aq=0;aq<ap.length;aq++){var am;var ar=[ap[aq].data,ap[aq]._stackData,ap[aq]._plotData,ap[aq]._prevPlotData];for(var an=0;an<4;an++){am=true;au=ar[an];if(ap[aq]._stackAxis=="x"){for(var ao=0;ao<au.length;ao++){if(typeof(au[ao][1])!="number"){am=false;break}}if(am){au.sort(function(ay,ax){return ay[1]-ax[1]})}}else{for(var ao=0;ao<au.length;ao++){if(typeof(au[ao][0])!="number"){am=false;break}}if(am){au.sort(function(ay,ax){return ay[0]-ax[0]})}}}}}this.computePlotData=function(){this._plotData=[];this._stackData=[];var at,au,ao;for(au=0,ao=this.series.length;au<ao;au++){at=this.series[au];this._plotData.push([]);this._stackData.push([]);var am=at.data;this._plotData[au]=L.extend(true,[],am);this._stackData[au]=L.extend(true,[],am);at._plotData=this._plotData[au];at._stackData=this._stackData[au];var ax={x:[],y:[]};if(this.stackSeries&&!at.disableStack){at._stack=true;var av=(at._stackAxis==="x")?0:1;for(var ap=0,al=am.length;ap<al;ap++){var aw=am[ap][av];if(aw==null){aw=0}this._plotData[au][ap][av]=aw;this._stackData[au][ap][av]=aw;if(au>0){for(var aq=au;aq--;){var an=this._plotData[aq][ap][av];if(aw*an>=0){this._plotData[au][ap][av]+=an;this._stackData[au][ap][av]+=an;break}}}}}else{for(var ar=0;ar<at.data.length;ar++){ax.x.push(at.data[ar][0]);ax.y.push(at.data[ar][1])}this._stackData.push(at.data);this.series[au]._stackData=at.data;this._plotData.push(at.data);at._plotData=at.data;at._plotValues=ax}if(au>0){at._prevPlotData=this.series[au-1]._plotData}at._sumy=0;at._sumx=0;for(ar=at.data.length-1;ar>-1;ar--){at._sumy+=at.data[ar][1];at._sumx+=at.data[ar][0]}}};this.populatePlotData=function(au,av){this._plotData=[];this._stackData=[];au._stackData=[];au._plotData=[];var ay={x:[],y:[]};if(this.stackSeries&&!au.disableStack){au._stack=true;var ax=(au._stackAxis==="x")?0:1;var az=L.extend(true,[],au.data);var aA=L.extend(true,[],au.data);var an,am,ao,aw,al;for(var ar=0;ar<av;ar++){var ap=this.series[ar].data;for(var aq=0;aq<ap.length;aq++){ao=ap[aq];an=(ao[0]!=null)?ao[0]:0;am=(ao[1]!=null)?ao[1]:0;az[aq][0]+=an;az[aq][1]+=am;aw=(ax)?am:an;if(au.data[aq][ax]*aw>=0){aA[aq][ax]+=aw}}}for(var at=0;at<aA.length;at++){ay.x.push(aA[at][0]);ay.y.push(aA[at][1])}this._plotData.push(aA);this._stackData.push(az);au._stackData=az;au._plotData=aA;au._plotValues=ay}else{for(var at=0;at<au.data.length;at++){ay.x.push(au.data[at][0]);ay.y.push(au.data[at][1])}this._stackData.push(au.data);this.series[av]._stackData=au.data;this._plotData.push(au.data);au._plotData=au.data;au._plotValues=ay}if(av>0){au._prevPlotData=this.series[av-1]._plotData}au._sumy=0;au._sumx=0;for(at=au.data.length-1;at>-1;at--){au._sumy+=au.data[at][1];au._sumx+=au.data[at][0]}};this.getNextSeriesColor=(function(am){var al=0;var an=am.seriesColors;return function(){if(al<an.length){return an[al++]}else{al=0;return an[al++]}}})(this);this.parseOptions=function(ay){for(var at=0;at<this.preParseOptionsHooks.hooks.length;at++){this.preParseOptionsHooks.hooks[at].call(this,ay)}for(var at=0;at<L.jqplot.preParseOptionsHooks.length;at++){L.jqplot.preParseOptionsHooks[at].call(this,ay)}this.options=L.extend(true,{},this.defaults,ay);var am=this.options;this.animate=am.animate;this.animateReplot=am.animateReplot;this.stackSeries=am.stackSeries;if(L.isPlainObject(am.fillBetween)){var ax=["series1","series2","color","baseSeries","fill"],au;for(var at=0,aq=ax.length;at<aq;at++){au=ax[at];if(am.fillBetween[au]!=null){this.fillBetween[au]=am.fillBetween[au]}}}if(am.seriesColors){this.seriesColors=am.seriesColors}if(am.negativeSeriesColors){this.negativeSeriesColors=am.negativeSeriesColors}if(am.captureRightClick){this.captureRightClick=am.captureRightClick}this.defaultAxisStart=(ay&&ay.defaultAxisStart!=null)?ay.defaultAxisStart:this.defaultAxisStart;this.colorGenerator.setColors(this.seriesColors);this.negativeColorGenerator.setColors(this.negativeSeriesColors);L.extend(true,this._gridPadding,am.gridPadding);this.sortData=(am.sortData!=null)?am.sortData:this.sortData;for(var at=0;at<12;at++){var an=U[at];var ap=this.axes[an];ap._options=L.extend(true,{},am.axesDefaults,am.axes[an]);L.extend(true,ap,am.axesDefaults,am.axes[an]);ap._plotWidth=this._width;ap._plotHeight=this._height}var aw=function(aD,aB,aE){var aA=[];var aC,az;aB=aB||"vertical";if(!L.isArray(aD[0])){for(aC=0,az=aD.length;aC<az;aC++){if(aB=="vertical"){aA.push([aE+aC,aD[aC]])}else{aA.push([aD[aC],aE+aC])}}}else{L.extend(true,aA,aD)}return aA};var av=0;this.series=[];for(var at=0;at<this.data.length;at++){var al=L.extend(true,{index:at},{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[at],{rendererOptions:{animation:{show:this.animate}}});var ax=new S(al);for(var ar=0;ar<L.jqplot.preParseSeriesOptionsHooks.length;ar++){L.jqplot.preParseSeriesOptionsHooks[ar].call(ax,this.options.seriesDefaults,this.options.series[at])}for(var ar=0;ar<this.preParseSeriesOptionsHooks.hooks.length;ar++){this.preParseSeriesOptionsHooks.hooks[ar].call(ax,this.options.seriesDefaults,this.options.series[at])}L.extend(true,ax,al);var ao="vertical";if(ax.renderer===L.jqplot.BarRenderer&&ax.rendererOptions&&ax.rendererOptions.barDirection=="horizontal"){ao="horizontal";ax._stackAxis="x";ax._primaryAxis="_yaxis"}ax.data=aw(this.data[at],ao,this.defaultAxisStart);switch(ax.xaxis){case"xaxis":ax._xaxis=this.axes.xaxis;break;case"x2axis":ax._xaxis=this.axes.x2axis;break;default:break}ax._yaxis=this.axes[ax.yaxis];ax._xaxis._series.push(ax);ax._yaxis._series.push(ax);if(ax.show){ax._xaxis.show=true;ax._yaxis.show=true}else{if(ax._xaxis.scaleToHiddenSeries){ax._xaxis.show=true}if(ax._yaxis.scaleToHiddenSeries){ax._yaxis.show=true}}if(!ax.label){ax.label="Series "+(at+1).toString()}this.series.push(ax);for(var ar=0;ar<L.jqplot.postParseSeriesOptionsHooks.length;ar++){L.jqplot.postParseSeriesOptionsHooks[ar].call(this.series[at],this.options.seriesDefaults,this.options.series[at])}for(var ar=0;ar<this.postParseSeriesOptionsHooks.hooks.length;ar++){this.postParseSeriesOptionsHooks.hooks[ar].call(this.series[at],this.options.seriesDefaults,this.options.series[at])}}L.extend(true,this.grid,this.options.grid);for(var at=0,aq=U.length;at<aq;at++){var an=U[at];var ap=this.axes[an];if(ap.borderWidth==null){ap.borderWidth=this.grid.borderWidth}}if(typeof this.options.title=="string"){this.title.text=this.options.title}else{if(typeof this.options.title=="object"){L.extend(true,this.title,this.options.title)}}this.title._plotWidth=this._width;this.legend.setOptions(this.options.legend);for(var at=0;at<L.jqplot.postParseOptionsHooks.length;at++){L.jqplot.postParseOptionsHooks[at].call(this,ay)}for(var at=0;at<this.postParseOptionsHooks.hooks.length;at++){this.postParseOptionsHooks.hooks[at].call(this,ay)}};this.destroy=function(){this.canvasManager.freeAllCanvases();if(this.eventCanvas&&this.eventCanvas._elem){this.eventCanvas._elem.unbind()}this.target.empty();this.target[0].innerHTML=""};this.replot=function(am){var an=am||{};var ap=an.data||null;var al=(an.clear===false)?false:true;var ao=an.resetAxes||false;delete an.data;delete an.clear;delete an.resetAxes;this.target.trigger("jqplotPreReplot");if(al){this.destroy()}if(ap||!L.isEmptyObject(an)){this.reInitialize(ap,an)}else{this.quickInit()}if(ao){this.resetAxesScale(ao,an.axes)}this.draw();this.target.trigger("jqplotPostReplot")};this.redraw=function(al){al=(al!=null)?al:true;this.target.trigger("jqplotPreRedraw");if(al){this.canvasManager.freeAllCanvases();this.eventCanvas._elem.unbind();this.target.empty()}for(var an in this.axes){this.axes[an]._ticks=[]}this.computePlotData();this._sumy=0;this._sumx=0;for(var am=0,ao=this.series.length;am<ao;am++){this._sumy+=this.series[am]._sumy;this._sumx+=this.series[am]._sumx}this.draw();this.target.trigger("jqplotPostRedraw")};this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var aH,aF,aE,ao;for(aH=0,aE=L.jqplot.preDrawHooks.length;aH<aE;aH++){L.jqplot.preDrawHooks[aH].call(this)}for(aH=0,aE=this.preDrawHooks.hooks.length;aH<aE;aH++){this.preDrawHooks.hooks[aH].apply(this,this.preDrawSeriesHooks.args[aH])}this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas",null,this));this.baseCanvas.setContext();this.target.append(this.title.draw());this.title.pack({top:0,left:0});var aL=this.legend.draw({},this);var al={top:0,left:0,bottom:0,right:0};if(this.legend.placement=="outsideGrid"){this.target.append(aL);switch(this.legend.location){case"n":al.top+=this.legend.getHeight();break;case"s":al.bottom+=this.legend.getHeight();break;case"ne":case"e":case"se":al.right+=this.legend.getWidth();break;case"nw":case"w":case"sw":al.left+=this.legend.getWidth();break;default:al.right+=this.legend.getWidth();break}aL=aL.detach()}var ar=this.axes;var aM;for(aH=0;aH<12;aH++){aM=U[aH];this.target.append(ar[aM].draw(this.baseCanvas._ctx,this));ar[aM].set()}if(ar.yaxis.show){al.left+=ar.yaxis.getWidth()}var aG=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var az=[0,0,0,0,0,0,0,0];var aC=0;var aB;for(aB=0;aB<8;aB++){if(ar[aG[aB]].show){aC+=ar[aG[aB]].getWidth();az[aB]=aC}}al.right+=aC;if(ar.x2axis.show){al.top+=ar.x2axis.getHeight()}if(this.title.show){al.top+=this.title.getHeight()}if(ar.xaxis.show){al.bottom+=ar.xaxis.getHeight()}if(this.options.gridDimensions&&L.isPlainObject(this.options.gridDimensions)){var at=parseInt(this.options.gridDimensions.width,10)||0;var aI=parseInt(this.options.gridDimensions.height,10)||0;var an=(this._width-al.left-al.right-at)/2;var aK=(this._height-al.top-al.bottom-aI)/2;if(aK>=0&&an>=0){al.top+=aK;al.bottom+=aK;al.left+=an;al.right+=an}}var am=["top","bottom","left","right"];for(var aB in am){if(this._gridPadding[am[aB]]==null&&al[am[aB]]>0){this._gridPadding[am[aB]]=al[am[aB]]}else{if(this._gridPadding[am[aB]]==null){this._gridPadding[am[aB]]=this._defaultGridPadding[am[aB]]}}}var aA=this._gridPadding;if(this.legend.placement==="outsideGrid"){aA={top:this.title.getHeight(),left:0,right:0,bottom:0};if(this.legend.location==="s"){aA.left=this._gridPadding.left;aA.right=this._gridPadding.right}}ar.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-ar.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});ar.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-ar.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});ar.x2axis.pack({position:"absolute",top:this._gridPadding.top-ar.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(aH=8;aH>0;aH--){ar[aG[aH-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-az[aH-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}var au=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-ar.yMidAxis.getWidth()/2;ar.yMidAxis.pack({position:"absolute",top:0,left:au,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.target.append(this.grid.createElement(this._gridPadding,this));this.grid.draw();var aq=this.series;var aJ=aq.length;for(aH=0,aE=aJ;aH<aE;aH++){aF=this.seriesStack[aH];this.target.append(aq[aF].shadowCanvas.createElement(this._gridPadding,"jqplot-series-shadowCanvas",null,this));aq[aF].shadowCanvas.setContext();aq[aF].shadowCanvas._elem.data("seriesIndex",aF)}for(aH=0,aE=aJ;aH<aE;aH++){aF=this.seriesStack[aH];this.target.append(aq[aF].canvas.createElement(this._gridPadding,"jqplot-series-canvas",null,this));aq[aF].canvas.setContext();aq[aF].canvas._elem.data("seriesIndex",aF)}this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas",null,this));this.eventCanvas.setContext();this.eventCanvas._ctx.fillStyle="rgba(0,0,0,0)";this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width,this.eventCanvas._ctx.canvas.height);this.bindCustomEvents();if(this.legend.preDraw){this.eventCanvas._elem.before(aL);this.legend.pack(aA);if(this.legend._elem){this.drawSeries({legendInfo:{location:this.legend.location,placement:this.legend.placement,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}})}else{this.drawSeries()}}else{this.drawSeries();if(aJ){L(aq[aJ-1].canvas._elem).after(aL)}this.legend.pack(aA)}for(var aH=0,aE=L.jqplot.eventListenerHooks.length;aH<aE;aH++){this.eventCanvas._elem.bind(L.jqplot.eventListenerHooks[aH][0],{plot:this},L.jqplot.eventListenerHooks[aH][1])}for(var aH=0,aE=this.eventListenerHooks.hooks.length;aH<aE;aH++){this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[aH][0],{plot:this},this.eventListenerHooks.hooks[aH][1])}var ay=this.fillBetween;if(ay.fill&&ay.series1!==ay.series2&&ay.series1<aJ&&ay.series2<aJ&&aq[ay.series1]._type==="line"&&aq[ay.series2]._type==="line"){this.doFillBetweenLines()}for(var aH=0,aE=L.jqplot.postDrawHooks.length;aH<aE;aH++){L.jqplot.postDrawHooks[aH].call(this)}for(var aH=0,aE=this.postDrawHooks.hooks.length;aH<aE;aH++){this.postDrawHooks.hooks[aH].apply(this,this.postDrawHooks.args[aH])}if(this.target.is(":visible")){this._drawCount+=1}var av,aw,aD,ap;for(aH=0,aE=aJ;aH<aE;aH++){av=aq[aH];aw=av.renderer;aD=".jqplot-point-label.jqplot-series-"+aH;if(aw.animation&&aw.animation._supported&&aw.animation.show&&(this._drawCount<2||this.animateReplot)){ap=this.target.find(aD);ap.stop(true,true).hide();av.canvas._elem.stop(true,true).hide();av.shadowCanvas._elem.stop(true,true).hide();av.canvas._elem.jqplotEffect("blind",{mode:"show",direction:aw.animation.direction},aw.animation.speed);av.shadowCanvas._elem.jqplotEffect("blind",{mode:"show",direction:aw.animation.direction},aw.animation.speed);ap.fadeIn(aw.animation.speed*0.8)}}ap=null;this.target.trigger("jqplotPostDraw",[this])}};R.prototype.doFillBetweenLines=function(){var an=this.fillBetween;var ax=an.series1;var av=an.series2;var aw=(ax<av)?ax:av;var au=(av>ax)?av:ax;var ar=this.series[aw];var aq=this.series[au];if(aq.renderer.smooth){var ap=aq.renderer._smoothedData.slice(0).reverse()}else{var ap=aq.gridData.slice(0).reverse()}if(ar.renderer.smooth){var at=ar.renderer._smoothedData.concat(ap)}else{var at=ar.gridData.concat(ap)}var ao=(an.color!==null)?an.color:this.series[ax].fillColor;var ay=(an.baseSeries!==null)?an.baseSeries:aw;var am=this.series[ay].renderer.shapeRenderer;var al={fillStyle:ao,fill:true,closePath:true};am.draw(ar.shadowCanvas._ctx,at,al)};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave);if(this.captureRightClick){this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)}};function ai(av){var au=av.data.plot;var ap=au.eventCanvas._elem.offset();var at={x:av.pageX-ap.left,y:av.pageY-ap.top};var aq={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null};var ar=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];var al=au.axes;var am,ao;for(am=11;am>0;am--){ao=ar[am-1];if(al[ao].show){aq[ao]=al[ao].series_p2u(at[ao.charAt(0)])}}return{offsets:ap,gridPos:at,dataPos:aq}}function ak(al,am){var aq=am.series;var aW,aU,aT,aO,aP,aJ,aI,aw,au,az,aA,aK;var aS,aX,aQ,ar,aH,aM,aV;var an,aN;for(aT=am.seriesStack.length-1;aT>=0;aT--){aW=am.seriesStack[aT];aO=aq[aW];aV=aO._highlightThreshold;switch(aO.renderer.constructor){case L.jqplot.BarRenderer:aJ=al.x;aI=al.y;for(aU=0;aU<aO._barPoints.length;aU++){aH=aO._barPoints[aU];aQ=aO.gridData[aU];if(aJ>aH[0][0]&&aJ<aH[2][0]&&aI>aH[2][1]&&aI<aH[0][1]){return{seriesIndex:aO.index,pointIndex:aU,gridData:aQ,data:aO.data[aU],points:aO._barPoints[aU]}}}break;case L.jqplot.PyramidRenderer:aJ=al.x;aI=al.y;for(aU=0;aU<aO._barPoints.length;aU++){aH=aO._barPoints[aU];aQ=aO.gridData[aU];if(aJ>aH[0][0]+aV[0][0]&&aJ<aH[2][0]+aV[2][0]&&aI>aH[2][1]&&aI<aH[0][1]){return{seriesIndex:aO.index,pointIndex:aU,gridData:aQ,data:aO.data[aU],points:aO._barPoints[aU]}}}break;case L.jqplot.DonutRenderer:az=aO.startAngle/180*Math.PI;aJ=al.x-aO._center[0];aI=al.y-aO._center[1];aP=Math.sqrt(Math.pow(aJ,2)+Math.pow(aI,2));if(aJ>0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aP<aO._radius&&aP>aO._innerRadius){for(aU=0;aU<aO.gridData.length;aU++){aA=(aU>0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw<aK){return{seriesIndex:aO.index,pointIndex:aU,gridData:[al.x,al.y],data:aO.data[aU]}}}}break;case L.jqplot.PieRenderer:az=aO.startAngle/180*Math.PI;aJ=al.x-aO._center[0];aI=al.y-aO._center[1];aP=Math.sqrt(Math.pow(aJ,2)+Math.pow(aI,2));if(aJ>0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aP<aO._radius){for(aU=0;aU<aO.gridData.length;aU++){aA=(aU>0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw<aK){return{seriesIndex:aO.index,pointIndex:aU,gridData:[al.x,al.y],data:aO.data[aU]}}}}break;case L.jqplot.BubbleRenderer:aJ=al.x;aI=al.y;var aF=null;if(aO.show){for(var aU=0;aU<aO.gridData.length;aU++){aQ=aO.gridData[aU];aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=aQ[2]&&(aX<=aS||aS==null)){aS=aX;aF={seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}if(aF!=null){return aF}}break;case L.jqplot.FunnelRenderer:aJ=al.x;aI=al.y;var aL=aO._vertices,ap=aL[0],ao=aL[aL.length-1],at,aE,ay;function aR(a0,a2,a1){var aZ=(a2[1]-a1[1])/(a2[0]-a1[0]);var aY=a2[1]-aZ*a2[0];var a3=a0+a2[1];return[(a3-aY)/aZ,a3]}at=aR(aI,ap[0],ao[3]);aE=aR(aI,ap[1],ao[2]);for(aU=0;aU<aL.length;aU++){ay=aL[aU];if(aI>=ay[0][1]&&aI<=ay[3][1]&&aJ>=at[0]&&aJ<=aE[0]){return{seriesIndex:aO.index,pointIndex:aU,gridData:null,data:aO.data[aU]}}}break;case L.jqplot.LineRenderer:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){if((aO.fill||(aO.renderer.bands.show&&aO.renderer.bands.fill))&&(!am.plugins.highlighter||!am.plugins.highlighter.show)){var ax=false;if(aJ>aO._boundingBox[0][0]&&aJ<aO._boundingBox[1][0]&&aI>aO._boundingBox[1][1]&&aI<aO._boundingBox[0][1]){var aD=aO._areaPoints.length;var aG;var aU=aD-1;for(var aG=0;aG<aD;aG++){var aC=[aO._areaPoints[aG][0],aO._areaPoints[aG][1]];var aB=[aO._areaPoints[aU][0],aO._areaPoints[aU][1]];if(aC[1]<aI&&aB[1]>=aI||aB[1]<aI&&aC[1]>=aI){if(aC[0]+(aI-aC[1])/(aB[1]-aC[1])*(aB[0]-aC[0])<aJ){ax=!ax}}aU=aG}}if(ax){return{seriesIndex:aW,pointIndex:null,gridData:aO.gridData,data:aO.data,points:aO._areaPoints}}break}else{aN=aO.markerRenderer.size/2+aO.neighborThreshold;an=(aN>0)?aN:0;for(var aU=0;aU<aO.gridData.length;aU++){aQ=aO.gridData[aU];if(aP.constructor==L.jqplot.OHLCRenderer){if(aP.candleStick){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{if(aQ[0]!=null&&aQ[1]!=null){aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}}}break;default:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){aN=aO.markerRenderer.size/2+aO.neighborThreshold;an=(aN>0)?aN:0;for(var aU=0;aU<aO.gridData.length;aU++){aQ=aO.gridData[aU];if(aP.constructor==L.jqplot.OHLCRenderer){if(aP.candleStick){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}break}}return null}this.onClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onDblClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotDblClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseDown=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseDown");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseUp=function(an){var am=ai(an);var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,null,an.data.plot])};this.onRightClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);if(ap.captureRightClick){if(an.which==3){var al=L.Event("jqplotRightClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}else{var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}}};this.onMouseMove=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseMove");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseEnter=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseEnter");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.onMouseLeave=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseLeave");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.drawSeries=function(an,al){var ap,ao,am;al=(typeof(an)==="number"&&al==null)?an:al;an=(typeof(an)==="object")?an:{};if(al!=u){ao=this.series[al];am=ao.shadowCanvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.drawShadow(am,an,this);am=ao.canvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.draw(am,an,this);if(ao.renderer.constructor==L.jqplot.BezierCurveRenderer){if(al<this.series.length-1){this.drawSeries(al+1)}}}else{for(ap=0;ap<this.series.length;ap++){ao=this.series[ap];am=ao.shadowCanvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.drawShadow(am,an,this);am=ao.canvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.draw(am,an,this)}}an=al=ap=ao=am=null};this.moveSeriesToFront=function(am){am=parseInt(am,10);var ap=L.inArray(am,this.seriesStack);if(ap==-1){return}if(ap==this.seriesStack.length-1){this.previousSeriesStack=this.seriesStack.slice(0);return}var al=this.seriesStack[this.seriesStack.length-1];var ao=this.series[am].canvas._elem.detach();var an=this.series[am].shadowCanvas._elem.detach();this.series[al].shadowCanvas._elem.after(an);this.series[al].canvas._elem.after(ao);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(ap,1);this.seriesStack.push(am)};this.moveSeriesToBack=function(am){am=parseInt(am,10);var ap=L.inArray(am,this.seriesStack);if(ap==0||ap==-1){return}var al=this.seriesStack[0];var ao=this.series[am].canvas._elem.detach();var an=this.series[am].shadowCanvas._elem.detach();this.series[al].shadowCanvas._elem.before(an);this.series[al].canvas._elem.before(ao);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(ap,1);this.seriesStack.unshift(am)};this.restorePreviousSeriesOrder=function(){var ar,aq,ap,ao,an,al,am;if(this.seriesStack==this.previousSeriesStack){return}for(ar=1;ar<this.previousSeriesStack.length;ar++){al=this.previousSeriesStack[ar];am=this.previousSeriesStack[ar-1];ap=this.series[al].canvas._elem.detach();ao=this.series[al].shadowCanvas._elem.detach();this.series[am].shadowCanvas._elem.after(ao);this.series[am].canvas._elem.after(ap)}an=this.seriesStack.slice(0);this.seriesStack=this.previousSeriesStack.slice(0);this.previousSeriesStack=an};this.restoreOriginalSeriesOrder=function(){var ap,ao,al=[],an,am;for(ap=0;ap<this.series.length;ap++){al.push(ap)}if(this.seriesStack==al){return}this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack=al;for(ap=1;ap<this.seriesStack.length;ap++){an=this.series[ap].canvas._elem.detach();am=this.series[ap].shadowCanvas._elem.detach();this.series[ap-1].shadowCanvas._elem.after(am);this.series[ap-1].canvas._elem.after(an)}};this.activateTheme=function(al){this.themeEngine.activate(this,al)}}L.jqplot.computeHighlightColors=function(ai){var ak;if(L.isArray(ai)){ak=[];for(var am=0;am<ai.length;am++){var al=L.jqplot.getColorComponents(ai[am]);var ah=[al[0],al[1],al[2]];var an=ah[0]+ah[1]+ah[2];for(var aj=0;aj<3;aj++){ah[aj]=(an>660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak.push("rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")")}}else{var al=L.jqplot.getColorComponents(ai);var ah=[al[0],al[1],al[2]];var an=ah[0]+ah[1]+ah[2];for(var aj=0;aj<3;aj++){ah[aj]=(an>660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak="rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")"}return ak};L.jqplot.ColorGenerator=function(ai){ai=ai||L.jqplot.config.defaultColors;var ah=0;this.next=function(){if(ah<ai.length){return ai[ah++]}else{ah=0;return ai[ah++]}};this.previous=function(){if(ah>0){return ai[ah--]}else{ah=ai.length-1;return ai[ah]}};this.get=function(ak){var aj=ak-ai.length*Math.floor(ak/ai.length);return ai[aj]};this.setColors=function(aj){ai=aj};this.reset=function(){ah=0};this.getIndex=function(){return ah};this.setIndex=function(aj){ah=aj}};L.jqplot.hex2rgb=function(aj,ah){aj=aj.replace("#","");if(aj.length==3){aj=aj.charAt(0)+aj.charAt(0)+aj.charAt(1)+aj.charAt(1)+aj.charAt(2)+aj.charAt(2)}var ai;ai="rgba("+parseInt(aj.slice(0,2),16)+", "+parseInt(aj.slice(2,4),16)+", "+parseInt(aj.slice(4,6),16);if(ah){ai+=", "+ah}ai+=")";return ai};L.jqplot.rgb2hex=function(am){var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var ah=am.match(aj);var al="#";for(var ak=1;ak<4;ak++){var ai;if(ah[ak].search(/%/)!=-1){ai=parseInt(255*ah[ak]/100,10).toString(16);if(ai.length==1){ai="0"+ai}}else{ai=parseInt(ah[ak],10).toString(16);if(ai.length==1){ai="0"+ai}}al+=ai}return al};L.jqplot.normalize2rgb=function(ai,ah){if(ai.search(/^ *rgba?\(/)!=-1){return ai}else{if(ai.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return L.jqplot.hex2rgb(ai,ah)}else{throw new Error("Invalid color spec")}}};L.jqplot.getColorComponents=function(am){am=L.jqplot.colorKeywordMap[am]||am;var ak=L.jqplot.normalize2rgb(am);var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var ah=ak.match(aj);var ai=[];for(var al=1;al<4;al++){if(ah[al].search(/%/)!=-1){ai[al-1]=parseInt(255*ah[al]/100,10)}else{ai[al-1]=parseInt(ah[al],10)}}ai[3]=parseFloat(ah[4])?parseFloat(ah[4]):1;return ai};L.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"};L.jqplot.AxisLabelRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this.fontFamily=null;this.fontSize=null;this.textColor=null;this._elem;this.escapeHTML=false;L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisLabelRenderer.prototype.constructor=L.jqplot.AxisLabelRenderer;L.jqplot.AxisLabelRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype.draw=function(ah,ai){if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};L.jqplot.AxisLabelRenderer.prototype.pack=function(){};L.jqplot.AxisTickRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label=null;this.value=null;this._styles={};this.formatter=L.jqplot.DefaultTickFormatter;this.prefix="";this.suffix="";this.formatString="";this.fontFamily;this.fontSize;this.textColor;this.escapeHTML=false;this._elem;this._breakTick=false;L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisTickRenderer.prototype.constructor=L.jqplot.AxisTickRenderer;L.jqplot.AxisTickRenderer.prototype.setTick=function(ah,aj,ai){this.value=ah;this.axis=aj;if(ai){this.isMinorTick=true}return this};L.jqplot.AxisTickRenderer.prototype.draw=function(){if(this.label===null){this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix}var ai={position:"absolute"};if(Number(this.label)){ai.whitSpace="nowrap"}if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L(document.createElement("div"));this._elem.addClass("jqplot-"+this.axis+"-tick");if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}this._elem.css(ai);for(var ah in this._styles){this._elem.css(ah,this._styles[ah])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}if(this._breakTick){this._elem.addClass("jqplot-breakTick")}return this._elem};L.jqplot.DefaultTickFormatter=function(ah,ai){if(typeof ai=="number"){if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.PercentTickFormatter=function(ah,ai){if(typeof ai=="number"){ai=100*ai;if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.AxisTickRenderer.prototype.pack=function(){};L.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.CanvasGridRenderer.prototype.init=function(ai){this._ctx;L.extend(true,this,ai);var ah={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(ah)};L.jqplot.CanvasGridRenderer.prototype.createElement=function(ak){var aj;if(this._elem){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){aj=this._elem.get(0);window.G_vmlCanvasManager.uninitElement(aj);aj=null}this._elem.emptyForce();this._elem=null}aj=ak.canvasManager.getCanvas();var ah=this._plotDimensions.width;var ai=this._plotDimensions.height;aj.width=ah;aj.height=ai;this._elem=L(aj);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});aj=ak.canvasManager.initCanvas(aj);this._top=this._offsets.top;this._bottom=ai-this._offsets.bottom;this._left=this._offsets.left;this._right=ah-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;aj=null;return this._elem};L.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var at=this._ctx;var aw=this._axes;at.save();at.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height);at.fillStyle=this.backgroundColor||this.background;at.fillRect(this._left,this._top,this._width,this._height);at.save();at.lineJoin="miter";at.lineCap="butt";at.lineWidth=this.gridLineWidth;at.strokeStyle=this.gridLineColor;var aA,az,ap,aq;var am=["xaxis","yaxis","x2axis","y2axis"];for(var ay=4;ay>0;ay--){var aD=am[ay-1];var ah=aw[aD];var aB=ah._ticks;var ar=aB.length;if(ah.show){if(ah.drawBaseline){var aC={};if(ah.baselineWidth!==null){aC.lineWidth=ah.baselineWidth}if(ah.baselineColor!==null){aC.strokeStyle=ah.baselineColor}switch(aD){case"xaxis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"yaxis":ao(this._left,this._bottom,this._left,this._top,aC);break;case"x2axis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"y2axis":ao(this._right,this._bottom,this._right,this._top,aC);break}}for(var au=ar;au>0;au--){var an=aB[au-1];if(an.show){var ak=Math.round(ah.u2p(an.value))+0.5;switch(aD){case"xaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._top,ak,this._bottom)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._bottom;az=this._bottom+ap;break;case"inside":aA=this._bottom-ap;az=this._bottom;break;case"cross":aA=this._bottom-ap;az=this._bottom+ap;break;default:aA=this._bottom;az=this._bottom+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"yaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._right,ak,this._left,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._left-ap;az=this._left;break;case"inside":aA=this._left;az=this._left+ap;break;case"cross":aA=this._left-ap;az=this._left+ap;break;default:aA=this._left-ap;az=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;case"x2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._bottom,ak,this._top)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._top-ap;az=this._top;break;case"inside":aA=this._top;az=this._top+ap;break;case"cross":aA=this._top-ap;az=this._top+ap;break;default:aA=this._top-ap;az=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"y2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._left,ak,this._right,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._right;az=this._right+ap;break;case"inside":aA=this._right-ap;az=this._right;break;case"cross":aA=this._right-ap;az=this._right+ap;break;default:aA=this._right;az=this._right+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;default:break}}}an=null}ah=null;aB=null}am=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var ay=7;ay>0;ay--){var ah=aw[am[ay-1]];var aB=ah._ticks;if(ah.show){var ai=aB[ah.numberTicks-1];var al=aB[0];var aj=ah.getLeft();var av=[[aj,ai.getTop()+ai.getHeight()/2],[aj,al.getTop()+al.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",fill:false,closePath:false})}ao(av[0][0],av[0][1],av[1][0],av[1][1],{lineCap:"butt",strokeStyle:ah.borderColor,lineWidth:ah.borderWidth});for(var au=aB.length;au>0;au--){var an=aB[au-1];ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;if(an.showMark&&an.mark){switch(aq){case"outside":aA=aj;az=aj+ap;break;case"inside":aA=aj-ap;az=aj;break;case"cross":aA=aj-ap;az=aj+ap;break;default:aA=aj;az=aj+ap;break}av=[[aA,ak],[az,ak]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}an=null}al=null}ah=null;aB=null}at.restore();function ao(aH,aG,aE,ax,aF){at.save();aF=aF||{};if(aF.lineWidth==null||aF.lineWidth!=0){L.extend(true,at,aF);at.beginPath();at.moveTo(aH,aG);at.lineTo(aE,ax);at.stroke();at.restore()}}if(this.shadow){var av=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(at,av)}if(this.borderWidth!=0&&this.drawBorder){ao(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:aw.x2axis.borderColor,lineWidth:aw.x2axis.borderWidth});ao(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:aw.y2axis.borderColor,lineWidth:aw.y2axis.borderWidth});ao(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:aw.xaxis.borderColor,lineWidth:aw.xaxis.borderWidth});ao(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:aw.yaxis.borderColor,lineWidth:aw.yaxis.borderWidth})}at.restore();at=null;aw=null};L.jqplot.DivTitleRenderer=function(){};L.jqplot.DivTitleRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.DivTitleRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}var ak=this.renderer;var aj=document.createElement("div");this._elem=L(aj);this._elem.addClass("jqplot-title");if(!this.text){this.show=false;this._elem.height(0);this._elem.width(0)}else{if(this.text){var ah;if(this.color){ah=this.color}else{if(this.textColor){ah=this.textColor}}var ai={position:"absolute",top:"0px",left:"0px"};if(this._plotWidth){ai.width=this._plotWidth+"px"}if(this.fontSize){ai.fontSize=this.fontSize}if(typeof this.textAlign==="string"){ai.textAlign=this.textAlign}else{ai.textAlign="center"}if(ah){ai.color=ah}if(this.paddingBottom){ai.paddingBottom=this.paddingBottom}if(this.fontFamily){ai.fontFamily=this.fontFamily}this._elem.css(ai);if(this.escapeHtml){this._elem.text(this.text)}else{this._elem.html(this.text)}}}aj=null;return this._elem};L.jqplot.DivTitleRenderer.prototype.pack=function(){};var r=0.1;L.jqplot.LinePattern=function(aw,aq){var ap={dotted:[r,L.jqplot.config.dotGapLength],dashed:[L.jqplot.config.dashLength,L.jqplot.config.gapLength],solid:null};if(typeof aq==="string"){if(aq[0]==="."||aq[0]==="-"){var ax=aq;aq=[];for(var ao=0,al=ax.length;ao<al;ao++){if(ax[ao]==="."){aq.push(r)}else{if(ax[ao]==="-"){aq.push(L.jqplot.config.dashLength)}else{continue}}aq.push(L.jqplot.config.gapLength)}}else{aq=ap[aq]}}if(!(aq&&aq.length)){return aw}var ak=0;var ar=aq[0];var au=0;var at=0;var an=0;var ah=0;var av=function(ay,az){aw.moveTo(ay,az);au=ay;at=az;an=ay;ah=az};var aj=function(ay,aE){var aC=aw.lineWidth;var aA=ay-au;var az=aE-at;var aB=Math.sqrt(aA*aA+az*az);if((aB>0)&&(aC>0)){aA/=aB;az/=aB;while(true){var aD=aC*ar;if(aD<aB){au+=aD*aA;at+=aD*az;if((ak&1)==0){aw.lineTo(au,at)}else{aw.moveTo(au,at)}aB-=aD;ak++;if(ak>=aq.length){ak=0}ar=aq[ak]}else{au=ay;at=aE;if((ak&1)==0){aw.lineTo(au,at)}else{aw.moveTo(au,at)}ar-=aB/aC;break}}}};var ai=function(){aw.beginPath()};var am=function(){aj(an,ah)};return{moveTo:av,lineTo:aj,beginPath:ai,closePath:am}};L.jqplot.LineRenderer=function(){this.shapeRenderer=new L.jqplot.ShapeRenderer();this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.LineRenderer.prototype.init=function(ai,an){ai=ai||{};this._type="line";this.renderer.animation={show:false,direction:"left",speed:2500,_supported:true};this.renderer.smooth=false;this.renderer.tension=null;this.renderer.constrainSmoothing=true;this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];this.renderer.bandData=[];this.renderer.bands={show:false,hiData:[],lowData:[],color:this.color,showLines:false,fill:true,fillColor:null,_min:null,_max:null,interval:"3%"};var al={highlightMouseOver:ai.highlightMouseOver,highlightMouseDown:ai.highlightMouseDown,highlightColor:ai.highlightColor};delete (ai.highlightMouseOver);delete (ai.highlightMouseDown);delete (ai.highlightColor);L.extend(true,this.renderer,ai);this.renderer.options=ai;if(this.renderer.bandData.length>1&&(!ai.bands||ai.bands.show==null)){this.renderer.bands.show=true}else{if(ai.bands&&ai.bands.show==null&&ai.bands.interval!=null){this.renderer.bands.show=true}}if(this.fill){this.renderer.bands.show=false}if(this.renderer.bands.show){this.renderer.initBands.call(this,this.renderer.options,an)}if(this._stack){this.renderer.smooth=false}var am={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shapeRenderer.init(am);var aj=ai.shadowOffset;if(aj==null){if(this.lineWidth>2.5){aj=1.25*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{aj=1.25*Math.atan((this.lineWidth/2.5))/0.785398163}}var ah={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,angle:this.shadowAngle,offset:aj,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shadowRenderer.init(ah);this._areaPoints=[];this._boundingBox=[[],[]];if(!this.isTrendline&&this.fill||this.renderer.bands.show){this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColor=null;if(al.highlightMouseDown&&al.highlightMouseOver==null){al.highlightMouseOver=false}L.extend(true,this,{highlightMouseOver:al.highlightMouseOver,highlightMouseDown:al.highlightMouseDown,highlightColor:al.highlightColor});if(!this.highlightColor){var ak=(this.renderer.bands.show)?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=L.jqplot.computeHighlightColors(ak)}if(this.highlighter){this.highlighter.show=false}}if(!this.isTrendline&&an){an.plugins.lineRenderer={};an.postInitHooks.addOnce(z);an.postDrawHooks.addOnce(af);an.eventListenerHooks.addOnce("jqplotMouseMove",h);an.eventListenerHooks.addOnce("jqplotMouseDown",e);an.eventListenerHooks.addOnce("jqplotMouseUp",ad);an.eventListenerHooks.addOnce("jqplotClick",g);an.eventListenerHooks.addOnce("jqplotRightClick",s)}};L.jqplot.LineRenderer.prototype.initBands=function(ak,av){var al=ak.bandData||[];var an=this.renderer.bands;an.hiData=[];an.lowData=[];var aB=this.data;an._max=null;an._min=null;if(al.length==2){if(L.isArray(al[0][0])){var ao;var ah=0,ar=0;for(var aw=0,at=al[0].length;aw<at;aw++){ao=al[0][aw];if((ao[1]!=null&&ao[1]>an._max)||an._max==null){an._max=ao[1]}if((ao[1]!=null&&ao[1]<an._min)||an._min==null){an._min=ao[1]}}for(var aw=0,at=al[1].length;aw<at;aw++){ao=al[1][aw];if((ao[1]!=null&&ao[1]>an._max)||an._max==null){an._max=ao[1];ar=1}if((ao[1]!=null&&ao[1]<an._min)||an._min==null){an._min=ao[1];ah=1}}if(ar===ah){an.show=false}an.hiData=al[ar];an.lowData=al[ah]}else{if(al[0].length===aB.length&&al[1].length===aB.length){var aj=(al[0][0]>al[1][0])?0:1;var aC=(aj)?0:1;for(var aw=0,at=aB.length;aw<at;aw++){an.hiData.push([aB[aw][0],al[aj][aw]]);an.lowData.push([aB[aw][0],al[aC][aw]])}}else{an.show=false}}}else{if(al.length>2&&!L.isArray(al[0][0])){var aj=(al[0][0]>al[0][1])?0:1;var aC=(aj)?0:1;for(var aw=0,at=al.length;aw<at;aw++){an.hiData.push([aB[aw][0],al[aw][aj]]);an.lowData.push([aB[aw][0],al[aw][aC]])}}else{var aq=an.interval;var aA=null;var az=null;var ai=null;var au=null;if(L.isArray(aq)){aA=aq[0];az=aq[1]}else{aA=aq}if(isNaN(aA)){if(aA.charAt(aA.length-1)==="%"){ai="multiply";aA=parseFloat(aA)/100+1}}else{aA=parseFloat(aA);ai="add"}if(az!==null&&isNaN(az)){if(az.charAt(az.length-1)==="%"){au="multiply";az=parseFloat(az)/100+1}}else{if(az!==null){az=parseFloat(az);au="add"}}if(aA!==null){if(az===null){az=-aA;au=ai;if(au==="multiply"){az+=2}}if(aA<az){var ax=aA;aA=az;az=ax;ax=ai;ai=au;au=ax}for(var aw=0,at=aB.length;aw<at;aw++){switch(ai){case"add":an.hiData.push([aB[aw][0],aB[aw][1]+aA]);break;case"multiply":an.hiData.push([aB[aw][0],aB[aw][1]*aA]);break}switch(au){case"add":an.lowData.push([aB[aw][0],aB[aw][1]+az]);break;case"multiply":an.lowData.push([aB[aw][0],aB[aw][1]*az]);break}}}else{an.show=false}}}var am=an.hiData;var ap=an.lowData;for(var aw=0,at=am.length;aw<at;aw++){if((am[aw][1]!=null&&am[aw][1]>an._max)||an._max==null){an._max=am[aw][1]}}for(var aw=0,at=ap.length;aw<at;aw++){if((ap[aw][1]!=null&&ap[aw][1]<an._min)||an._min==null){an._min=ap[aw][1]}}if(an.fillColor===null){var ay=L.jqplot.getColorComponents(an.color);ay[3]=ay[3]*0.5;an.fillColor="rgba("+ay[0]+", "+ay[1]+", "+ay[2]+", "+ay[3]+")"}};function K(ai,ah){return(3.4182054+ah)*Math.pow(ai,-0.3534992)}function n(aj,ai){var ah=Math.sqrt(Math.pow((ai[0]-aj[0]),2)+Math.pow((ai[1]-aj[1]),2));return 5.7648*Math.log(ah)+7.4456}function A(ah){var ai=(Math.exp(2*ah)-1)/(Math.exp(2*ah)+1);return ai}function J(aJ){var at=this.renderer.smooth;var aD=this.canvas.getWidth();var an=this._xaxis.series_p2u;var aG=this._yaxis.series_p2u;var aF=null;var am=null;var az=aJ.length/aD;var aj=[];var ay=[];if(!isNaN(parseFloat(at))){aF=parseFloat(at)}else{aF=K(az,0.5)}var aw=[];var ak=[];for(var aE=0,aA=aJ.length;aE<aA;aE++){aw.push(aJ[aE][1]);ak.push(aJ[aE][0])}function av(aK,aL){if(aK-aL==0){return Math.pow(10,10)}else{return aK-aL}}var ax,ar,aq,ap;var ah=aJ.length-1;for(var al=1,aB=aJ.length;al<aB;al++){var ai=[];var au=[];for(var aC=0;aC<2;aC++){var aE=al-1+aC;if(aE==0||aE==ah){ai[aC]=Math.pow(10,10)}else{if(aw[aE+1]-aw[aE]==0||aw[aE]-aw[aE-1]==0){ai[aC]=0}else{if(((ak[aE+1]-ak[aE])/(aw[aE+1]-aw[aE])+(ak[aE]-ak[aE-1])/(aw[aE]-aw[aE-1]))==0){ai[aC]=0}else{if((aw[aE+1]-aw[aE])*(aw[aE]-aw[aE-1])<0){ai[aC]=0}else{ai[aC]=2/(av(ak[aE+1],ak[aE])/(aw[aE+1]-aw[aE])+av(ak[aE],ak[aE-1])/(aw[aE]-aw[aE-1]))}}}}}if(al==1){ai[0]=3/2*(aw[1]-aw[0])/av(ak[1],ak[0])-ai[1]/2}else{if(al==ah){ai[1]=3/2*(aw[ah]-aw[ah-1])/av(ak[ah],ak[ah-1])-ai[0]/2}}au[0]=-2*(ai[1]+2*ai[0])/av(ak[al],ak[al-1])+6*(aw[al]-aw[al-1])/Math.pow(av(ak[al],ak[al-1]),2);au[1]=2*(2*ai[1]+ai[0])/av(ak[al],ak[al-1])-6*(aw[al]-aw[al-1])/Math.pow(av(ak[al],ak[al-1]),2);ap=1/6*(au[1]-au[0])/av(ak[al],ak[al-1]);aq=1/2*(ak[al]*au[0]-ak[al-1]*au[1])/av(ak[al],ak[al-1]);ar=(aw[al]-aw[al-1]-aq*(Math.pow(ak[al],2)-Math.pow(ak[al-1],2))-ap*(Math.pow(ak[al],3)-Math.pow(ak[al-1],3)))/av(ak[al],ak[al-1]);ax=aw[al-1]-ar*ak[al-1]-aq*Math.pow(ak[al-1],2)-ap*Math.pow(ak[al-1],3);var aI=(ak[al]-ak[al-1])/aF;var aH,ao;for(var aC=0,aA=aF;aC<aA;aC++){aH=[];ao=ak[al-1]+aC*aI;aH.push(ao);aH.push(ax+ar*ao+aq*Math.pow(ao,2)+ap*Math.pow(ao,3));aj.push(aH);ay.push([an(aH[0]),aG(aH[1])])}}aj.push(aJ[aE]);ay.push([an(aJ[aE][0]),aG(aJ[aE][1])]);return[aj,ay]}function F(ap){var ao=this.renderer.smooth;var aU=this.renderer.tension;var ah=this.canvas.getWidth();var aH=this._xaxis.series_p2u;var aq=this._yaxis.series_p2u;var aI=null;var aJ=null;var aT=null;var aO=null;var aM=null;var at=null;var aR=null;var am=null;var aK,aL,aD,aC,aA,ay;var ak,ai,av,au;var aB,az,aN;var aw=[];var aj=[];var al=ap.length/ah;var aS,ax,aF,aG,aE;var ar=[];var an=[];if(!isNaN(parseFloat(ao))){aI=parseFloat(ao)}else{aI=K(al,0.5)}if(!isNaN(parseFloat(aU))){aU=parseFloat(aU)}for(var aQ=0,aP=ap.length-1;aQ<aP;aQ++){if(aU===null){at=Math.abs((ap[aQ+1][1]-ap[aQ][1])/(ap[aQ+1][0]-ap[aQ][0]));aS=0.3;ax=0.6;aF=(ax-aS)/2;aG=2.5;aE=-1.4;am=at/aG+aE;aO=aF*A(am)-aF*A(aE)+aS;if(aQ>0){aR=Math.abs((ap[aQ][1]-ap[aQ-1][1])/(ap[aQ][0]-ap[aQ-1][0]))}am=aR/aG+aE;aM=aF*A(am)-aF*A(aE)+aS;aT=(aO+aM)/2}else{aT=aU}for(aK=0;aK<aI;aK++){aL=aK/aI;aD=(1+2*aL)*Math.pow((1-aL),2);aC=aL*Math.pow((1-aL),2);aA=Math.pow(aL,2)*(3-2*aL);ay=Math.pow(aL,2)*(aL-1);if(ap[aQ-1]){ak=aT*(ap[aQ+1][0]-ap[aQ-1][0]);ai=aT*(ap[aQ+1][1]-ap[aQ-1][1])}else{ak=aT*(ap[aQ+1][0]-ap[aQ][0]);ai=aT*(ap[aQ+1][1]-ap[aQ][1])}if(ap[aQ+2]){av=aT*(ap[aQ+2][0]-ap[aQ][0]);au=aT*(ap[aQ+2][1]-ap[aQ][1])}else{av=aT*(ap[aQ+1][0]-ap[aQ][0]);au=aT*(ap[aQ+1][1]-ap[aQ][1])}aB=aD*ap[aQ][0]+aA*ap[aQ+1][0]+aC*ak+ay*av;az=aD*ap[aQ][1]+aA*ap[aQ+1][1]+aC*ai+ay*au;aN=[aB,az];ar.push(aN);an.push([aH(aB),aq(az)])}}ar.push(ap[aP]);an.push([aH(ap[aP][0]),aq(ap[aP][1])]);return[ar,an]}L.jqplot.LineRenderer.prototype.setGridData=function(ap){var al=this._xaxis.series_u2p;var ah=this._yaxis.series_u2p;var am=this._plotData;var aq=this._prevPlotData;this.gridData=[];this._prevGridData=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var ak=this.renderer.bands;var ai=false;for(var an=0,aj=am.length;an<aj;an++){if(am[an][0]!=null&&am[an][1]!=null){this.gridData.push([al.call(this._xaxis,am[an][0]),ah.call(this._yaxis,am[an][1])])}else{if(am[an][0]==null){ai=true;this.gridData.push([null,ah.call(this._yaxis,am[an][1])])}else{if(am[an][1]==null){ai=true;this.gridData.push([al.call(this._xaxis,am[an][0]),null])}}}if(aq[an]!=null&&aq[an][0]!=null&&aq[an][1]!=null){this._prevGridData.push([al.call(this._xaxis,aq[an][0]),ah.call(this._yaxis,aq[an][1])])}else{if(aq[an]!=null&&aq[an][0]==null){this._prevGridData.push([null,ah.call(this._yaxis,aq[an][1])])}else{if(aq[an]!=null&&aq[an][0]!=null&&aq[an][1]==null){this._prevGridData.push([al.call(this._xaxis,aq[an][0]),null])}}}}if(ai){this.renderer.smooth=false;if(this._type==="line"){ak.show=false}}if(this._type==="line"&&ak.show){for(var an=0,aj=ak.hiData.length;an<aj;an++){this.renderer._hiBandGridData.push([al.call(this._xaxis,ak.hiData[an][0]),ah.call(this._yaxis,ak.hiData[an][1])])}for(var an=0,aj=ak.lowData.length;an<aj;an++){this.renderer._lowBandGridData.push([al.call(this._xaxis,ak.lowData[an][0]),ah.call(this._yaxis,ak.lowData[an][1])])}}if(this._type==="line"&&this.renderer.smooth&&this.gridData.length>2){var ao;if(this.renderer.constrainSmoothing){ao=J.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}else{ao=F.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}}};L.jqplot.LineRenderer.prototype.makeGridData=function(ao,aq){var am=this._xaxis.series_u2p;var ah=this._yaxis.series_u2p;var ar=[];var aj=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var al=this.renderer.bands;var ai=false;for(var an=0;an<ao.length;an++){if(ao[an][0]!=null&&ao[an][1]!=null){ar.push([am.call(this._xaxis,ao[an][0]),ah.call(this._yaxis,ao[an][1])])}else{if(ao[an][0]==null){ai=true;ar.push([null,ah.call(this._yaxis,ao[an][1])])}else{if(ao[an][1]==null){ai=true;ar.push([am.call(this._xaxis,ao[an][0]),null])}}}}if(ai){this.renderer.smooth=false;if(this._type==="line"){al.show=false}}if(this._type==="line"&&al.show){for(var an=0,ak=al.hiData.length;an<ak;an++){this.renderer._hiBandGridData.push([am.call(this._xaxis,al.hiData[an][0]),ah.call(this._yaxis,al.hiData[an][1])])}for(var an=0,ak=al.lowData.length;an<ak;an++){this.renderer._lowBandGridData.push([am.call(this._xaxis,al.lowData[an][0]),ah.call(this._yaxis,al.lowData[an][1])])}}if(this._type==="line"&&this.renderer.smooth&&ar.length>2){var ap;if(this.renderer.constrainSmoothing){ap=J.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}else{ap=F.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}}return ar};L.jqplot.LineRenderer.prototype.draw=function(ax,aI,ai,aB){var aC;var aq=L.extend(true,{},ai);var ak=(aq.shadow!=u)?aq.shadow:this.shadow;var aJ=(aq.showLine!=u)?aq.showLine:this.showLine;var aA=(aq.fill!=u)?aq.fill:this.fill;var ah=(aq.fillAndStroke!=u)?aq.fillAndStroke:this.fillAndStroke;var ar,ay,av,aE;ax.save();if(aI.length){if(aJ){if(aA){if(this.fillToZero){var aF=this.negativeColor;if(!this.useNegativeColors){aF=aq.fillStyle}var ao=false;var ap=aq.fillStyle;if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var aw=[];var aL=(this.renderer.smooth)?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var aG=this._yaxis.series_u2p(this.fillToValue);var aj=this._xaxis.series_u2p(this.fillToValue);aq.closePath=true;if(this.fillAxis=="y"){aw.push([aI[0][0],aG]);this._areaPoints.push([aI[0][0],aG]);for(var aC=0;aC<aI.length-1;aC++){aw.push(aI[aC]);this._areaPoints.push(aI[aC]);if(aL[aC][1]*aL[aC+1][1]<=0){if(aL[aC][1]<0){ao=true;aq.fillStyle=aF}else{ao=false;aq.fillStyle=ap}var an=aI[aC][0]+(aI[aC+1][0]-aI[aC][0])*(aG-aI[aC][1])/(aI[aC+1][1]-aI[aC][1]);aw.push([an,aG]);this._areaPoints.push([an,aG]);if(ak){this.renderer.shadowRenderer.draw(ax,aw,aq)}this.renderer.shapeRenderer.draw(ax,aw,aq);aw=[[an,aG]]}}if(aL[aI.length-1][1]<0){ao=true;aq.fillStyle=aF}else{ao=false;aq.fillStyle=ap}aw.push(aI[aI.length-1]);this._areaPoints.push(aI[aI.length-1]);aw.push([aI[aI.length-1][0],aG]);this._areaPoints.push([aI[aI.length-1][0],aG])}if(ak){this.renderer.shadowRenderer.draw(ax,aw,aq)}this.renderer.shapeRenderer.draw(ax,aw,aq)}else{var au=this._prevGridData;for(var aC=au.length;aC>0;aC--){aI.push(au[aC-1])}if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this._areaPoints=aI;this.renderer.shapeRenderer.draw(ax,aI,aq)}}else{if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var al=ax.canvas.height;aI.unshift([aI[0][0],al]);var aD=aI.length;aI.push([aI[aD-1][0],al])}else{var au=this._prevGridData;for(var aC=au.length;aC>0;aC--){aI.push(au[aC-1])}}this._areaPoints=aI;if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this.renderer.shapeRenderer.draw(ax,aI,aq)}if(ah){var az=L.extend(true,{},aq,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(ax,aH,az);if(this.markerRenderer.show){if(this.renderer.smooth){aH=this.gridData}for(aC=0;aC<aH.length;aC++){this.markerRenderer.draw(aH[aC][0],aH[aC][1],ax,aq.markerOptions)}}}}else{if(this.renderer.bands.show){var am;var aK=L.extend(true,{},aq);if(this.renderer.bands.showLines){am=(this.renderer.smooth)?this.renderer._hiBandSmoothedData:this.renderer._hiBandGridData;this.renderer.shapeRenderer.draw(ax,am,aq);am=(this.renderer.smooth)?this.renderer._lowBandSmoothedData:this.renderer._lowBandGridData;this.renderer.shapeRenderer.draw(ax,am,aK)}if(this.renderer.bands.fill){if(this.renderer.smooth){am=this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse())}else{am=this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse())}this._areaPoints=am;aK.closePath=true;aK.fill=true;aK.fillStyle=this.renderer.bands.fillColor;this.renderer.shapeRenderer.draw(ax,am,aK)}}if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this.renderer.shapeRenderer.draw(ax,aI,aq)}}var ar=av=ay=aE=null;for(aC=0;aC<this._areaPoints.length;aC++){var at=this._areaPoints[aC];if(ar>at[0]||ar==null){ar=at[0]}if(aE<at[1]||aE==null){aE=at[1]}if(av<at[0]||av==null){av=at[0]}if(ay>at[1]||ay==null){ay=at[1]}}if(this.type==="line"&&this.renderer.bands.show){aE=this._yaxis.series_u2p(this.renderer.bands._min);ay=this._yaxis.series_u2p(this.renderer.bands._max)}this._boundingBox=[[ar,aE],[av,ay]];if(this.markerRenderer.show&&!aA){if(this.renderer.smooth){aI=this.gridData}for(aC=0;aC<aI.length;aC++){if(aI[aC][0]!=null&&aI[aC][1]!=null){this.markerRenderer.draw(aI[aC][0],aI[aC][1],ax,aq.markerOptions)}}}}ax.restore()};L.jqplot.LineRenderer.prototype.drawShadow=function(ah,aj,ai){};function z(ak,aj,ah){for(var ai=0;ai<this.series.length;ai++){if(this.series[ai].renderer.constructor==L.jqplot.LineRenderer){if(this.series[ai].highlightMouseOver){this.series[ai].highlightMouseDown=false}}}}function af(){if(this.plugins.lineRenderer&&this.plugins.lineRenderer.highlightCanvas){this.plugins.lineRenderer.highlightCanvas.resetCanvas();this.plugins.lineRenderer.highlightCanvas=null}this.plugins.lineRenderer.highlightedSeriesIndex=null;this.plugins.lineRenderer.highlightCanvas=new L.jqplot.GenericCanvas();this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-lineRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.lineRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(ah){aa(ah.data.plot)})}function ac(an,am,ak,aj){var ai=an.series[am];var ah=an.plugins.lineRenderer.highlightCanvas;ah._ctx.clearRect(0,0,ah._ctx.canvas.width,ah._ctx.canvas.height);ai._highlightedPoint=ak;an.plugins.lineRenderer.highlightedSeriesIndex=am;var al={fillStyle:ai.highlightColor};if(ai.type==="line"&&ai.renderer.bands.show){al.fill=true;al.closePath=true}ai.renderer.shapeRenderer.draw(ah._ctx,aj,al);ah=null}function aa(aj){var ah=aj.plugins.lineRenderer.highlightCanvas;ah._ctx.clearRect(0,0,ah._ctx.canvas.width,ah._ctx.canvas.height);for(var ai=0;ai<aj.series.length;ai++){aj.series[ai]._highlightedPoint=null}aj.plugins.lineRenderer.highlightedSeriesIndex=null;aj.target.trigger("jqplotDataUnhighlight");ah=null}function h(al,ak,ao,an,am){if(an){var aj=[an.seriesIndex,an.pointIndex,an.data];var ai=jQuery.Event("jqplotDataMouseOver");ai.pageX=al.pageX;ai.pageY=al.pageY;am.target.trigger(ai,aj);if(am.series[aj[0]].highlightMouseOver&&!(aj[0]==am.plugins.lineRenderer.highlightedSeriesIndex)){var ah=jQuery.Event("jqplotDataHighlight");ah.which=al.which;ah.pageX=al.pageX;ah.pageY=al.pageY;am.target.trigger(ah,aj);ac(am,an.seriesIndex,an.pointIndex,an.points)}}else{if(an==null){aa(am)}}}function e(ak,aj,an,am,al){if(am){var ai=[am.seriesIndex,am.pointIndex,am.data];if(al.series[ai[0]].highlightMouseDown&&!(ai[0]==al.plugins.lineRenderer.highlightedSeriesIndex)){var ah=jQuery.Event("jqplotDataHighlight");ah.which=ak.which;ah.pageX=ak.pageX;ah.pageY=ak.pageY;al.target.trigger(ah,ai);ac(al,am.seriesIndex,am.pointIndex,am.points)}}else{if(am==null){aa(al)}}}function ad(aj,ai,am,al,ak){var ah=ak.plugins.lineRenderer.highlightedSeriesIndex;if(ah!=null&&ak.series[ah].highlightMouseDown){aa(ak)}}function g(ak,aj,an,am,al){if(am){var ai=[am.seriesIndex,am.pointIndex,am.data];var ah=jQuery.Event("jqplotDataClick");ah.which=ak.which;ah.pageX=ak.pageX;ah.pageY=ak.pageY;al.target.trigger(ah,ai)}}function s(al,ak,ao,an,am){if(an){var aj=[an.seriesIndex,an.pointIndex,an.data];var ah=am.plugins.lineRenderer.highlightedSeriesIndex;if(ah!=null&&am.series[ah].highlightMouseDown){aa(am)}var ai=jQuery.Event("jqplotDataRightClick");ai.which=al.which;ai.pageX=al.pageX;ai.pageY=al.pageY;am.target.trigger(ai,aj)}}L.jqplot.LinearAxisRenderer=function(){};L.jqplot.LinearAxisRenderer.prototype.init=function(ah){this.breakPoints=null;this.breakTickLabel="&asymp;";this.drawBaseline=true;this.baselineWidth=null;this.baselineColor=null;this.forceTickAt0=false;this.forceTickAt100=false;this.tickInset=0;this.minorTicks=0;this.alignTicks=false;this._autoFormatString="";this._overrideFormatString=false;this._scalefact=1;L.extend(true,this,ah);if(this.breakPoints){if(!L.isArray(this.breakPoints)){this.breakPoints=null}else{if(this.breakPoints.length<2||this.breakPoints[1]<=this.breakPoints[0]){this.breakPoints=null}}}if(this.numberTicks!=null&&this.numberTicks<2){this.numberTicks=2}this.resetDataBounds()};L.jqplot.LinearAxisRenderer.prototype.draw=function(ah,ao){if(this.show){this.renderer.createTicks.call(this,ao);var an=0;var ai;if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L(document.createElement("div"));this._elem.addClass("jqplot-axis jqplot-"+this.name);this._elem.css("position","absolute");if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var am=this._label.draw(ah,ao);am.appendTo(this._elem);am=null}var al=this._ticks;var ak;for(var aj=0;aj<al.length;aj++){ak=al[aj];if(ak.show&&ak.showLabel&&(!ak.isMinorTick||this.showMinorTicks)){this._elem.append(ak.draw(ah,ao))}}ak=null;al=null}return this._elem};L.jqplot.LinearAxisRenderer.prototype.reset=function(){this.min=this._options.min;this.max=this._options.max;this.tickInterval=this._options.tickInterval;this.numberTicks=this._options.numberTicks;this._autoFormatString="";if(this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString){this.tickOptions.formatString=""}};L.jqplot.LinearAxisRenderer.prototype.set=function(){var ao=0;var aj;var ai=0;var an=0;var ah=(this._label==null)?false:this._label.show;if(this.show){var am=this._ticks;var al;for(var ak=0;ak<am.length;ak++){al=am[ak];if(!al._breakTick&&al.show&&al.showLabel&&(!al.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){aj=al._elem.outerHeight(true)}else{aj=al._elem.outerWidth(true)}if(aj>ao){ao=aj}}}al=null;am=null;if(ah){ai=this._label._elem.outerWidth(true);an=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){ao=ao+ai;this._elem.css({width:ao+"px",left:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}else{ao=ao+ai;this._elem.css({width:ao+"px",right:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}}}}};L.jqplot.LinearAxisRenderer.prototype.createTicks=function(aj){var aT=this._ticks;var aK=this.ticks;var az=this.name;var aB=this._dataBounds;var ah=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var an;var a6,aI;var ap,ao;var a4,a0;var aH=this.min;var a5=this.max;var aW=this.numberTicks;var ba=this.tickInterval;var am=30;this._scalefact=(Math.max(ah,am+1)-am)/300;if(aK.length){for(a0=0;a0<aK.length;a0++){var aO=aK[a0];var aU=new this.tickRenderer(this.tickOptions);if(L.isArray(aO)){aU.value=aO[0];if(this.breakPoints){if(aO[0]==this.breakPoints[0]){aU.label=this.breakTickLabel;aU._breakTick=true;aU.showGridline=false;aU.showMark=false}else{if(aO[0]>this.breakPoints[0]&&aO[0]<=this.breakPoints[1]){aU.show=false;aU.showGridline=false;aU.label=aO[1]}else{aU.label=aO[1]}}}else{aU.label=aO[1]}aU.setTick(aO[0],this.name);this._ticks.push(aU)}else{if(L.isPlainObject(aO)){L.extend(true,aU,aO);aU.axis=this.name;this._ticks.push(aU)}else{aU.value=aO;if(this.breakPoints){if(aO==this.breakPoints[0]){aU.label=this.breakTickLabel;aU._breakTick=true;aU.showGridline=false;aU.showMark=false}else{if(aO>this.breakPoints[0]&&aO<=this.breakPoints[1]){aU.show=false;aU.showGridline=false}}}aU.setTick(aO,this.name);this._ticks.push(aU)}}}this.numberTicks=aK.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(az=="xaxis"||az=="x2axis"){ah=this._plotDimensions.width}else{ah=this._plotDimensions.height}var ax=this.numberTicks;if(this.alignTicks){if(this.name==="x2axis"&&aj.axes.xaxis.show){ax=aj.axes.xaxis.numberTicks}else{if(this.name.charAt(0)==="y"&&this.name!=="yaxis"&&this.name!=="yMidAxis"&&aj.axes.yaxis.show){ax=aj.axes.yaxis.numberTicks}}}a6=((this.min!=null)?this.min:aB.min);aI=((this.max!=null)?this.max:aB.max);var av=aI-a6;var aS,ay;var at;if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(this.min==null||this.max==null&&this.tickInterval==null&&!this.autoscale){if(this.forceTickAt0){if(a6>0){a6=0}if(aI<0){aI=0}}if(this.forceTickAt100){if(a6>100){a6=100}if(aI<100){aI=100}}var aE=false,a1=false;if(this.min!=null){aE=true}else{if(this.max!=null){a1=true}}var aP=L.jqplot.LinearTickGenerator(a6,aI,this._scalefact,ax,aE,a1);var aw=(this.min!=null)?a6:a6+av*(this.padMin-1);var aQ=(this.max!=null)?aI:aI-av*(this.padMax-1);if(a6<aw||aI>aQ){aw=(this.min!=null)?a6:a6-av*(this.padMin-1);aQ=(this.max!=null)?aI:aI+av*(this.padMax-1);aP=L.jqplot.LinearTickGenerator(aw,aQ,this._scalefact,ax,aE,a1)}this.min=aP[0];this.max=aP[1];this.numberTicks=aP[2];this._autoFormatString=aP[3];this.tickInterval=aP[4]}else{if(a6==aI){var ai=0.05;if(a6>0){ai=Math.max(Math.log(a6)/Math.LN10,0.05)}a6-=ai;aI+=ai}if(this.autoscale&&this.min==null&&this.max==null){var ak,al,ar;var aC=false;var aN=false;var aA={min:null,max:null,average:null,stddev:null};for(var a0=0;a0<this._series.length;a0++){var aV=this._series[a0];var aD=(aV.fillAxis=="x")?aV._xaxis.name:aV._yaxis.name;if(this.name==aD){var aR=aV._plotValues[aV.fillAxis];var aG=aR[0];var a2=aR[0];for(var aZ=1;aZ<aR.length;aZ++){if(aR[aZ]<aG){aG=aR[aZ]}else{if(aR[aZ]>a2){a2=aR[aZ]}}}var au=(a2-aG)/a2;if(aV.renderer.constructor==L.jqplot.BarRenderer){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{aC=false;if(aV.fill&&aV.fillToZero&&aG<0&&a2>0){aN=true}else{aN=false}}}else{if(aV.fill){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{if(aG<0&&a2>0&&aV.fillToZero){aC=false;aN=true}else{aC=false;aN=false}}}else{if(aG<0){aC=false}}}}}if(aC){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);this.min=0;aH=0;al=aI/(this.numberTicks-1);at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));if(al/at==parseInt(al/at,10)){al+=at}this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*(this.numberTicks-1)}else{if(aN){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);var aJ=Math.ceil(Math.abs(a6)/av*(this.numberTicks-1));var a9=this.numberTicks-1-aJ;al=Math.max(Math.abs(a6/aJ),Math.abs(aI/a9));at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*a9;this.min=-this.tickInterval*aJ}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(av/this.tickInterval)}else{this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){al=av/(this.numberTicks-1);if(al<1){at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)))}else{at=1}this.tickInterval=Math.ceil(al*at*this.pad)/at}else{at=1/this.tickInterval}ak=this.tickInterval*(this.numberTicks-1);ar=(ak-av)/2;if(this.min==null){this.min=Math.floor(at*(a6-ar))/at}if(this.max==null){this.max=this.min+ak}}}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM}else{aS=(this.min!=null)?this.min:a6-av*(this.padMin-1);ay=(this.max!=null)?this.max:aI+av*(this.padMax-1);av=ay-aS;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((ay-aS)/this.tickInterval)+1}else{if(ah>100){this.numberTicks=parseInt(3+(ah-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=av/(this.numberTicks-1)}if(this.max==null){ay=aS+this.tickInterval*(this.numberTicks-1)}if(this.min==null){aS=ay-this.tickInterval*(this.numberTicks-1)}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM;this.min=aS;this.max=ay}if(this.renderer.constructor==L.jqplot.LinearAxisRenderer&&this._autoFormatString==""){av=this.max-this.min;var a7=new this.tickRenderer(this.tickOptions);var aL=a7.formatString||L.jqplot.config.defaultTickFormatString;var aL=aL.match(L.jqplot.sprintf.regex)[0];var a3=0;if(aL){if(aL.search(/[fFeEgGpP]/)>-1){var aY=aL.match(/\%\.(\d{0,})?[eEfFgGpP]/);if(aY){a3=parseInt(aY[1],10)}else{a3=6}}else{if(aL.search(/[di]/)>-1){a3=0}}var aq=Math.pow(10,-a3);if(this.tickInterval<aq){if(aW==null&&ba==null){this.tickInterval=aq;if(a5==null&&aH==null){this.min=Math.floor(this._dataBounds.min/aq)*aq;if(this.min==this._dataBounds.min){this.min=this._dataBounds.min-this.tickInterval}this.max=Math.ceil(this._dataBounds.max/aq)*aq;if(this.max==this._dataBounds.max){this.max=this._dataBounds.max+this.tickInterval}var aX=(this.max-this.min)/this.tickInterval;aX=aX.toFixed(11);aX=Math.ceil(aX);this.numberTicks=aX+1}else{if(a5==null){var aX=(this._dataBounds.max-this.min)/this.tickInterval;aX=aX.toFixed(11);this.numberTicks=Math.ceil(aX)+2;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(aH==null){var aX=(this.max-this._dataBounds.min)/this.tickInterval;aX=aX.toFixed(11);this.numberTicks=Math.ceil(aX)+2;this.min=this.max-this.tickInterval*(this.numberTicks-1)}else{this.numberTicks=Math.ceil((a5-aH)/this.tickInterval)+1;this.min=Math.floor(aH*Math.pow(10,a3))/Math.pow(10,a3);this.max=Math.ceil(a5*Math.pow(10,a3))/Math.pow(10,a3);this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1}}}}}}}}if(this._overrideFormatString&&this._autoFormatString!=""){this.tickOptions=this.tickOptions||{};this.tickOptions.formatString=this._autoFormatString}var aU,a8;for(var a0=0;a0<this.numberTicks;a0++){a4=this.min+a0*this.tickInterval;aU=new this.tickRenderer(this.tickOptions);aU.setTick(a4,this.name);this._ticks.push(aU);if(a0<this.numberTicks-1){for(var aZ=0;aZ<this.minorTicks;aZ++){a4+=this.tickInterval/(this.minorTicks+1);a8=L.extend(true,{},this.tickOptions,{name:this.name,value:a4,label:"",isMinorTick:true});aU=new this.tickRenderer(a8);this._ticks.push(aU)}}aU=null}}if(this.tickInset){this.min=this.min-this.tickInset*this.tickInterval;this.max=this.max+this.tickInset*this.tickInterval}aT=null};L.jqplot.LinearAxisRenderer.prototype.resetTickValues=function(aj){if(L.isArray(aj)&&aj.length==this._ticks.length){var ai;for(var ah=0;ah<aj.length;ah++){ai=this._ticks[ah];ai.value=aj[ah];ai.label=ai.formatter(ai.formatString,aj[ah]);ai.label=ai.prefix+ai.label;ai._elem.html(ai.label)}ai=null;this.min=L.jqplot.arrayMin(aj);this.max=L.jqplot.arrayMax(aj);this.pack()}};L.jqplot.LinearAxisRenderer.prototype.pack=function(aj,ai){aj=aj||{};ai=ai||this._offsets;var ay=this._ticks;var au=this.max;var at=this.min;var ao=ai.max;var am=ai.min;var aq=(this._label==null)?false:this._label.show;for(var ar in aj){this._elem.css(ar,aj[ar])}this._offsets=ai;var ak=ao-am;var al=au-at;if(this.breakPoints){al=al-this.breakPoints[1]+this.breakPoints[0];this.p2u=function(aA){return(aA-am)*al/ak+at};this.u2p=function(aA){if(aA>this.breakPoints[0]&&aA<this.breakPoints[1]){aA=this.breakPoints[0]}if(aA<=this.breakPoints[0]){return(aA-at)*ak/al+am}else{return(aA-this.breakPoints[1]+this.breakPoints[0]-at)*ak/al+am}};if(this.name.charAt(0)=="x"){this.series_u2p=function(aA){if(aA>this.breakPoints[0]&&aA<this.breakPoints[1]){aA=this.breakPoints[0]}if(aA<=this.breakPoints[0]){return(aA-at)*ak/al}else{return(aA-this.breakPoints[1]+this.breakPoints[0]-at)*ak/al}};this.series_p2u=function(aA){return aA*al/ak+at}}else{this.series_u2p=function(aA){if(aA>this.breakPoints[0]&&aA<this.breakPoints[1]){aA=this.breakPoints[0]}if(aA>=this.breakPoints[1]){return(aA-au)*ak/al}else{return(aA+this.breakPoints[1]-this.breakPoints[0]-au)*ak/al}};this.series_p2u=function(aA){return aA*al/ak+au}}}else{this.p2u=function(aA){return(aA-am)*al/ak+at};this.u2p=function(aA){return(aA-at)*ak/al+am};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(aA){return(aA-at)*ak/al};this.series_p2u=function(aA){return aA*al/ak+at}}else{this.series_u2p=function(aA){return(aA-au)*ak/al};this.series_p2u=function(aA){return aA*al/ak+au}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var av=0;av<ay.length;av++){var ap=ay[av];if(ap.show&&ap.showLabel){var ah;if(ap.constructor==L.jqplot.CanvasAxisTickRenderer&&ap.angle){var ax=(this.name=="xaxis")?1:-1;switch(ap.labelPosition){case"auto":if(ax*ap.angle<0){ah=-ap.getWidth()+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2}else{ah=-ap._textRenderer.height*Math.sin(ap._textRenderer.angle)/2}break;case"end":ah=-ap.getWidth()+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2;break;case"start":ah=-ap._textRenderer.height*Math.sin(ap._textRenderer.angle)/2;break;case"middle":ah=-ap.getWidth()/2+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2;break;default:ah=-ap.getWidth()/2+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2;break}}else{ah=-ap.getWidth()/2}var az=this.u2p(ap.value)+ah+"px";ap._elem.css("left",az);ap.pack()}}if(aq){var an=this._label._elem.outerWidth(true);this._label._elem.css("left",am+ak/2-an/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(var av=0;av<ay.length;av++){var ap=ay[av];if(ap.show&&ap.showLabel){var ah;if(ap.constructor==L.jqplot.CanvasAxisTickRenderer&&ap.angle){var ax=(this.name=="yaxis")?1:-1;switch(ap.labelPosition){case"auto":case"end":if(ax*ap.angle<0){ah=-ap._textRenderer.height*Math.cos(-ap._textRenderer.angle)/2}else{ah=-ap.getHeight()+ap._textRenderer.height*Math.cos(ap._textRenderer.angle)/2}break;case"start":if(ap.angle>0){ah=-ap._textRenderer.height*Math.cos(-ap._textRenderer.angle)/2}else{ah=-ap.getHeight()+ap._textRenderer.height*Math.cos(ap._textRenderer.angle)/2}break;case"middle":ah=-ap.getHeight()/2;break;default:ah=-ap.getHeight()/2;break}}else{ah=-ap.getHeight()/2}var az=this.u2p(ap.value)+ah+"px";ap._elem.css("top",az);ap.pack()}}if(aq){var aw=this._label._elem.outerHeight(true);this._label._elem.css("top",ao-ak/2-aw/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}ay=null};function i(ai){var ah;ai=Math.abs(ai);if(ai>=10){ah="%d"}else{if(ai>1){if(ai===parseInt(ai,10)){ah="%d"}else{ah="%.1f"}}else{var aj=-Math.floor(Math.log(ai)/Math.LN10);ah="%."+aj+"f"}}return ah}var b=[0.1,0.2,0.3,0.4,0.5,0.8,1,2,3,4,5];var c=function(ai){var ah=b.indexOf(ai);if(ah>0){return b[ah-1]}else{return b[b.length-1]/100}};var k=function(ai){var ah=b.indexOf(ai);if(ah<b.length-1){return b[ah+1]}else{return b[0]*100}};function d(al,au,at){var aq=Math.floor(at/2);var ai=Math.ceil(at*1.5);var ak=Number.MAX_VALUE;var ah=(au-al);var ax;var ap;var ar;var ay=L.jqplot.getSignificantFigures;var aw;var an;var ao;var av;for(var am=0,aj=ai-aq+1;am<aj;am++){ao=aq+am;ax=ah/(ao-1);ap=ay(ax);ax=Math.abs(at-ao)+ap.digitsRight;if(ax<ak){ak=ax;ar=ao;av=ap.digitsRight}else{if(ax===ak){if(ap.digitsRight<av){ar=ao;av=ap.digitsRight}}}}aw=Math.max(av,Math.max(ay(al).digitsRight,ay(au).digitsRight));if(aw===0){an="%d"}else{an="%."+aw+"f"}ax=ah/(ar-1);return[al,au,ar,an,ax]}function W(ai,al){al=al||7;var ak=ai/(al-1);var aj=Math.pow(10,Math.floor(Math.log(ak)/Math.LN10));var am=ak/aj;var ah;if(aj<1){if(am>5){ah=10*aj}else{if(am>2){ah=5*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}else{if(am>5){ah=10*aj}else{if(am>4){ah=5*aj}else{if(am>3){ah=4*aj}else{if(am>2){ah=3*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}}}return ah}function Q(ai,ah){ah=ah||1;var ak=Math.floor(Math.log(ai)/Math.LN10);var am=Math.pow(10,ak);var al=ai/am;var aj;al=al/ah;if(al<=0.38){aj=0.1}else{if(al<=1.6){aj=0.2}else{if(al<=4){aj=0.5}else{if(al<=8){aj=1}else{if(al<=16){aj=2}else{aj=5}}}}}return aj*am}function x(aj,ai){var al=Math.floor(Math.log(aj)/Math.LN10);var an=Math.pow(10,al);var am=aj/an;var ah;var ak;am=am/ai;if(am<=0.38){ak=0.1}else{if(am<=1.6){ak=0.2}else{if(am<=4){ak=0.5}else{if(am<=8){ak=1}else{if(am<=16){ak=2}else{ak=5}}}}}ah=ak*an;return[ah,ak,an]}L.jqplot.LinearTickGenerator=function(an,aq,aj,ak,ao,ar){ao=(ao===null)?false:ao;ar=(ar===null||ao)?false:ar;if(an===aq){aq=(aq)?0:1}aj=aj||1;if(aq<an){var at=aq;aq=an;an=at}var ai=[];var aw=Q(aq-an,aj);var av=L.jqplot.getSignificantFigures;if(ak==null){if(!ao&&!ar){ai[0]=Math.floor(an/aw)*aw;ai[1]=Math.ceil(aq/aw)*aw;ai[2]=Math.round((ai[1]-ai[0])/aw+1);ai[3]=i(aw);ai[4]=aw}else{if(ao){ai[0]=an;ai[2]=Math.ceil((aq-an)/aw+1);ai[1]=an+(ai[2]-1)*aw;var au=av(an).digitsRight;var ap=av(aw).digitsRight;if(au<ap){ai[3]=i(aw)}else{ai[3]="%."+au+"f"}ai[4]=aw}else{if(ar){ai[1]=aq;ai[2]=Math.ceil((aq-an)/aw+1);ai[0]=aq-(ai[2]-1)*aw;var al=av(aq).digitsRight;var ap=av(aw).digitsRight;if(al<ap){ai[3]=i(aw)}else{ai[3]="%."+al+"f"}ai[4]=aw}}}}else{var am=[];am[0]=Math.floor(an/aw)*aw;am[1]=Math.ceil(aq/aw)*aw;am[2]=Math.round((am[1]-am[0])/aw+1);am[3]=i(aw);am[4]=aw;if(am[2]===ak){ai=am}else{var ah=W(am[1]-am[0],ak);ai[0]=am[0];ai[2]=ak;ai[4]=ah;ai[3]=i(ah);ai[1]=ai[0]+(ai[2]-1)*ai[4]}}return ai};L.jqplot.LinearTickGenerator.bestLinearInterval=Q;L.jqplot.LinearTickGenerator.bestInterval=W;L.jqplot.LinearTickGenerator.bestLinearComponents=x;L.jqplot.LinearTickGenerator.bestConstrainedInterval=d;L.jqplot.MarkerRenderer=function(ah){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new L.jqplot.ShadowRenderer();this.shapeRenderer=new L.jqplot.ShapeRenderer();L.extend(true,this,ah)};L.jqplot.MarkerRenderer.prototype.init=function(ah){L.extend(true,this,ah);var aj={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){aj.fill=true}if(this.style.indexOf("ircle")!=-1){aj.isarc=true;aj.closePath=false}this.shadowRenderer.init(aj);var ai={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){ai.fill=true}if(this.style.indexOf("ircle")!=-1){ai.isarc=true;ai.closePath=false}this.shapeRenderer.init(ai)};L.jqplot.MarkerRenderer.prototype.drawDiamond=function(aj,ai,am,al,ao){var ah=1.2;var ap=this.size/2/ah;var an=this.size/2*ah;var ak=[[aj-ap,ai],[aj,ai+an],[aj+ap,ai],[aj,ai-an]];if(this.shadow){this.shadowRenderer.draw(am,ak)}this.shapeRenderer.draw(am,ak,ao)};L.jqplot.MarkerRenderer.prototype.drawPlus=function(ak,aj,an,am,aq){var ai=1;var ar=this.size/2*ai;var ao=this.size/2*ai;var ap=[[ak,aj-ao],[ak,aj+ao]];var al=[[ak+ar,aj],[ak-ar,aj]];var ah=L.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(an,ap,{closePath:false});this.shadowRenderer.draw(an,al,{closePath:false})}this.shapeRenderer.draw(an,ap,ah);this.shapeRenderer.draw(an,al,ah)};L.jqplot.MarkerRenderer.prototype.drawX=function(ak,aj,an,am,aq){var ai=1;var ar=this.size/2*ai;var ao=this.size/2*ai;var ah=L.extend(true,{},this.options,{closePath:false});var ap=[[ak-ar,aj-ao],[ak+ar,aj+ao]];var al=[[ak-ar,aj+ao],[ak+ar,aj-ao]];if(this.shadow){this.shadowRenderer.draw(an,ap,{closePath:false});this.shadowRenderer.draw(an,al,{closePath:false})}this.shapeRenderer.draw(an,ap,ah);this.shapeRenderer.draw(an,al,ah)};L.jqplot.MarkerRenderer.prototype.drawDash=function(aj,ai,am,al,ao){var ah=1;var ap=this.size/2*ah;var an=this.size/2*ah;var ak=[[aj-ap,ai],[aj+ap,ai]];if(this.shadow){this.shadowRenderer.draw(am,ak)}this.shapeRenderer.draw(am,ak,ao)};L.jqplot.MarkerRenderer.prototype.drawLine=function(am,al,ah,ak,ai){var aj=[am,al];if(this.shadow){this.shadowRenderer.draw(ah,aj)}this.shapeRenderer.draw(ah,aj,ai)};L.jqplot.MarkerRenderer.prototype.drawSquare=function(aj,ai,am,al,ao){var ah=1;var ap=this.size/2/ah;var an=this.size/2*ah;var ak=[[aj-ap,ai-an],[aj-ap,ai+an],[aj+ap,ai+an],[aj+ap,ai-an]];if(this.shadow){this.shadowRenderer.draw(am,ak)}this.shapeRenderer.draw(am,ak,ao)};L.jqplot.MarkerRenderer.prototype.drawCircle=function(ai,ao,ak,an,al){var ah=this.size/2;var aj=2*Math.PI;var am=[ai,ao,ah,0,aj,true];if(this.shadow){this.shadowRenderer.draw(ak,am)}this.shapeRenderer.draw(ak,am,al)};L.jqplot.MarkerRenderer.prototype.draw=function(ah,ak,ai,aj){aj=aj||{};if(aj.show==null||aj.show!=false){if(aj.color&&!aj.fillStyle){aj.fillStyle=aj.color}if(aj.color&&!aj.strokeStyle){aj.strokeStyle=aj.color}switch(this.style){case"diamond":this.drawDiamond(ah,ak,ai,false,aj);break;case"filledDiamond":this.drawDiamond(ah,ak,ai,true,aj);break;case"circle":this.drawCircle(ah,ak,ai,false,aj);break;case"filledCircle":this.drawCircle(ah,ak,ai,true,aj);break;case"square":this.drawSquare(ah,ak,ai,false,aj);break;case"filledSquare":this.drawSquare(ah,ak,ai,true,aj);break;case"x":this.drawX(ah,ak,ai,true,aj);break;case"plus":this.drawPlus(ah,ak,ai,true,aj);break;case"dash":this.drawDash(ah,ak,ai,true,aj);break;case"line":this.drawLine(ah,ak,ai,false,aj);break;default:this.drawDiamond(ah,ak,ai,false,aj);break}}};L.jqplot.ShadowRenderer=function(ah){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.strokeStyle="rgba(0,0,0,0.1)";this.isarc=false;L.extend(true,this,ah)};L.jqplot.ShadowRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.ShadowRenderer.prototype.draw=function(av,at,ax){av.save();var ah=(ax!=null)?ax:{};var au=(ah.fill!=null)?ah.fill:this.fill;var ap=(ah.fillRect!=null)?ah.fillRect:this.fillRect;var ao=(ah.closePath!=null)?ah.closePath:this.closePath;var al=(ah.offset!=null)?ah.offset:this.offset;var aj=(ah.alpha!=null)?ah.alpha:this.alpha;var an=(ah.depth!=null)?ah.depth:this.depth;var aw=(ah.isarc!=null)?ah.isarc:this.isarc;var aq=(ah.linePattern!=null)?ah.linePattern:this.linePattern;av.lineWidth=(ah.lineWidth!=null)?ah.lineWidth:this.lineWidth;av.lineJoin=(ah.lineJoin!=null)?ah.lineJoin:this.lineJoin;av.lineCap=(ah.lineCap!=null)?ah.lineCap:this.lineCap;av.strokeStyle=ah.strokeStyle||this.strokeStyle||"rgba(0,0,0,"+aj+")";av.fillStyle=ah.fillStyle||this.fillStyle||"rgba(0,0,0,"+aj+")";for(var ak=0;ak<an;ak++){var ar=L.jqplot.LinePattern(av,aq);av.translate(Math.cos(this.angle*Math.PI/180)*al,Math.sin(this.angle*Math.PI/180)*al);ar.beginPath();if(aw){av.arc(at[0],at[1],at[2],at[3],at[4],true)}else{if(ap){if(ap){av.fillRect(at[0],at[1],at[2],at[3])}}else{if(at&&at.length){var ai=true;for(var am=0;am<at.length;am++){if(at[am][0]!=null&&at[am][1]!=null){if(ai){ar.moveTo(at[am][0],at[am][1]);ai=false}else{ar.lineTo(at[am][0],at[am][1])}}else{ai=true}}}}}if(ao){ar.closePath()}if(au){av.fill()}else{av.stroke()}}av.restore()};L.jqplot.ShapeRenderer=function(ah){this.lineWidth=1.5;this.linePattern="solid";this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.isarc=false;this.fillRect=false;this.strokeRect=false;this.clearRect=false;this.strokeStyle="#999999";this.fillStyle="#999999";L.extend(true,this,ah)};L.jqplot.ShapeRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.ShapeRenderer.prototype.draw=function(at,aq,av){at.save();var ah=(av!=null)?av:{};var ar=(ah.fill!=null)?ah.fill:this.fill;var am=(ah.closePath!=null)?ah.closePath:this.closePath;var an=(ah.fillRect!=null)?ah.fillRect:this.fillRect;var ak=(ah.strokeRect!=null)?ah.strokeRect:this.strokeRect;var ai=(ah.clearRect!=null)?ah.clearRect:this.clearRect;var au=(ah.isarc!=null)?ah.isarc:this.isarc;var ao=(ah.linePattern!=null)?ah.linePattern:this.linePattern;var ap=L.jqplot.LinePattern(at,ao);at.lineWidth=ah.lineWidth||this.lineWidth;at.lineJoin=ah.lineJoin||this.lineJoin;at.lineCap=ah.lineCap||this.lineCap;at.strokeStyle=(ah.strokeStyle||ah.color)||this.strokeStyle;at.fillStyle=ah.fillStyle||this.fillStyle;at.beginPath();if(au){at.arc(aq[0],aq[1],aq[2],aq[3],aq[4],true);if(am){at.closePath()}if(ar){at.fill()}else{at.stroke()}at.restore();return}else{if(ai){at.clearRect(aq[0],aq[1],aq[2],aq[3]);at.restore();return}else{if(an||ak){if(an){at.fillRect(aq[0],aq[1],aq[2],aq[3])}if(ak){at.strokeRect(aq[0],aq[1],aq[2],aq[3]);at.restore();return}}else{if(aq&&aq.length){var aj=true;for(var al=0;al<aq.length;al++){if(aq[al][0]!=null&&aq[al][1]!=null){if(aj){ap.moveTo(aq[al][0],aq[al][1]);aj=false}else{ap.lineTo(aq[al][0],aq[al][1])}}else{aj=true}}if(am){ap.closePath()}if(ar){at.fill()}else{at.stroke()}}}}}at.restore()};L.jqplot.TableLegendRenderer=function(){};L.jqplot.TableLegendRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.TableLegendRenderer.prototype.addrow=function(aq,ak,ah,ao){var al=(ah)?this.rowSpacing+"px":"0px";var ap;var aj;var ai;var an;var am;ai=document.createElement("tr");ap=L(ai);ap.addClass("jqplot-table-legend");ai=null;if(ao){ap.prependTo(this._elem)}else{ap.appendTo(this._elem)}if(this.showSwatches){aj=L(document.createElement("td"));aj.addClass("jqplot-table-legend jqplot-table-legend-swatch");aj.css({textAlign:"center",paddingTop:al});an=L(document.createElement("div"));an.addClass("jqplot-table-legend-swatch-outline");am=L(document.createElement("div"));am.addClass("jqplot-table-legend-swatch");am.css({backgroundColor:ak,borderColor:ak});ap.append(aj.append(an.append(am)))}if(this.showLabels){aj=L(document.createElement("td"));aj.addClass("jqplot-table-legend jqplot-table-legend-label");aj.css("paddingTop",al);ap.append(aj);if(this.escapeHtml){aj.text(aq)}else{aj.html(aq)}}aj=null;an=null;am=null;ap=null;ai=null};L.jqplot.TableLegendRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}if(this.show){var am=this._series;var ai=document.createElement("table");this._elem=L(ai);this._elem.addClass("jqplot-table-legend");var ar={position:"absolute"};if(this.background){ar.background=this.background}if(this.border){ar.border=this.border}if(this.fontSize){ar.fontSize=this.fontSize}if(this.fontFamily){ar.fontFamily=this.fontFamily}if(this.textColor){ar.textColor=this.textColor}if(this.marginTop!=null){ar.marginTop=this.marginTop}if(this.marginBottom!=null){ar.marginBottom=this.marginBottom}if(this.marginLeft!=null){ar.marginLeft=this.marginLeft}if(this.marginRight!=null){ar.marginRight=this.marginRight}var ah=false,ao=false,aq;for(var an=0;an<am.length;an++){aq=am[an];if(aq._stack||aq.renderer.constructor==L.jqplot.BezierCurveRenderer){ao=true}if(aq.show&&aq.showLabel){var al=this.labels[an]||aq.label.toString();if(al){var aj=aq.color;if(ao&&an<am.length-1){ah=true}else{if(ao&&an==am.length-1){ah=false}}this.renderer.addrow.call(this,al,aj,ah,ao);ah=true}for(var ak=0;ak<L.jqplot.addLegendRowHooks.length;ak++){var ap=L.jqplot.addLegendRowHooks[ak].call(this,aq);if(ap){this.renderer.addrow.call(this,ap.label,ap.color,ah);ah=true}}al=null}}}return this._elem};L.jqplot.TableLegendRenderer.prototype.pack=function(aj){if(this.show){if(this.placement=="insideGrid"){switch(this.location){case"nw":var ai=aj.left;var ah=aj.top;this._elem.css("left",ai);this._elem.css("top",ah);break;case"n":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=aj.top;this._elem.css("left",ai);this._elem.css("top",ah);break;case"ne":var ai=aj.right;var ah=aj.top;this._elem.css({right:ai,top:ah});break;case"e":var ai=aj.right;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({right:ai,top:ah});break;case"se":var ai=aj.right;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break;case"s":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=aj.bottom;this._elem.css({left:ai,bottom:ah});break;case"sw":var ai=aj.left;var ah=aj.bottom;this._elem.css({left:ai,bottom:ah});break;case"w":var ai=aj.left;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({left:ai,top:ah});break;default:var ai=aj.right;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break}}else{if(this.placement=="outside"){switch(this.location){case"nw":var ai=this._plotDimensions.width-aj.left;var ah=aj.top;this._elem.css("right",ai);this._elem.css("top",ah);break;case"n":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=this._plotDimensions.height-aj.top;this._elem.css("left",ai);this._elem.css("bottom",ah);break;case"ne":var ai=this._plotDimensions.width-aj.right;var ah=aj.top;this._elem.css({left:ai,top:ah});break;case"e":var ai=this._plotDimensions.width-aj.right;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({left:ai,top:ah});break;case"se":var ai=this._plotDimensions.width-aj.right;var ah=aj.bottom;this._elem.css({left:ai,bottom:ah});break;case"s":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=this._plotDimensions.height-aj.bottom;this._elem.css({left:ai,top:ah});break;case"sw":var ai=this._plotDimensions.width-aj.left;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break;case"w":var ai=this._plotDimensions.width-aj.left;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({right:ai,top:ah});break;default:var ai=aj.right;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break}}else{switch(this.location){case"nw":this._elem.css({left:0,top:aj.top});break;case"n":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;this._elem.css({left:ai,top:aj.top});break;case"ne":this._elem.css({right:0,top:aj.top});break;case"e":var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({right:aj.right,top:ah});break;case"se":this._elem.css({right:aj.right,bottom:aj.bottom});break;case"s":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;this._elem.css({left:ai,bottom:aj.bottom});break;case"sw":this._elem.css({left:aj.left,bottom:aj.bottom});break;case"w":var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({left:aj.left,top:ah});break;default:this._elem.css({right:aj.right,bottom:aj.bottom});break}}}}};L.jqplot.ThemeEngine=function(){this.themes={};this.activeTheme=null};L.jqplot.ThemeEngine.prototype.init=function(){var ak=new L.jqplot.Theme({_name:"Default"});var an,ai,am;for(an in ak.target){if(an=="textColor"){ak.target[an]=this.target.css("color")}else{ak.target[an]=this.target.css(an)}}if(this.title.show&&this.title._elem){for(an in ak.title){if(an=="textColor"){ak.title[an]=this.title._elem.css("color")}else{ak.title[an]=this.title._elem.css(an)}}}for(an in ak.grid){ak.grid[an]=this.grid[an]}if(ak.grid.backgroundColor==null&&this.grid.background!=null){ak.grid.backgroundColor=this.grid.background}if(this.legend.show&&this.legend._elem){for(an in ak.legend){if(an=="textColor"){ak.legend[an]=this.legend._elem.css("color")}else{ak.legend[an]=this.legend._elem.css(an)}}}var aj;for(ai=0;ai<this.series.length;ai++){aj=this.series[ai];if(aj.renderer.constructor==L.jqplot.LineRenderer){ak.series.push(new p())}else{if(aj.renderer.constructor==L.jqplot.BarRenderer){ak.series.push(new T())}else{if(aj.renderer.constructor==L.jqplot.PieRenderer){ak.series.push(new f())}else{if(aj.renderer.constructor==L.jqplot.DonutRenderer){ak.series.push(new G())}else{if(aj.renderer.constructor==L.jqplot.FunnelRenderer){ak.series.push(new Z())}else{if(aj.renderer.constructor==L.jqplot.MeterGaugeRenderer){ak.series.push(new D())}else{ak.series.push({})}}}}}}for(an in ak.series[ai]){ak.series[ai][an]=aj[an]}}var ah,al;for(an in this.axes){al=this.axes[an];ah=ak.axes[an]=new P();ah.borderColor=al.borderColor;ah.borderWidth=al.borderWidth;if(al._ticks&&al._ticks[0]){for(am in ah.ticks){if(al._ticks[0].hasOwnProperty(am)){ah.ticks[am]=al._ticks[0][am]}else{if(al._ticks[0]._elem){ah.ticks[am]=al._ticks[0]._elem.css(am)}}}}if(al._label&&al._label.show){for(am in ah.label){if(al._label[am]){ah.label[am]=al._label[am]}else{if(al._label._elem){if(am=="textColor"){ah.label[am]=al._label._elem.css("color")}else{ah.label[am]=al._label._elem.css(am)}}}}}}this.themeEngine._add(ak);this.themeEngine.activeTheme=this.themeEngine.themes[ak._name]};L.jqplot.ThemeEngine.prototype.get=function(ah){if(!ah){return this.activeTheme}else{return this.themes[ah]}};function O(ai,ah){return ai-ah}L.jqplot.ThemeEngine.prototype.getThemeNames=function(){var ah=[];for(var ai in this.themes){ah.push(ai)}return ah.sort(O)};L.jqplot.ThemeEngine.prototype.getThemes=function(){var ai=[];var ah=[];for(var ak in this.themes){ai.push(ak)}ai.sort(O);for(var aj=0;aj<ai.length;aj++){ah.push(this.themes[ai[aj]])}return ah};L.jqplot.ThemeEngine.prototype.activate=function(av,aB){var ah=false;if(!aB&&this.activeTheme&&this.activeTheme._name){aB=this.activeTheme._name}if(!this.themes.hasOwnProperty(aB)){throw new Error("No theme of that name")}else{var am=this.themes[aB];this.activeTheme=am;var aA,at=false,ar=false;var ai=["xaxis","x2axis","yaxis","y2axis"];for(aw=0;aw<ai.length;aw++){var an=ai[aw];if(am.axesStyles.borderColor!=null){av.axes[an].borderColor=am.axesStyles.borderColor}if(am.axesStyles.borderWidth!=null){av.axes[an].borderWidth=am.axesStyles.borderWidth}}for(var az in av.axes){var ak=av.axes[az];if(ak.show){var aq=am.axes[az]||{};var ao=am.axesStyles;var al=L.jqplot.extend(true,{},aq,ao);aA=(am.axesStyles.borderColor!=null)?am.axesStyles.borderColor:al.borderColor;if(al.borderColor!=null){ak.borderColor=al.borderColor;ah=true}aA=(am.axesStyles.borderWidth!=null)?am.axesStyles.borderWidth:al.borderWidth;if(al.borderWidth!=null){ak.borderWidth=al.borderWidth;ah=true}if(ak._ticks&&ak._ticks[0]){for(var aj in al.ticks){aA=al.ticks[aj];if(aA!=null){ak.tickOptions[aj]=aA;ak._ticks=[];ah=true}}}if(ak._label&&ak._label.show){for(var aj in al.label){aA=al.label[aj];if(aA!=null){ak.labelOptions[aj]=aA;ah=true}}}}}for(var au in am.grid){if(am.grid[au]!=null){av.grid[au]=am.grid[au]}}if(!ah){av.grid.draw()}if(av.legend.show){for(au in am.legend){if(am.legend[au]!=null){av.legend[au]=am.legend[au]}}}if(av.title.show){for(au in am.title){if(am.title[au]!=null){av.title[au]=am.title[au]}}}var aw;for(aw=0;aw<am.series.length;aw++){var ap={};var ay=false;for(au in am.series[aw]){aA=(am.seriesStyles[au]!=null)?am.seriesStyles[au]:am.series[aw][au];if(aA!=null){ap[au]=aA;if(au=="color"){av.series[aw].renderer.shapeRenderer.fillStyle=aA;av.series[aw].renderer.shapeRenderer.strokeStyle=aA;av.series[aw][au]=aA}else{if((au=="lineWidth")||(au=="linePattern")){av.series[aw].renderer.shapeRenderer[au]=aA;av.series[aw][au]=aA}else{if(au=="markerOptions"){V(av.series[aw].markerOptions,aA);V(av.series[aw].markerRenderer,aA)}else{av.series[aw][au]=aA}}}ah=true}}}if(ah){av.target.empty();av.draw()}for(au in am.target){if(am.target[au]!=null){av.target.css(au,am.target[au])}}}};L.jqplot.ThemeEngine.prototype._add=function(ai,ah){if(ah){ai._name=ah}if(!ai._name){ai._name=Date.parse(new Date())}if(!this.themes.hasOwnProperty(ai._name)){this.themes[ai._name]=ai}else{throw new Error("jqplot.ThemeEngine Error: Theme already in use")}};L.jqplot.ThemeEngine.prototype.remove=function(ah){if(ah=="Default"){return false}return delete this.themes[ah]};L.jqplot.ThemeEngine.prototype.newTheme=function(ah,aj){if(typeof(ah)=="object"){aj=aj||ah;ah=null}if(aj&&aj._name){ah=aj._name}else{ah=ah||Date.parse(new Date())}var ai=this.copy(this.themes.Default._name,ah);L.jqplot.extend(ai,aj);return ai};function B(aj){if(aj==null||typeof(aj)!="object"){return aj}var ah=new aj.constructor();for(var ai in aj){ah[ai]=B(aj[ai])}return ah}L.jqplot.clone=B;function V(aj,ai){if(ai==null||typeof(ai)!="object"){return}for(var ah in ai){if(ah=="highlightColors"){aj[ah]=B(ai[ah])}if(ai[ah]!=null&&typeof(ai[ah])=="object"){if(!aj.hasOwnProperty(ah)){aj[ah]={}}V(aj[ah],ai[ah])}else{aj[ah]=ai[ah]}}}L.jqplot.merge=V;L.jqplot.extend=function(){var am=arguments[0]||{},ak=1,al=arguments.length,ah=false,aj;if(typeof am==="boolean"){ah=am;am=arguments[1]||{};ak=2}if(typeof am!=="object"&&!toString.call(am)==="[object Function]"){am={}}for(;ak<al;ak++){if((aj=arguments[ak])!=null){for(var ai in aj){var an=am[ai],ao=aj[ai];if(am===ao){continue}if(ah&&ao&&typeof ao==="object"&&!ao.nodeType){am[ai]=L.jqplot.extend(ah,an||(ao.length!=null?[]:{}),ao)}else{if(ao!==u){am[ai]=ao}}}}}return am};L.jqplot.ThemeEngine.prototype.rename=function(ai,ah){if(ai=="Default"||ah=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot rename from/to Default")}if(this.themes.hasOwnProperty(ah)){throw new Error("jqplot.ThemeEngine Error: New name already in use.")}else{if(this.themes.hasOwnProperty(ai)){var aj=this.copy(ai,ah);this.remove(ai);return aj}}throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid")};L.jqplot.ThemeEngine.prototype.copy=function(ah,aj,al){if(aj=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot copy over Default theme")}if(!this.themes.hasOwnProperty(ah)){var ai="jqplot.ThemeEngine Error: Source name invalid";throw new Error(ai)}if(this.themes.hasOwnProperty(aj)){var ai="jqplot.ThemeEngine Error: Target name invalid";throw new Error(ai)}else{var ak=B(this.themes[ah]);ak._name=aj;L.jqplot.extend(true,ak,al);this._add(ak);return ak}};L.jqplot.Theme=function(ah,ai){if(typeof(ah)=="object"){ai=ai||ah;ah=null}ah=ah||Date.parse(new Date());this._name=ah;this.target={backgroundColor:null};this.legend={textColor:null,fontFamily:null,fontSize:null,border:null,background:null};this.title={textColor:null,fontFamily:null,fontSize:null,textAlign:null};this.seriesStyles={};this.series=[];this.grid={drawGridlines:null,gridLineColor:null,gridLineWidth:null,backgroundColor:null,borderColor:null,borderWidth:null,shadow:null};this.axesStyles={label:{},ticks:{}};this.axes={};if(typeof(ai)=="string"){this._name=ai}else{if(typeof(ai)=="object"){L.jqplot.extend(true,this,ai)}}};var P=function(){this.borderColor=null;this.borderWidth=null;this.ticks=new o();this.label=new t()};var o=function(){this.show=null;this.showGridline=null;this.showLabel=null;this.showMark=null;this.size=null;this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null};var t=function(){this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null;this.fontWeight=null};var p=function(){this.color=null;this.lineWidth=null;this.linePattern=null;this.shadow=null;this.fillColor=null;this.showMarker=null;this.markerOptions=new I()};var I=function(){this.show=null;this.style=null;this.lineWidth=null;this.size=null;this.color=null;this.shadow=null};var T=function(){this.color=null;this.seriesColors=null;this.lineWidth=null;this.shadow=null;this.barPadding=null;this.barMargin=null;this.barWidth=null;this.highlightColors=null};var f=function(){this.seriesColors=null;this.padding=null;this.sliceMargin=null;this.fill=null;this.shadow=null;this.startAngle=null;this.lineWidth=null;this.highlightColors=null};var G=function(){this.seriesColors=null;this.padding=null;this.sliceMargin=null;this.fill=null;this.shadow=null;this.startAngle=null;this.lineWidth=null;this.innerDiameter=null;this.thickness=null;this.ringMargin=null;this.highlightColors=null};var Z=function(){this.color=null;this.lineWidth=null;this.shadow=null;this.padding=null;this.sectionMargin=null;this.seriesColors=null;this.highlightColors=null};var D=function(){this.padding=null;this.backgroundColor=null;this.ringColor=null;this.tickColor=null;this.ringWidth=null;this.intervalColors=null;this.intervalInnerRadius=null;this.intervalOuterRadius=null;this.hubRadius=null;this.needleThickness=null;this.needlePad=null};L.fn.jqplotChildText=function(){return L(this).contents().filter(function(){return this.nodeType==3}).text()};L.fn.jqplotGetComputedFontStyle=function(){var ak=window.getComputedStyle?window.getComputedStyle(this[0],""):this[0].currentStyle;var ai=ak["font-style"]?["font-style","font-weight","font-size","font-family"]:["fontStyle","fontWeight","fontSize","fontFamily"];var al=[];for(var aj=0;aj<ai.length;++aj){var ah=String(ak[ai[aj]]);if(ah&&ah!="normal"){al.push(ah)}}return al.join(" ")};L.fn.jqplotToImageCanvas=function(aj){aj=aj||{};var av=(aj.x_offset==null)?0:aj.x_offset;var ax=(aj.y_offset==null)?0:aj.y_offset;var al=(aj.backgroundColor==null)?"rgb(255,255,255)":aj.backgroundColor;if(L(this).width()==0||L(this).height()==0){return null}if(L.jqplot.use_excanvas){return null}var an=document.createElement("canvas");var aA=L(this).outerHeight(true);var at=L(this).outerWidth(true);var am=L(this).offset();var ao=am.left;var aq=am.top;var au=0,ar=0;var ay=["jqplot-table-legend","jqplot-xaxis-tick","jqplot-x2axis-tick","jqplot-yaxis-tick","jqplot-y2axis-tick","jqplot-y3axis-tick","jqplot-y4axis-tick","jqplot-y5axis-tick","jqplot-y6axis-tick","jqplot-y7axis-tick","jqplot-y8axis-tick","jqplot-y9axis-tick","jqplot-xaxis-label","jqplot-x2axis-label","jqplot-yaxis-label","jqplot-y2axis-label","jqplot-y3axis-label","jqplot-y4axis-label","jqplot-y5axis-label","jqplot-y6axis-label","jqplot-y7axis-label","jqplot-y8axis-label","jqplot-y9axis-label"];var ap,ah,ai,aB;for(var az=0;az<ay.length;az++){L(this).find("."+ay[az]).each(function(){ap=L(this).offset().top-aq;ah=L(this).offset().left-ao;aB=ah+L(this).outerWidth(true)+au;ai=ap+L(this).outerHeight(true)+ar;if(ah<-au){at=at-au-ah;au=-ah}if(ap<-ar){aA=aA-ar-ap;ar=-ap}if(aB>at){at=aB}if(ai>aA){aA=ai}})}an.width=at+Number(av);an.height=aA+Number(ax);var ak=an.getContext("2d");ak.save();ak.fillStyle=al;ak.fillRect(0,0,an.width,an.height);ak.restore();ak.translate(au,ar);ak.textAlign="left";ak.textBaseline="top";function aC(aE){var aF=parseInt(L(aE).css("line-height"),10);if(isNaN(aF)){aF=parseInt(L(aE).css("font-size"),10)*1.2}return aF}function aD(aF,aE,aS,aG,aO,aH){var aQ=aC(aF);var aK=L(aF).innerWidth();var aL=L(aF).innerHeight();var aN=aS.split(/\s+/);var aR=aN.length;var aP="";var aM=[];var aU=aO;var aT=aG;for(var aJ=0;aJ<aR;aJ++){aP+=aN[aJ];if(aE.measureText(aP).width>aK){aM.push(aJ);aP="";aJ--}}if(aM.length===0){if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aS,aT,aO)}else{aP=aN.slice(0,aM[0]).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU);aU+=aQ;for(var aJ=1,aI=aM.length;aJ<aI;aJ++){aP=aN.slice(aM[aJ-1],aM[aJ]).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU);aU+=aQ}aP=aN.slice(aM[aJ-1],aN.length).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU)}}function aw(aG,aJ,aE){var aN=aG.tagName.toLowerCase();var aF=L(aG).position();var aK=window.getComputedStyle?window.getComputedStyle(aG,""):aG.currentStyle;var aI=aJ+aF.left+parseInt(aK.marginLeft,10)+parseInt(aK.borderLeftWidth,10)+parseInt(aK.paddingLeft,10);var aL=aE+aF.top+parseInt(aK.marginTop,10)+parseInt(aK.borderTopWidth,10)+parseInt(aK.paddingTop,10);var aM=an.width;if((aN=="div"||aN=="span")&&!L(aG).hasClass("jqplot-highlighter-tooltip")){L(aG).children().each(function(){aw(this,aI,aL)});var aO=L(aG).jqplotChildText();if(aO){ak.font=L(aG).jqplotGetComputedFontStyle();ak.fillStyle=L(aG).css("color");aD(aG,ak,aO,aI,aL,aM)}}else{if(aN==="table"&&L(aG).hasClass("jqplot-table-legend")){ak.strokeStyle=L(aG).css("border-top-color");ak.fillStyle=L(aG).css("background-color");ak.fillRect(aI,aL,L(aG).innerWidth(),L(aG).innerHeight());if(parseInt(L(aG).css("border-top-width"),10)>0){ak.strokeRect(aI,aL,L(aG).innerWidth(),L(aG).innerHeight())}L(aG).find("div.jqplot-table-legend-swatch-outline").each(function(){var aU=L(this);ak.strokeStyle=aU.css("border-top-color");var aQ=aI+aU.position().left;var aR=aL+aU.position().top;ak.strokeRect(aQ,aR,aU.innerWidth(),aU.innerHeight());aQ+=parseInt(aU.css("padding-left"),10);aR+=parseInt(aU.css("padding-top"),10);var aT=aU.innerHeight()-2*parseInt(aU.css("padding-top"),10);var aP=aU.innerWidth()-2*parseInt(aU.css("padding-left"),10);var aS=aU.children("div.jqplot-table-legend-swatch");ak.fillStyle=aS.css("background-color");ak.fillRect(aQ,aR,aP,aT)});L(aG).find("td.jqplot-table-legend-label").each(function(){var aR=L(this);var aP=aI+aR.position().left;var aQ=aL+aR.position().top+parseInt(aR.css("padding-top"),10);ak.font=aR.jqplotGetComputedFontStyle();ak.fillStyle=aR.css("color");aD(aR,ak,aR.text(),aP,aQ,aM)});var aH=null}else{if(aN=="canvas"){ak.drawImage(aG,aI,aL)}}}}L(this).children().each(function(){aw(this,av,ax)});return an};L.fn.jqplotToImageStr=function(ai){var ah=L(this).jqplotToImageCanvas(ai);if(ah){return ah.toDataURL("image/png")}else{return null}};L.fn.jqplotToImageElem=function(ah){var ai=document.createElement("img");var aj=L(this).jqplotToImageStr(ah);ai.src=aj;return ai};L.fn.jqplotToImageElemStr=function(ah){var ai="<img src="+L(this).jqplotToImageStr(ah)+" />";return ai};L.fn.jqplotSaveImage=function(){var ah=L(this).jqplotToImageStr({});if(ah){window.location.href=ah.replace("image/png","image/octet-stream")}};L.fn.jqplotViewImage=function(){var ai=L(this).jqplotToImageElemStr({});var aj=L(this).jqplotToImageStr({});if(ai){var ah=window.open("");ah.document.open("image/png");ah.document.write(ai);ah.document.close();ah=null}};var ag=function(){this.syntax=ag.config.syntax;this._type="jsDate";this.proxy=new Date();this.options={};this.locale=ag.regional.getLocale();this.formatString="";this.defaultCentury=ag.config.defaultCentury;switch(arguments.length){case 0:break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai<arguments.length;ai++){ah.push(arguments[ai])}this.proxy=new Date();this.proxy.setFullYear.apply(this.proxy,ah.slice(0,3));if(ah.slice(3).length){this.proxy.setHours.apply(this.proxy,ah.slice(3))}break}};ag.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900};ag.prototype.add=function(aj,ai){var ah=E[ai]||E.day;if(typeof ah=="number"){this.proxy.setTime(this.proxy.getTime()+(ah*aj))}else{ah.add(this,aj)}return this};ag.prototype.clone=function(){return new ag(this.proxy.getTime())};ag.prototype.getUtcOffset=function(){return this.proxy.getTimezoneOffset()*60000};ag.prototype.diff=function(ai,al,ah){ai=new ag(ai);if(ai===null){return null}var aj=E[al]||E.day;if(typeof aj=="number"){var ak=(this.proxy.getTime()-ai.proxy.getTime())/aj}else{var ak=aj.diff(this.proxy,ai.proxy)}return(ah?ak:Math[ak>0?"floor":"ceil"](ak))};ag.prototype.getAbbrDayName=function(){return ag.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]};ag.prototype.getAbbrMonthName=function(){return ag.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]};ag.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"};ag.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"};ag.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)};ag.prototype.getDate=function(){return this.proxy.getDate()};ag.prototype.getDay=function(){return this.proxy.getDay()};ag.prototype.getDayOfWeek=function(){var ah=this.proxy.getDay();return ah===0?7:ah};ag.prototype.getDayOfYear=function(){var ai=this.proxy;var ah=ai-new Date(""+ai.getFullYear()+"/1/1 GMT");ah+=ai.getTimezoneOffset()*60000;ai=null;return parseInt(ah/60000/60/24,10)+1};ag.prototype.getDayName=function(){return ag.regional[this.locale]["dayNames"][this.proxy.getDay()]};ag.prototype.getFullWeekOfYear=function(){var ak=this.proxy;var ah=this.getDayOfYear();var aj=6-ak.getDay();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getFullYear=function(){return this.proxy.getFullYear()};ag.prototype.getGmtOffset=function(){var ah=this.proxy.getTimezoneOffset()/60;var ai=ah<0?"+":"-";ah=Math.abs(ah);return ai+N(Math.floor(ah),2)+":"+N((ah%1)*60,2)};ag.prototype.getHours=function(){return this.proxy.getHours()};ag.prototype.getHours12=function(){var ah=this.proxy.getHours();return ah>12?ah-12:(ah==0?12:ah)};ag.prototype.getIsoWeek=function(){var ak=this.proxy;var aj=this.getWeekOfYear();var ah=(new Date(""+ak.getFullYear()+"/1/1")).getDay();var ai=aj+(ah>4||ah<=1?0:1);if(ai==53&&(new Date(""+ak.getFullYear()+"/12/31")).getDay()<4){ai=1}else{if(ai===0){ak=new ag(new Date(""+(ak.getFullYear()-1)+"/12/31"));ai=ak.getIsoWeek()}}ak=null;return ai};ag.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()};ag.prototype.getMinutes=function(){return this.proxy.getMinutes()};ag.prototype.getMonth=function(){return this.proxy.getMonth()};ag.prototype.getMonthName=function(){return ag.regional[this.locale]["monthNames"][this.proxy.getMonth()]};ag.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1};ag.prototype.getSeconds=function(){return this.proxy.getSeconds()};ag.prototype.getShortYear=function(){return this.proxy.getYear()%100};ag.prototype.getTime=function(){return this.proxy.getTime()};ag.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")};ag.prototype.getTimezoneName=function(){var ah=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return ah[1]||ah[2]||"GMT"+this.getGmtOffset()};ag.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()};ag.prototype.getWeekOfYear=function(){var ah=this.getDayOfYear();var aj=7-this.getDayOfWeek();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1000,0)};ag.prototype.getYear=function(){return this.proxy.getYear()};ag.prototype.next=function(ah){ah=ah||"day";return this.clone().add(1,ah)};ag.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date();break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai<arguments.length;ai++){ah.push(arguments[ai])}this.proxy=new Date();this.proxy.setFullYear.apply(this.proxy,ah.slice(0,3));if(ah.slice(3).length){this.proxy.setHours.apply(this.proxy,ah.slice(3))}break}return this};ag.prototype.setDate=function(ah){this.proxy.setDate(ah);return this};ag.prototype.setFullYear=function(){this.proxy.setFullYear.apply(this.proxy,arguments);return this};ag.prototype.setHours=function(){this.proxy.setHours.apply(this.proxy,arguments);return this};ag.prototype.setMilliseconds=function(ah){this.proxy.setMilliseconds(ah);return this};ag.prototype.setMinutes=function(){this.proxy.setMinutes.apply(this.proxy,arguments);return this};ag.prototype.setMonth=function(){this.proxy.setMonth.apply(this.proxy,arguments);return this};ag.prototype.setSeconds=function(){this.proxy.setSeconds.apply(this.proxy,arguments);return this};ag.prototype.setTime=function(ah){this.proxy.setTime(ah);return this};ag.prototype.setYear=function(){this.proxy.setYear.apply(this.proxy,arguments);return this};ag.prototype.strftime=function(ah){ah=ah||this.formatString||ag.regional[this.locale]["formatString"];return ag.strftime(this,ah,this.syntax)};ag.prototype.toString=function(){return this.proxy.toString()};ag.prototype.toYmdInt=function(){return(this.proxy.getFullYear()*10000)+(this.getMonthNumber()*100)+this.proxy.getDate()};ag.regional={en:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],formatString:"%Y-%m-%d %H:%M:%S"},fr:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthNamesShort:["Jan","Fév","Mar","Avr","Mai","Jun","Jul","Aoû","Sep","Oct","Nov","Déc"],dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],formatString:"%Y-%m-%d %H:%M:%S"},de:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],formatString:"%Y-%m-%d %H:%M:%S"},es:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado"],dayNamesShort:["Dom","Lun","Mar","Mi&eacute;","Juv","Vie","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},ru:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],formatString:"%Y-%m-%d %H:%M:%S"},ar:{monthNames:["كانون الثاني","شباط","آذار","نيسان","آذار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["السبت","الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة"],dayNamesShort:["سبت","أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة"],formatString:"%Y-%m-%d %H:%M:%S"},pt:{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},"pt-BR":{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},pl:{monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthNamesShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],dayNames:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Ni","Pn","Wt","Śr","Cz","Pt","Sb"],formatString:"%Y-%m-%d %H:%M:%S"},nl:{monthNames:["Januari","Februari","Maart","April","Mei","Juni","July","Augustus","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:","["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],dayNamesShort:["Zo","Ma","Di","Wo","Do","Vr","Za"],formatString:"%Y-%m-%d %H:%M:%S"},sv:{monthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthNamesShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],dayNamesShort:["sön","mån","tis","ons","tor","fre","lör"],formatString:"%Y-%m-%d %H:%M:%S"}};ag.regional["en-US"]=ag.regional["en-GB"]=ag.regional.en;ag.regional.getLocale=function(){var ah=ag.config.defaultLocale;if(document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){ah=document.getElementsByTagName("html")[0].lang;if(!ag.regional.hasOwnProperty(ah)){ah=ag.config.defaultLocale}}return ah};var C=24*60*60*1000;var N=function(ah,ak){ah=String(ah);var ai=ak-ah.length;var aj=String(Math.pow(10,ai)).slice(1);return aj.concat(ah)};var E={millisecond:1,second:1000,minute:60*1000,hour:60*60*1000,day:C,week:7*C,month:{add:function(aj,ah){E.year.add(aj,Math[ah>0?"floor":"ceil"](ah/12));var ai=aj.getMonth()+(ah%12);if(ai==12){ai=0;aj.setYear(aj.getFullYear()+1)}else{if(ai==-1){ai=11;aj.setYear(aj.getFullYear()-1)}}aj.setMonth(ai)},diff:function(al,aj){var ah=al.getFullYear()-aj.getFullYear();var ai=al.getMonth()-aj.getMonth()+(ah*12);var ak=al.getDate()-aj.getDate();return ai+(ak/30)}},year:{add:function(ai,ah){ai.setYear(ai.getFullYear()+Math[ah>0?"floor":"ceil"](ah))},diff:function(ai,ah){return E.month.diff(ai,ah)/12}}};for(var Y in E){if(Y.substring(Y.length-1)!="s"){E[Y+"s"]=E[Y]}}var H=function(al,ak,ai){if(ag.formats[ai]["shortcuts"][ak]){return ag.strftime(al,ag.formats[ai]["shortcuts"][ak],ai)}else{var ah=(ag.formats[ai]["codes"][ak]||"").split(".");var aj=al["get"+ah[0]]?al["get"+ah[0]]():"";if(ah[1]){aj=N(aj,ah[1])}return aj}};ag.strftime=function(an,ak,aj,ao){var ai="perl";var am=ag.regional.getLocale();if(aj&&ag.formats.hasOwnProperty(aj)){ai=aj}else{if(aj&&ag.regional.hasOwnProperty(aj)){am=aj}}if(ao&&ag.formats.hasOwnProperty(ao)){ai=ao}else{if(ao&&ag.regional.hasOwnProperty(ao)){am=ao}}if(l(an)!="[object Object]"||an._type!="jsDate"){an=new ag(an);an.locale=am}if(!ak){ak=an.formatString||ag.regional[am]["formatString"]}var ah=ak||"%Y-%m-%d",ap="",al;while(ah.length>0){if(al=ah.match(ag.formats[ai].codes.matcher)){ap+=ah.slice(0,al.index);ap+=(al[1]||"")+H(an,al[2],ai);ah=ah.slice(al.index+al[0].length)}else{ap+=ah;ah=""}}return ap};ag.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"};ag.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.createDate=function(aj){if(aj==null){return new Date()}if(aj instanceof Date){return aj}if(typeof aj=="number"){return new Date(aj)}var ao=String(aj).replace(/^\s*(.+)\s*$/g,"$1");ao=ao.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var an=ao.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(an&&an.length>3){var at=parseFloat(an[3]);var am=ag.config.defaultCentury+at;am=String(am);ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,an[1]+" "+an[2]+" "+am)}an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);function ar(ax,aw){var aC=parseFloat(aw[1]);var aB=parseFloat(aw[2]);var aA=parseFloat(aw[3]);var az=ag.config.defaultCentury;var av,au,aD,ay;if(aC>31){au=aA;aD=aB;av=az+aC}else{au=aB;aD=aC;av=az+aA}ay=aD+"/"+au+"/"+av;return ax.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,ay)}if(an&&an.length>3){ao=ar(ao,an)}var an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);if(an&&an.length>3){ao=ar(ao,an)}var al=0;var ai=ag.matchers.length;var aq,ah,ap=ao,ak;while(al<ai){ah=Date.parse(ap);if(!isNaN(ah)){return new Date(ah)}aq=ag.matchers[al];if(typeof aq=="function"){ak=aq.call(ag,ap);if(ak instanceof Date){return ak}}else{ap=ao.replace(aq[0],aq[1])}al++}return NaN};ag.daysInMonth=function(ah,ai){if(ai==2){return new Date(ah,1,29).getDate()==29?29:28}return[u,31,u,31,30,31,30,31,31,30,31,30,31][ai]};ag.matchers=[[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,"$2/$1/$3"],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,"$2/$3/$1"],function(ak){var ai=ak.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(ai){if(ai[1]){var aj=this.createDate(ai[1]);if(isNaN(aj)){return}}else{var aj=new Date();aj.setMilliseconds(0)}var ah=parseFloat(ai[2]);if(ai[6]){ah=ai[6].toLowerCase()=="am"?(ah==12?0:ah):(ah==12?12:ah+12)}aj.setHours(ah,parseInt(ai[3]||0,10),parseInt(ai[4]||0,10),((parseFloat(ai[5]||0))||0)*1000);return aj}else{return ak}},function(ak){var ai=ak.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(ai){if(ai[1]){var aj=this.createDate(ai[1]);if(isNaN(aj)){return}}else{var aj=new Date();aj.setMilliseconds(0)}var ah=parseFloat(ai[2]);aj.setHours(ah,parseInt(ai[3],10),parseInt(ai[4],10),parseFloat(ai[5])*1000);return aj}else{return ak}},function(al){var aj=al.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(aj){var ak=new Date();var am=ag.config.defaultCentury;var ao=parseFloat(aj[1]);var an=parseFloat(aj[3]);var ai,ah,ap;if(ao>31){ah=an;ai=am+ao}else{ah=ao;ai=am+an}var ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNamesShort"]);if(ap==-1){ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNames"])}ak.setFullYear(ai,ap,ah);ak.setHours(0,0,0,0);return ak}else{return al}}];function ab(aj,ak){if(ak.indexOf){return ak.indexOf(aj)}for(var ah=0,ai=ak.length;ah<ai;ah++){if(ak[ah]===aj){return ah}}return -1}function l(ah){if(ah===null){return"[object Null]"}return Object.prototype.toString.call(ah)}L.jsDate=ag;L.jqplot.sprintf=function(){function an(au,ap,aq,at){var ar=(au.length>=ap)?"":Array(1+ap-au.length>>>0).join(aq);return at?au+ar:ar+au}function ak(ar){var aq=new String(ar);for(var ap=10;ap>0;ap--){if(aq==(aq=aq.replace(/^(\d+)(\d{3})/,"$1"+L.jqplot.sprintf.thousandsSeparator+"$2"))){break}}return aq}function aj(av,au,ax,ar,at,aq){var aw=ar-av.length;if(aw>0){var ap=" ";if(aq){ap="&nbsp;"}if(ax||!at){av=an(av,ar,ap,ax)}else{av=av.slice(0,au.length)+an("",aw,"0",true)+av.slice(au.length)}}return av}function ao(ay,aq,aw,ar,ap,av,ax,au){var at=ay>>>0;aw=aw&&at&&{"2":"0b","8":"0","16":"0x"}[aq]||"";ay=aw+an(at.toString(aq),av||0,"0",false);return aj(ay,aw,ar,ap,ax,au)}function ah(au,av,ar,ap,at,aq){if(ap!=null){au=au.slice(0,ap)}return aj(au,"",av,ar,at,aq)}var ai=arguments,al=0,am=ai[al++];return am.replace(L.jqplot.sprintf.regex,function(aM,ax,ay,aB,aO,aJ,av){if(aM=="%%"){return"%"}var aD=false,az="",aA=false,aL=false,aw=false,au=false;for(var aI=0;ay&&aI<ay.length;aI++){switch(ay.charAt(aI)){case" ":az=" ";break;case"+":az="+";break;case"-":aD=true;break;case"0":aA=true;break;case"#":aL=true;break;case"&":aw=true;break;case"'":au=true;break}}if(!aB){aB=0}else{if(aB=="*"){aB=+ai[al++]}else{if(aB.charAt(0)=="*"){aB=+ai[aB.slice(1,-1)]}else{aB=+aB}}}if(aB<0){aB=-aB;aD=true}if(!isFinite(aB)){throw new Error("$.jqplot.sprintf: (minimum-)width must be finite")}if(!aJ){aJ="fFeE".indexOf(av)>-1?6:(av=="d")?0:void (0)}else{if(aJ=="*"){aJ=+ai[al++]}else{if(aJ.charAt(0)=="*"){aJ=+ai[aJ.slice(1,-1)]}else{aJ=+aJ}}}var aF=ax?ai[ax.slice(0,-1)]:ai[al++];switch(av){case"s":if(aF==null){return""}return ah(String(aF),aD,aB,aJ,aA,aw);case"c":return ah(String.fromCharCode(+aF),aD,aB,aJ,aA,aw);case"b":return ao(aF,2,aL,aD,aB,aJ,aA,aw);case"o":return ao(aF,8,aL,aD,aB,aJ,aA,aw);case"x":return ao(aF,16,aL,aD,aB,aJ,aA,aw);case"X":return ao(aF,16,aL,aD,aB,aJ,aA,aw).toUpperCase();case"u":return ao(aF,10,aL,aD,aB,aJ,aA,aw);case"i":var ar=parseInt(+aF,10);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"d":var ar=Math.round(+aF);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"e":case"E":case"f":case"F":case"g":case"G":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var at=["toExponential","toFixed","toPrecision"]["efg".indexOf(av.toLowerCase())];var aN=["toString","toUpperCase"]["eEfFgG".indexOf(av)%2];var aK=Math.abs(ar)[at](aJ);var aE=aK.toString().split(".");aE[0]=au?ak(aE[0]):aE[0];aK=aE.join(L.jqplot.sprintf.decimalMark);aF=aH+aK;var aC=aj(aF,aH,aD,aB,aA,aw)[aN]();return aC;case"p":case"P":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aE=String(Number(Math.abs(ar)).toExponential()).split(/e|E/);var aq=(aE[0].indexOf(".")!=-1)?aE[0].length-1:String(ar).length;var aG=(aE[1]<0)?-aE[1]-1:0;if(Math.abs(ar)<1){if(aq+aG<=aJ){aF=aH+Math.abs(ar).toPrecision(aq)}else{if(aq<=aJ-1){aF=aH+Math.abs(ar).toExponential(aq-1)}else{aF=aH+Math.abs(ar).toExponential(aJ-1)}}}else{var ap=(aq<=aJ)?aq:aJ;aF=aH+Math.abs(ar).toPrecision(ap)}var aN=["toString","toUpperCase"]["pP".indexOf(av)%2];return aj(aF,aH,aD,aB,aA,aw)[aN]();case"n":return"";default:return aM}})};L.jqplot.sprintf.thousandsSeparator=",";L.jqplot.sprintf.decimalMark=".";L.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;L.jqplot.getSignificantFigures=function(al){var an=String(Number(Math.abs(al)).toExponential()).split(/e|E/);var am=(an[0].indexOf(".")!=-1)?an[0].length-1:an[0].length;var ai=(an[1]<0)?-an[1]-1:0;var ah=parseInt(an[1],10);var aj=(ah+1>0)?ah+1:0;var ak=(am<=aj)?0:am-ah-1;return{significantDigits:am,digitsLeft:aj,digitsRight:ak,zeros:ai,exponent:ah}};L.jqplot.getPrecision=function(ah){return L.jqplot.getSignificantFigures(ah).digitsRight};var X=L.uiBackCompat!==false;L.jqplot.effects={effect:{}};var m="jqplot.storage.";L.extend(L.jqplot.effects,{version:"1.9pre",save:function(ai,aj){for(var ah=0;ah<aj.length;ah++){if(aj[ah]!==null){ai.data(m+aj[ah],ai[0].style[aj[ah]])}}},restore:function(ai,aj){for(var ah=0;ah<aj.length;ah++){if(aj[ah]!==null){ai.css(aj[ah],ai.data(m+aj[ah]))}}},setMode:function(ah,ai){if(ai==="toggle"){ai=ah.is(":hidden")?"show":"hide"}return ai},createWrapper:function(ai){if(ai.parent().is(".ui-effects-wrapper")){return ai.parent()}var aj={width:ai.outerWidth(true),height:ai.outerHeight(true),"float":ai.css("float")},al=L("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),ah={width:ai.width(),height:ai.height()},ak=document.activeElement;ai.wrap(al);if(ai[0]===ak||L.contains(ai[0],ak)){L(ak).focus()}al=ai.parent();if(ai.css("position")==="static"){al.css({position:"relative"});ai.css({position:"relative"})}else{L.extend(aj,{position:ai.css("position"),zIndex:ai.css("z-index")});L.each(["top","left","bottom","right"],function(am,an){aj[an]=ai.css(an);if(isNaN(parseInt(aj[an],10))){aj[an]="auto"}});ai.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}ai.css(ah);return al.css(aj).show()},removeWrapper:function(ah){var ai=document.activeElement;if(ah.parent().is(".ui-effects-wrapper")){ah.parent().replaceWith(ah);if(ah[0]===ai||L.contains(ah[0],ai)){L(ai).focus()}}return ah}});function j(ai,ah,aj,ak){if(L.isPlainObject(ai)){return ai}ai={effect:ai};if(ah===u){ah={}}if(L.isFunction(ah)){ak=ah;aj=null;ah={}}if(L.type(ah)==="number"||L.fx.speeds[ah]){ak=aj;aj=ah;ah={}}if(L.isFunction(aj)){ak=aj;aj=null}if(ah){L.extend(ai,ah)}aj=aj||ah.duration;ai.duration=L.fx.off?0:typeof aj==="number"?aj:aj in L.fx.speeds?L.fx.speeds[aj]:L.fx.speeds._default;ai.complete=ak||ah.complete;return ai}function ae(ah){if(!ah||typeof ah==="number"||L.fx.speeds[ah]){return true}if(typeof ah==="string"&&!L.jqplot.effects.effect[ah]){if(X&&L.jqplot.effects[ah]){return false}return true}return false}L.fn.extend({jqplotEffect:function(ap,aq,ai,ao){var an=j.apply(this,arguments),ak=an.mode,al=an.queue,am=L.jqplot.effects.effect[an.effect],ah=!am&&X&&L.jqplot.effects[an.effect];if(L.fx.off||!(am||ah)){if(ak){return this[ak](an.duration,an.complete)}else{return this.each(function(){if(an.complete){an.complete.call(this)}})}}function aj(au){var av=L(this),at=an.complete,aw=an.mode;function ar(){if(L.isFunction(at)){at.call(av[0])}if(L.isFunction(au)){au()}}if(av.is(":hidden")?aw==="hide":aw==="show"){ar()}else{am.call(av[0],an,ar)}}if(am){return al===false?this.each(aj):this.queue(al||"fx",aj)}else{return ah.call(this,{options:an,duration:an.duration,callback:an.complete,mode:an.mode})}}});var a=/up|down|vertical/,v=/up|left|vertical|horizontal/;L.jqplot.effects.effect.blind=function(aj,ao){var ak=L(this),ar=["position","top","bottom","left","right","height","width"],ap=L.jqplot.effects.setMode(ak,aj.mode||"hide"),au=aj.direction||"up",am=a.test(au),al=am?"height":"width",aq=am?"top":"left",aw=v.test(au),an={},av=ap==="show",ai,ah,at;if(ak.parent().is(".ui-effects-wrapper")){L.jqplot.effects.save(ak.parent(),ar)}else{L.jqplot.effects.save(ak,ar)}ak.show();at=parseInt(ak.css("top"),10);ai=L.jqplot.effects.createWrapper(ak).css({overflow:"hidden"});ah=am?ai[al]()+at:ai[al]();an[al]=av?String(ah):"0";if(!aw){ak.css(am?"bottom":"right",0).css(am?"top":"left","").css({position:"absolute"});an[aq]=av?"0":String(ah)}if(av){ai.css(al,0);if(!aw){ai.css(aq,ah)}}ai.animate(an,{duration:aj.duration,easing:aj.easing,queue:false,complete:function(){if(ap==="hide"){ak.hide()}L.jqplot.effects.restore(ak,ar);L.jqplot.effects.removeWrapper(ak);ao()}})}})(jQuery);
1
+ /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2
+ jsDate | (c) 2010-2013 Chris Leonello
3
  */(function(L){var u;L.fn.emptyForce=function(){for(var ah=0,ai;(ai=L(this)[ah])!=null;ah++){if(ai.nodeType===1){L.cleanData(ai.getElementsByTagName("*"))}if(L.jqplot.use_excanvas){ai.outerHTML=""}else{while(ai.firstChild){ai.removeChild(ai.firstChild)}}ai=null}return L(this)};L.fn.removeChildForce=function(ah){while(ah.firstChild){this.removeChildForce(ah.firstChild);ah.removeChild(ah.firstChild)}};L.fn.jqplot=function(){var ah=[];var aj=[];for(var ak=0,ai=arguments.length;ak<ai;ak++){if(L.isArray(arguments[ak])){ah.push(arguments[ak])}else{if(L.isPlainObject(arguments[ak])){aj.push(arguments[ak])}}}return this.each(function(an){var at,ar,aq=L(this),am=ah.length,al=aj.length,ap,ao;if(an<am){ap=ah[an]}else{ap=am?ah[am-1]:null}if(an<al){ao=aj[an]}else{ao=al?aj[al-1]:null}at=aq.attr("id");if(at===u){at="jqplot_target_"+L.jqplot.targetCounter++;aq.attr("id",at)}ar=L.jqplot(at,ap,ao);aq.data("jqplot",ar)})};L.jqplot=function(an,ak,ai){var aj=null,ah=null;if(arguments.length===3){aj=ak;ah=ai}else{if(arguments.length===2){if(L.isArray(ak)){aj=ak}else{if(L.isPlainObject(ak)){ah=ak}}}}if(aj===null&&ah!==null&&ah.data){aj=ah.data}var am=new R();L("#"+an).removeClass("jqplot-error");if(L.jqplot.config.catchErrors){try{am.init(an,aj,ah);am.draw();am.themeEngine.init.call(am);return am}catch(al){var ao=L.jqplot.config.errorMessage||al.message;L("#"+an).append('<div class="jqplot-error-message">'+ao+"</div>");L("#"+an).addClass("jqplot-error");document.getElementById(an).style.background=L.jqplot.config.errorBackground;document.getElementById(an).style.border=L.jqplot.config.errorBorder;document.getElementById(an).style.fontFamily=L.jqplot.config.errorFontFamily;document.getElementById(an).style.fontSize=L.jqplot.config.errorFontSize;document.getElementById(an).style.fontStyle=L.jqplot.config.errorFontStyle;document.getElementById(an).style.fontWeight=L.jqplot.config.errorFontWeight}}else{am.init(an,aj,ah);am.draw();am.themeEngine.init.call(am);return am}};L.jqplot.version="1.0.8";L.jqplot.revision="1250";L.jqplot.targetCounter=1;L.jqplot.CanvasManager=function(){if(typeof L.jqplot.CanvasManager.canvases=="undefined"){L.jqplot.CanvasManager.canvases=[];L.jqplot.CanvasManager.free=[]}var ah=[];this.getCanvas=function(){var ak;var aj=true;if(!L.jqplot.use_excanvas){for(var al=0,ai=L.jqplot.CanvasManager.canvases.length;al<ai;al++){if(L.jqplot.CanvasManager.free[al]===true){aj=false;ak=L.jqplot.CanvasManager.canvases[al];L.jqplot.CanvasManager.free[al]=false;ah.push(al);break}}}if(aj){ak=document.createElement("canvas");ah.push(L.jqplot.CanvasManager.canvases.length);L.jqplot.CanvasManager.canvases.push(ak);L.jqplot.CanvasManager.free.push(false)}return ak};this.initCanvas=function(ai){if(L.jqplot.use_excanvas){return window.G_vmlCanvasManager.initElement(ai)}return ai};this.freeAllCanvases=function(){for(var aj=0,ai=ah.length;aj<ai;aj++){this.freeCanvas(ah[aj])}ah=[]};this.freeCanvas=function(ai){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(L.jqplot.CanvasManager.canvases[ai]);L.jqplot.CanvasManager.canvases[ai]=null}else{var aj=L.jqplot.CanvasManager.canvases[ai];aj.getContext("2d").clearRect(0,0,aj.width,aj.height);L(aj).unbind().removeAttr("class").removeAttr("style");L(aj).css({left:"",top:"",position:""});aj.width=0;aj.height=0;L.jqplot.CanvasManager.free[ai]=true}}};L.jqplot.log=function(){if(window.console){window.console.log.apply(window.console,arguments)}};L.jqplot.config={addDomReference:false,enablePlugins:false,defaultHeight:300,defaultWidth:400,UTCAdjust:false,timezoneOffset:new Date(new Date().getTimezoneOffset()*60000),errorMessage:"",errorBackground:"",errorBorder:"",errorFontFamily:"",errorFontSize:"",errorFontStyle:"",errorFontWeight:"",catchErrors:false,defaultTickFormatString:"%.1f",defaultColors:["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"],defaultNegativeColors:["#498991","#C08840","#9F9274","#546D61","#646C4A","#6F6621","#6E3F5F","#4F64B0","#A89050","#C45923","#187399","#945381","#959E5C","#C7AF7B","#478396","#907294"],dashLength:4,gapLength:4,dotGapLength:2.5,srcLocation:"jqplot/src/",pluginLocation:"jqplot/src/plugins/"};L.jqplot.arrayMax=function(ah){return Math.max.apply(Math,ah)};L.jqplot.arrayMin=function(ah){return Math.min.apply(Math,ah)};L.jqplot.enablePlugins=L.jqplot.config.enablePlugins;L.jqplot.support_canvas=function(){if(typeof L.jqplot.support_canvas.result=="undefined"){L.jqplot.support_canvas.result=!!document.createElement("canvas").getContext}return L.jqplot.support_canvas.result};L.jqplot.support_canvas_text=function(){if(typeof L.jqplot.support_canvas_text.result=="undefined"){if(window.G_vmlCanvasManager!==u&&window.G_vmlCanvasManager._version>887){L.jqplot.support_canvas_text.result=true}else{L.jqplot.support_canvas_text.result=!!(document.createElement("canvas").getContext&&typeof document.createElement("canvas").getContext("2d").fillText=="function")}}return L.jqplot.support_canvas_text.result};L.jqplot.use_excanvas=((!L.support.boxModel||!L.support.objectAll||!$support.leadingWhitespace)&&!L.jqplot.support_canvas())?true:false;L.jqplot.preInitHooks=[];L.jqplot.postInitHooks=[];L.jqplot.preParseOptionsHooks=[];L.jqplot.postParseOptionsHooks=[];L.jqplot.preDrawHooks=[];L.jqplot.postDrawHooks=[];L.jqplot.preDrawSeriesHooks=[];L.jqplot.postDrawSeriesHooks=[];L.jqplot.preDrawLegendHooks=[];L.jqplot.addLegendRowHooks=[];L.jqplot.preSeriesInitHooks=[];L.jqplot.postSeriesInitHooks=[];L.jqplot.preParseSeriesOptionsHooks=[];L.jqplot.postParseSeriesOptionsHooks=[];L.jqplot.eventListenerHooks=[];L.jqplot.preDrawSeriesShadowHooks=[];L.jqplot.postDrawSeriesShadowHooks=[];L.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};L.jqplot.ElemContainer.prototype.createElement=function(ak,am,ai,aj,an){this._offsets=am;var ah=ai||"jqplot";var al=document.createElement(ak);this._elem=L(al);this._elem.addClass(ah);this._elem.css(aj);this._elem.attr(an);al=null;return this._elem};L.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};L.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};L.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};L.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};L.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};L.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};L.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function w(ah){L.jqplot.ElemContainer.call(this);this.name=ah;this._series=[];this.show=false;this.tickRenderer=L.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=L.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=L.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.drawMajorGridlines=true;this.drawMinorGridlines=false;this.drawMajorTickMarks=true;this.drawMinorTickMarks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this.scaleToHiddenSeries=false;this._dataBounds={min:null,max:null};this._intervalStats=[];this._offsets={min:null,max:null};this._ticks=[];this._label=null;this.syncTicks=null;this.tickSpacing=75;this._min=null;this._max=null;this._tickInterval=null;this._numberTicks=null;this.__ticks=null;this._options={}}w.prototype=new L.jqplot.ElemContainer();w.prototype.constructor=w;w.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.tickOptions.axis=this.name;if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTicks}if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTickMarks}if(this.tickOptions.showLabel==null){this.tickOptions.showLabel=this.showTicks}if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};w.prototype.draw=function(ah,ai){if(this.__ticks){this.__ticks=null}return this.renderer.draw.call(this,ah,ai)};w.prototype.set=function(){this.renderer.set.call(this)};w.prototype.pack=function(ai,ah){if(this.show){this.renderer.pack.call(this,ai,ah)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};w.prototype.reset=function(){this.renderer.reset.call(this)};w.prototype.resetScale=function(ah){L.extend(true,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},ah);this.resetDataBounds()};w.prototype.resetDataBounds=function(){var ao=this._dataBounds;ao.min=null;ao.max=null;var ai,ap,am;var aj=(this.show)?true:false;for(var al=0;al<this._series.length;al++){ap=this._series[al];if(ap.show||this.scaleToHiddenSeries){am=ap._plotData;if(ap._type==="line"&&ap.renderer.bands.show&&this.name.charAt(0)!=="x"){am=[[0,ap.renderer.bands._min],[1,ap.renderer.bands._max]]}var ah=1,an=1;if(ap._type!=null&&ap._type=="ohlc"){ah=3;an=2}for(var ak=0,ai=am.length;ak<ai;ak++){if(this.name=="xaxis"||this.name=="x2axis"){if((am[ak][0]!=null&&am[ak][0]<ao.min)||ao.min==null){ao.min=am[ak][0]}if((am[ak][0]!=null&&am[ak][0]>ao.max)||ao.max==null){ao.max=am[ak][0]}}else{if((am[ak][ah]!=null&&am[ak][ah]<ao.min)||ao.min==null){ao.min=am[ak][ah]}if((am[ak][an]!=null&&am[ak][an]>ao.max)||ao.max==null){ao.max=am[ak][an]}}}if(aj&&ap.renderer.constructor!==L.jqplot.BarRenderer){aj=false}else{if(aj&&this._options.hasOwnProperty("forceTickAt0")&&this._options.forceTickAt0==false){aj=false}else{if(aj&&ap.renderer.constructor===L.jqplot.BarRenderer){if(ap.barDirection=="vertical"&&this.name!="xaxis"&&this.name!="x2axis"){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}else{if(ap.barDirection=="horizontal"&&(this.name=="xaxis"||this.name=="x2axis")){if(this._options.pad!=null||this._options.padMin!=null){aj=false}}}}}}}}if(aj&&this.renderer.constructor===L.jqplot.LinearAxisRenderer&&ao.min>=0){this.padMin=1;this.forceTickAt0=true}};function q(ah){L.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.labels=[];this.showLabels=true;this.showSwatches=true;this.placement="insideGrid";this.xoffset=0;this.yoffset=0;this.border;this.background;this.textColor;this.fontFamily;this.fontSize;this.rowSpacing="0.5em";this.renderer=L.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.marginTop=null;this.marginRight=null;this.marginBottom=null;this.marginLeft=null;this.escapeHtml=false;this._series=[];L.extend(true,this,ah)}q.prototype=new L.jqplot.ElemContainer();q.prototype.constructor=q;q.prototype.setOptions=function(ah){L.extend(true,this,ah);if(this.placement=="inside"){this.placement="insideGrid"}if(this.xoffset>0){if(this.placement=="insideGrid"){switch(this.location){case"nw":case"w":case"sw":if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break;case"ne":case"e":case"se":default:if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break}}else{if(this.placement=="outside"){switch(this.location){case"nw":case"w":case"sw":if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break;case"ne":case"e":case"se":default:if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break}}}this.xoffset=0}if(this.yoffset>0){if(this.placement=="outside"){switch(this.location){case"sw":case"s":case"se":if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break;case"ne":case"n":case"nw":default:if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break}}else{if(this.placement=="insideGrid"){switch(this.location){case"sw":case"s":case"se":if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break;case"ne":case"n":case"nw":default:if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break}}}this.yoffset=0}};q.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};q.prototype.draw=function(ai,aj){for(var ah=0;ah<L.jqplot.preDrawLegendHooks.length;ah++){L.jqplot.preDrawLegendHooks[ah].call(this,ai)}return this.renderer.draw.call(this,ai,aj)};q.prototype.pack=function(ah){this.renderer.pack.call(this,ah)};function y(ah){L.jqplot.ElemContainer.call(this);this.text=ah;this.show=true;this.fontFamily;this.fontSize;this.textAlign;this.textColor;this.renderer=L.jqplot.DivTitleRenderer;this.rendererOptions={};this.escapeHtml=false}y.prototype=new L.jqplot.ElemContainer();y.prototype.constructor=y;y.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};y.prototype.draw=function(ah){return this.renderer.draw.call(this,ah)};y.prototype.pack=function(){this.renderer.pack.call(this)};function S(ah){ah=ah||{};L.jqplot.ElemContainer.call(this);this.show=true;this.xaxis="xaxis";this._xaxis;this.yaxis="yaxis";this._yaxis;this.gridBorderWidth=2;this.renderer=L.jqplot.LineRenderer;this.rendererOptions={};this.data=[];this.gridData=[];this.label="";this.showLabel=true;this.color;this.negativeColor;this.lineWidth=2.5;this.lineJoin="round";this.lineCap="round";this.linePattern="solid";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.25;this.shadowDepth=3;this.shadowAlpha="0.1";this.breakOnNull=false;this.markerRenderer=L.jqplot.MarkerRenderer;this.markerOptions={};this.showLine=true;this.showMarker=true;this.index;this.fill=false;this.fillColor;this.fillAlpha;this.fillAndStroke=false;this.disableStack=false;this._stack=false;this.neighborThreshold=4;this.fillToZero=false;this.fillToValue=0;this.fillAxis="y";this.useNegativeColors=true;this._stackData=[];this._plotData=[];this._plotValues={x:[],y:[]};this._intervals={x:{},y:{}};this._prevPlotData=[];this._prevGridData=[];this._stackAxis="y";this._primaryAxis="_xaxis";this.canvas=new L.jqplot.GenericCanvas();this.shadowCanvas=new L.jqplot.GenericCanvas();this.plugins={};this._sumy=0;this._sumx=0;this._type=""}S.prototype=new L.jqplot.ElemContainer();S.prototype.constructor=S;S.prototype.init=function(ak,ao,am){this.index=ak;this.gridBorderWidth=ao;var an=this.data;var aj=[],al,ah;for(al=0,ah=an.length;al<ah;al++){if(!this.breakOnNull){if(an[al]==null||an[al][0]==null||an[al][1]==null){continue}else{aj.push(an[al])}}else{aj.push(an[al])}}this.data=aj;if(!this.color){this.color=am.colorGenerator.get(this.index)}if(!this.negativeColor){this.negativeColor=am.negativeColorGenerator.get(this.index)}if(!this.fillColor){this.fillColor=this.color}if(this.fillAlpha){var ai=L.jqplot.normalize2rgb(this.fillColor);var ai=L.jqplot.getColorComponents(ai);this.fillColor="rgba("+ai[0]+","+ai[1]+","+ai[2]+","+this.fillAlpha+")"}if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions,am);this.markerRenderer=new this.markerRenderer();if(!this.markerOptions.color){this.markerOptions.color=this.color}if(this.markerOptions.show==null){this.markerOptions.show=this.showMarker}this.showMarker=this.markerOptions.show;this.markerRenderer.init(this.markerOptions)};S.prototype.draw=function(an,ak,am){var ai=(ak==u)?{}:ak;an=(an==u)?this.canvas._ctx:an;var ah,al,aj;for(ah=0;ah<L.jqplot.preDrawSeriesHooks.length;ah++){L.jqplot.preDrawSeriesHooks[ah].call(this,an,ai)}if(this.show){this.renderer.setGridData.call(this,am);if(!ai.preventJqPlotSeriesDrawTrigger){L(an.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData])}al=[];if(ai.data){al=ai.data}else{if(!this._stack){al=this.data}else{al=this._plotData}}aj=ai.gridData||this.renderer.makeGridData.call(this,al,am);if(this._type==="line"&&this.renderer.smooth&&this.renderer._smoothedData.length){aj=this.renderer._smoothedData}this.renderer.draw.call(this,an,aj,ai,am)}for(ah=0;ah<L.jqplot.postDrawSeriesHooks.length;ah++){L.jqplot.postDrawSeriesHooks[ah].call(this,an,ai,am)}an=ak=am=ah=al=aj=null};S.prototype.drawShadow=function(an,ak,am){var ai=(ak==u)?{}:ak;an=(an==u)?this.shadowCanvas._ctx:an;var ah,al,aj;for(ah=0;ah<L.jqplot.preDrawSeriesShadowHooks.length;ah++){L.jqplot.preDrawSeriesShadowHooks[ah].call(this,an,ai)}if(this.shadow){this.renderer.setGridData.call(this,am);al=[];if(ai.data){al=ai.data}else{if(!this._stack){al=this.data}else{al=this._plotData}}aj=ai.gridData||this.renderer.makeGridData.call(this,al,am);this.renderer.drawShadow.call(this,an,aj,ai,am)}for(ah=0;ah<L.jqplot.postDrawSeriesShadowHooks.length;ah++){L.jqplot.postDrawSeriesShadowHooks[ah].call(this,an,ai)}an=ak=am=ah=al=aj=null};S.prototype.toggleDisplay=function(ai,ak){var ah,aj;if(ai.data.series){ah=ai.data.series}else{ah=this}if(ai.data.speed){aj=ai.data.speed}if(aj){if(ah.canvas._elem.is(":hidden")||!ah.show){ah.show=true;ah.canvas._elem.removeClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.fadeIn(aj)}ah.canvas._elem.fadeIn(aj,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).fadeIn(aj)}else{ah.show=false;ah.canvas._elem.addClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.fadeOut(aj)}ah.canvas._elem.fadeOut(aj,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).fadeOut(aj)}}else{if(ah.canvas._elem.is(":hidden")||!ah.show){ah.show=true;ah.canvas._elem.removeClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.show()}ah.canvas._elem.show(0,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).show()}else{ah.show=false;ah.canvas._elem.addClass("jqplot-series-hidden");if(ah.shadowCanvas._elem){ah.shadowCanvas._elem.hide()}ah.canvas._elem.hide(0,ak);ah.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ah.index).hide()}}};function M(){L.jqplot.ElemContainer.call(this);this.drawGridlines=true;this.gridLineColor="#cccccc";this.gridLineWidth=1;this.background="#fffdf6";this.borderColor="#999999";this.borderWidth=2;this.drawBorder=true;this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.5;this.shadowWidth=3;this.shadowDepth=3;this.shadowColor=null;this.shadowAlpha="0.07";this._left;this._top;this._right;this._bottom;this._width;this._height;this._axes=[];this.renderer=L.jqplot.CanvasGridRenderer;this.rendererOptions={};this._offsets={top:null,bottom:null,left:null,right:null}}M.prototype=new L.jqplot.ElemContainer();M.prototype.constructor=M;M.prototype.init=function(){if(L.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};M.prototype.createElement=function(ah,ai){this._offsets=ah;return this.renderer.createElement.call(this,ai)};M.prototype.draw=function(){this.renderer.draw.call(this)};L.jqplot.GenericCanvas=function(){L.jqplot.ElemContainer.call(this);this._ctx};L.jqplot.GenericCanvas.prototype=new L.jqplot.ElemContainer();L.jqplot.GenericCanvas.prototype.constructor=L.jqplot.GenericCanvas;L.jqplot.GenericCanvas.prototype.createElement=function(al,aj,ai,am){this._offsets=al;var ah="jqplot";if(aj!=u){ah=aj}var ak;ak=am.canvasManager.getCanvas();if(ai!=null){this._plotDimensions=ai}ak.width=this._plotDimensions.width-this._offsets.left-this._offsets.right;ak.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom;this._elem=L(ak);this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top});this._elem.addClass(ah);ak=am.canvasManager.initCanvas(ak);ak=null;return this._elem};L.jqplot.GenericCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};L.jqplot.GenericCanvas.prototype.resetCanvas=function(){if(this._elem){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce()}this._ctx=null};L.jqplot.HooksManager=function(){this.hooks=[];this.args=[]};L.jqplot.HooksManager.prototype.addOnce=function(ak,ai){ai=ai||[];var al=false;for(var aj=0,ah=this.hooks.length;aj<ah;aj++){if(this.hooks[aj]==ak){al=true}}if(!al){this.hooks.push(ak);this.args.push(ai)}};L.jqplot.HooksManager.prototype.add=function(ai,ah){ah=ah||[];this.hooks.push(ai);this.args.push(ah)};L.jqplot.EventListenerManager=function(){this.hooks=[]};L.jqplot.EventListenerManager.prototype.addOnce=function(al,ak){var am=false,aj,ai;for(var ai=0,ah=this.hooks.length;ai<ah;ai++){aj=this.hooks[ai];if(aj[0]==al&&aj[1]==ak){am=true}}if(!am){this.hooks.push([al,ak])}};L.jqplot.EventListenerManager.prototype.add=function(ai,ah){this.hooks.push([ai,ah])};var U=["yMidAxis","xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];function R(){this.animate=false;this.animateReplot=false;this.axes={xaxis:new w("xaxis"),yaxis:new w("yaxis"),x2axis:new w("x2axis"),y2axis:new w("y2axis"),y3axis:new w("y3axis"),y4axis:new w("y4axis"),y5axis:new w("y5axis"),y6axis:new w("y6axis"),y7axis:new w("y7axis"),y8axis:new w("y8axis"),y9axis:new w("y9axis"),yMidAxis:new w("yMidAxis")};this.baseCanvas=new L.jqplot.GenericCanvas();this.captureRightClick=false;this.data=[];this.dataRenderer;this.dataRendererOptions;this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{},yMidAxis:{}},seriesDefaults:{},series:[]};this.defaultAxisStart=1;this.drawIfHidden=false;this.eventCanvas=new L.jqplot.GenericCanvas();this.fillBetween={series1:null,series2:null,color:null,baseSeries:0,fill:true};this.fontFamily;this.fontSize;this.grid=new M();this.legend=new q();this.noDataIndicator={show:false,indicator:"Loading Data...",axes:{xaxis:{min:0,max:10,tickInterval:2,show:true},yaxis:{min:0,max:12,tickInterval:3,show:true}}};this.negativeSeriesColors=L.jqplot.config.defaultNegativeColors;this.options={};this.previousSeriesStack=[];this.plugins={};this.series=[];this.seriesStack=[];this.seriesColors=L.jqplot.config.defaultColors;this.sortData=true;this.stackSeries=false;this.syncXTicks=true;this.syncYTicks=true;this.target=null;this.targetId=null;this.textColor;this.title=new y();this._drawCount=0;this._sumy=0;this._sumx=0;this._stackData=[];this._plotData=[];this._width=null;this._height=null;this._plotDimensions={height:null,width:null};this._gridPadding={top:null,right:null,bottom:null,left:null};this._defaultGridPadding={top:10,right:10,bottom:23,left:10};this._addDomReference=L.jqplot.config.addDomReference;this.preInitHooks=new L.jqplot.HooksManager();this.postInitHooks=new L.jqplot.HooksManager();this.preParseOptionsHooks=new L.jqplot.HooksManager();this.postParseOptionsHooks=new L.jqplot.HooksManager();this.preDrawHooks=new L.jqplot.HooksManager();this.postDrawHooks=new L.jqplot.HooksManager();this.preDrawSeriesHooks=new L.jqplot.HooksManager();this.postDrawSeriesHooks=new L.jqplot.HooksManager();this.preDrawLegendHooks=new L.jqplot.HooksManager();this.addLegendRowHooks=new L.jqplot.HooksManager();this.preSeriesInitHooks=new L.jqplot.HooksManager();this.postSeriesInitHooks=new L.jqplot.HooksManager();this.preParseSeriesOptionsHooks=new L.jqplot.HooksManager();this.postParseSeriesOptionsHooks=new L.jqplot.HooksManager();this.eventListenerHooks=new L.jqplot.EventListenerManager();this.preDrawSeriesShadowHooks=new L.jqplot.HooksManager();this.postDrawSeriesShadowHooks=new L.jqplot.HooksManager();this.colorGenerator=new L.jqplot.ColorGenerator();this.negativeColorGenerator=new L.jqplot.ColorGenerator();this.canvasManager=new L.jqplot.CanvasManager();this.themeEngine=new L.jqplot.ThemeEngine();var aj=0;this.init=function(av,ar,ay){ay=ay||{};for(var at=0;at<L.jqplot.preInitHooks.length;at++){L.jqplot.preInitHooks[at].call(this,av,ar,ay)}for(var at=0;at<this.preInitHooks.hooks.length;at++){this.preInitHooks.hooks[at].call(this,av,ar,ay)}this.targetId="#"+av;this.target=L("#"+av);if(this._addDomReference){this.target.data("jqplot",this)}this.target.removeClass("jqplot-error");if(!this.target.get(0)){throw new Error("No plot target specified")}if(this.target.css("position")=="static"){this.target.css("position","relative")}if(!this.target.hasClass("jqplot-target")){this.target.addClass("jqplot-target")}if(!this.target.height()){var au;if(ay&&ay.height){au=parseInt(ay.height,10)}else{if(this.target.attr("data-height")){au=parseInt(this.target.attr("data-height"),10)}else{au=parseInt(L.jqplot.config.defaultHeight,10)}}this._height=au;this.target.css("height",au+"px")}else{this._height=au=this.target.height()}if(!this.target.width()){var aw;if(ay&&ay.width){aw=parseInt(ay.width,10)}else{if(this.target.attr("data-width")){aw=parseInt(this.target.attr("data-width"),10)}else{aw=parseInt(L.jqplot.config.defaultWidth,10)}}this._width=aw;this.target.css("width",aw+"px")}else{this._width=aw=this.target.width()}for(var at=0,ap=U.length;at<ap;at++){this.axes[U[at]]=new w(U[at])}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;if(this._height<=0||this._width<=0||!this._height||!this._width){throw new Error("Canvas dimension not set")}if(ay.dataRenderer&&L.isFunction(ay.dataRenderer)){if(ay.dataRendererOptions){this.dataRendererOptions=ay.dataRendererOptions}this.dataRenderer=ay.dataRenderer;ar=this.dataRenderer(ar,this,this.dataRendererOptions)}if(ay.noDataIndicator&&L.isPlainObject(ay.noDataIndicator)){L.extend(true,this.noDataIndicator,ay.noDataIndicator)}if(ar==null||L.isArray(ar)==false||ar.length==0||L.isArray(ar[0])==false||ar[0].length==0){if(this.noDataIndicator.show==false){throw new Error("No data specified")}else{for(var al in this.noDataIndicator.axes){for(var an in this.noDataIndicator.axes[al]){this.axes[al][an]=this.noDataIndicator.axes[al][an]}}this.postDrawHooks.add(function(){var aD=this.eventCanvas.getHeight();var aA=this.eventCanvas.getWidth();var az=L('<div class="jqplot-noData-container" style="position:absolute;"></div>');this.target.append(az);az.height(aD);az.width(aA);az.css("top",this.eventCanvas._offsets.top);az.css("left",this.eventCanvas._offsets.left);var aC=L('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');az.append(aC);aC.html(this.noDataIndicator.indicator);var aB=aC.height();var ax=aC.width();aC.height(aB);aC.width(ax);aC.css("top",(aD-aB)/2+"px")})}}this.data=L.extend(true,[],ar);this.parseOptions(ay);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;this.computePlotData();for(var at=0;at<this.series.length;at++){this.seriesStack.push(at);this.previousSeriesStack.push(at);this.series[at].shadowCanvas._plotDimensions=this._plotDimensions;this.series[at].canvas._plotDimensions=this._plotDimensions;for(var aq=0;aq<L.jqplot.preSeriesInitHooks.length;aq++){L.jqplot.preSeriesInitHooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}for(var aq=0;aq<this.preSeriesInitHooks.hooks.length;aq++){this.preSeriesInitHooks.hooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}this.series[at]._plotDimensions=this._plotDimensions;this.series[at].init(at,this.grid.borderWidth,this);for(var aq=0;aq<L.jqplot.postSeriesInitHooks.length;aq++){L.jqplot.postSeriesInitHooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}for(var aq=0;aq<this.postSeriesInitHooks.hooks.length;aq++){this.postSeriesInitHooks.hooks[aq].call(this.series[at],av,this.data,this.options.seriesDefaults,this.options.series[at],this)}this._sumy+=this.series[at]._sumy;this._sumx+=this.series[at]._sumx}var am,ao;for(var at=0,ap=U.length;at<ap;at++){am=U[at];ao=this.axes[am];ao._plotDimensions=this._plotDimensions;ao.init();if(this.axes[am].borderColor==null){if(am.charAt(0)!=="x"&&ao.useSeriesColor===true&&ao.show){ao.borderColor=ao._series[0].color}else{ao.borderColor=this.grid.borderColor}}}if(this.sortData){ah(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var at=0;at<L.jqplot.postInitHooks.length;at++){L.jqplot.postInitHooks[at].call(this,av,this.data,ay)}for(var at=0;at<this.postInitHooks.hooks.length;at++){this.postInitHooks.hooks[at].call(this,av,this.data,ay)}};this.resetAxesScale=function(aq,am){var ao=am||{};var ap=aq||this.axes;if(ap===true){ap=this.axes}if(L.isArray(ap)){for(var an=0;an<ap.length;an++){this.axes[ap[an]].resetScale(ao[ap[an]])}}else{if(typeof(ap)==="object"){for(var al in ap){this.axes[al].resetScale(ao[al])}}}};this.reInitialize=function(au,al){var ay=L.extend(true,{},this.options,al);var aw=this.targetId.substr(1);var ar=(au==null)?this.data:au;for(var av=0;av<L.jqplot.preInitHooks.length;av++){L.jqplot.preInitHooks[av].call(this,aw,ar,ay)}for(var av=0;av<this.preInitHooks.hooks.length;av++){this.preInitHooks.hooks[av].call(this,aw,ar,ay)}this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw new Error("Target dimension not set")}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;var am,ax,at,ao;for(var av=0,aq=U.length;av<aq;av++){am=U[av];ao=this.axes[am];ax=ao._ticks;for(var at=0,ap=ax.length;at<ap;at++){var an=ax[at]._elem;if(an){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(an.get(0))}an.emptyForce();an=null;ax._elem=null}}ax=null;delete ao.ticks;delete ao._ticks;this.axes[am]=new w(am);this.axes[am]._plotWidth=this._width;this.axes[am]._plotHeight=this._height}if(au){if(ay.dataRenderer&&L.isFunction(ay.dataRenderer)){if(ay.dataRendererOptions){this.dataRendererOptions=ay.dataRendererOptions}this.dataRenderer=ay.dataRenderer;au=this.dataRenderer(au,this,this.dataRendererOptions)}this.data=L.extend(true,[],au)}if(al){this.parseOptions(ay)}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this.title.init();this.legend.init();this._sumy=0;this._sumx=0;this.seriesStack=[];this.previousSeriesStack=[];this.computePlotData();for(var av=0,aq=this.series.length;av<aq;av++){this.seriesStack.push(av);this.previousSeriesStack.push(av);this.series[av].shadowCanvas._plotDimensions=this._plotDimensions;this.series[av].canvas._plotDimensions=this._plotDimensions;for(var at=0;at<L.jqplot.preSeriesInitHooks.length;at++){L.jqplot.preSeriesInitHooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}for(var at=0;at<this.preSeriesInitHooks.hooks.length;at++){this.preSeriesInitHooks.hooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}this.series[av]._plotDimensions=this._plotDimensions;this.series[av].init(av,this.grid.borderWidth,this);for(var at=0;at<L.jqplot.postSeriesInitHooks.length;at++){L.jqplot.postSeriesInitHooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}for(var at=0;at<this.postSeriesInitHooks.hooks.length;at++){this.postSeriesInitHooks.hooks[at].call(this.series[av],aw,this.data,this.options.seriesDefaults,this.options.series[av],this)}this._sumy+=this.series[av]._sumy;this._sumx+=this.series[av]._sumx}for(var av=0,aq=U.length;av<aq;av++){am=U[av];ao=this.axes[am];ao._plotDimensions=this._plotDimensions;ao.init();if(ao.borderColor==null){if(am.charAt(0)!=="x"&&ao.useSeriesColor===true&&ao.show){ao.borderColor=ao._series[0].color}else{ao.borderColor=this.grid.borderColor}}}if(this.sortData){ah(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var av=0,aq=L.jqplot.postInitHooks.length;av<aq;av++){L.jqplot.postInitHooks[av].call(this,aw,this.data,ay)}for(var av=0,aq=this.postInitHooks.hooks.length;av<aq;av++){this.postInitHooks.hooks[av].call(this,aw,this.data,ay)}};this.quickInit=function(){this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw new Error("Target dimension not set")}this._plotDimensions.height=this._height;this._plotDimensions.width=this._width;this.grid._plotDimensions=this._plotDimensions;this.title._plotDimensions=this._plotDimensions;this.baseCanvas._plotDimensions=this._plotDimensions;this.eventCanvas._plotDimensions=this._plotDimensions;this.legend._plotDimensions=this._plotDimensions;for(var aq in this.axes){this.axes[aq]._plotWidth=this._width;this.axes[aq]._plotHeight=this._height}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this._sumy=0;this._sumx=0;this.computePlotData();for(var ao=0;ao<this.series.length;ao++){if(this.series[ao]._type==="line"&&this.series[ao].renderer.bands.show){this.series[ao].renderer.initBands.call(this.series[ao],this.series[ao].renderer.options,this)}this.series[ao]._plotDimensions=this._plotDimensions;this.series[ao].canvas._plotDimensions=this._plotDimensions;this._sumy+=this.series[ao]._sumy;this._sumx+=this.series[ao]._sumx}var am;for(var al=0;al<12;al++){am=U[al];var an=this.axes[am]._ticks;for(var ao=0;ao<an.length;ao++){var ap=an[ao]._elem;if(ap){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){window.G_vmlCanvasManager.uninitElement(ap.get(0))}ap.emptyForce();ap=null;an._elem=null}}an=null;this.axes[am]._plotDimensions=this._plotDimensions;this.axes[am]._ticks=[]}if(this.sortData){ah(this.series)}this.grid._axes=this.axes;this.legend._series=this.series};function ah(ap){var au,av,aw,al,at;for(var aq=0;aq<ap.length;aq++){var am;var ar=[ap[aq].data,ap[aq]._stackData,ap[aq]._plotData,ap[aq]._prevPlotData];for(var an=0;an<4;an++){am=true;au=ar[an];if(ap[aq]._stackAxis=="x"){for(var ao=0;ao<au.length;ao++){if(typeof(au[ao][1])!="number"){am=false;break}}if(am){au.sort(function(ay,ax){return ay[1]-ax[1]})}}else{for(var ao=0;ao<au.length;ao++){if(typeof(au[ao][0])!="number"){am=false;break}}if(am){au.sort(function(ay,ax){return ay[0]-ax[0]})}}}}}this.computePlotData=function(){this._plotData=[];this._stackData=[];var at,au,ao;for(au=0,ao=this.series.length;au<ao;au++){at=this.series[au];this._plotData.push([]);this._stackData.push([]);var am=at.data;this._plotData[au]=L.extend(true,[],am);this._stackData[au]=L.extend(true,[],am);at._plotData=this._plotData[au];at._stackData=this._stackData[au];var ax={x:[],y:[]};if(this.stackSeries&&!at.disableStack){at._stack=true;var av=(at._stackAxis==="x")?0:1;for(var ap=0,al=am.length;ap<al;ap++){var aw=am[ap][av];if(aw==null){aw=0}this._plotData[au][ap][av]=aw;this._stackData[au][ap][av]=aw;if(au>0){for(var aq=au;aq--;){var an=this._plotData[aq][ap][av];if(aw*an>=0){this._plotData[au][ap][av]+=an;this._stackData[au][ap][av]+=an;break}}}}}else{for(var ar=0;ar<at.data.length;ar++){ax.x.push(at.data[ar][0]);ax.y.push(at.data[ar][1])}this._stackData.push(at.data);this.series[au]._stackData=at.data;this._plotData.push(at.data);at._plotData=at.data;at._plotValues=ax}if(au>0){at._prevPlotData=this.series[au-1]._plotData}at._sumy=0;at._sumx=0;for(ar=at.data.length-1;ar>-1;ar--){at._sumy+=at.data[ar][1];at._sumx+=at.data[ar][0]}}};this.populatePlotData=function(au,av){this._plotData=[];this._stackData=[];au._stackData=[];au._plotData=[];var ay={x:[],y:[]};if(this.stackSeries&&!au.disableStack){au._stack=true;var ax=(au._stackAxis==="x")?0:1;var az=L.extend(true,[],au.data);var aA=L.extend(true,[],au.data);var an,am,ao,aw,al;for(var ar=0;ar<av;ar++){var ap=this.series[ar].data;for(var aq=0;aq<ap.length;aq++){ao=ap[aq];an=(ao[0]!=null)?ao[0]:0;am=(ao[1]!=null)?ao[1]:0;az[aq][0]+=an;az[aq][1]+=am;aw=(ax)?am:an;if(au.data[aq][ax]*aw>=0){aA[aq][ax]+=aw}}}for(var at=0;at<aA.length;at++){ay.x.push(aA[at][0]);ay.y.push(aA[at][1])}this._plotData.push(aA);this._stackData.push(az);au._stackData=az;au._plotData=aA;au._plotValues=ay}else{for(var at=0;at<au.data.length;at++){ay.x.push(au.data[at][0]);ay.y.push(au.data[at][1])}this._stackData.push(au.data);this.series[av]._stackData=au.data;this._plotData.push(au.data);au._plotData=au.data;au._plotValues=ay}if(av>0){au._prevPlotData=this.series[av-1]._plotData}au._sumy=0;au._sumx=0;for(at=au.data.length-1;at>-1;at--){au._sumy+=au.data[at][1];au._sumx+=au.data[at][0]}};this.getNextSeriesColor=(function(am){var al=0;var an=am.seriesColors;return function(){if(al<an.length){return an[al++]}else{al=0;return an[al++]}}})(this);this.parseOptions=function(ay){for(var at=0;at<this.preParseOptionsHooks.hooks.length;at++){this.preParseOptionsHooks.hooks[at].call(this,ay)}for(var at=0;at<L.jqplot.preParseOptionsHooks.length;at++){L.jqplot.preParseOptionsHooks[at].call(this,ay)}this.options=L.extend(true,{},this.defaults,ay);var am=this.options;this.animate=am.animate;this.animateReplot=am.animateReplot;this.stackSeries=am.stackSeries;if(L.isPlainObject(am.fillBetween)){var ax=["series1","series2","color","baseSeries","fill"],au;for(var at=0,aq=ax.length;at<aq;at++){au=ax[at];if(am.fillBetween[au]!=null){this.fillBetween[au]=am.fillBetween[au]}}}if(am.seriesColors){this.seriesColors=am.seriesColors}if(am.negativeSeriesColors){this.negativeSeriesColors=am.negativeSeriesColors}if(am.captureRightClick){this.captureRightClick=am.captureRightClick}this.defaultAxisStart=(ay&&ay.defaultAxisStart!=null)?ay.defaultAxisStart:this.defaultAxisStart;this.colorGenerator.setColors(this.seriesColors);this.negativeColorGenerator.setColors(this.negativeSeriesColors);L.extend(true,this._gridPadding,am.gridPadding);this.sortData=(am.sortData!=null)?am.sortData:this.sortData;for(var at=0;at<12;at++){var an=U[at];var ap=this.axes[an];ap._options=L.extend(true,{},am.axesDefaults,am.axes[an]);L.extend(true,ap,am.axesDefaults,am.axes[an]);ap._plotWidth=this._width;ap._plotHeight=this._height}var aw=function(aD,aB,aE){var aA=[];var aC,az;aB=aB||"vertical";if(!L.isArray(aD[0])){for(aC=0,az=aD.length;aC<az;aC++){if(aB=="vertical"){aA.push([aE+aC,aD[aC]])}else{aA.push([aD[aC],aE+aC])}}}else{L.extend(true,aA,aD)}return aA};var av=0;this.series=[];for(var at=0;at<this.data.length;at++){var al=L.extend(true,{index:at},{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[at],{rendererOptions:{animation:{show:this.animate}}});var ax=new S(al);for(var ar=0;ar<L.jqplot.preParseSeriesOptionsHooks.length;ar++){L.jqplot.preParseSeriesOptionsHooks[ar].call(ax,this.options.seriesDefaults,this.options.series[at])}for(var ar=0;ar<this.preParseSeriesOptionsHooks.hooks.length;ar++){this.preParseSeriesOptionsHooks.hooks[ar].call(ax,this.options.seriesDefaults,this.options.series[at])}L.extend(true,ax,al);var ao="vertical";if(ax.renderer===L.jqplot.BarRenderer&&ax.rendererOptions&&ax.rendererOptions.barDirection=="horizontal"){ao="horizontal";ax._stackAxis="x";ax._primaryAxis="_yaxis"}ax.data=aw(this.data[at],ao,this.defaultAxisStart);switch(ax.xaxis){case"xaxis":ax._xaxis=this.axes.xaxis;break;case"x2axis":ax._xaxis=this.axes.x2axis;break;default:break}ax._yaxis=this.axes[ax.yaxis];ax._xaxis._series.push(ax);ax._yaxis._series.push(ax);if(ax.show){ax._xaxis.show=true;ax._yaxis.show=true}else{if(ax._xaxis.scaleToHiddenSeries){ax._xaxis.show=true}if(ax._yaxis.scaleToHiddenSeries){ax._yaxis.show=true}}if(!ax.label){ax.label="Series "+(at+1).toString()}this.series.push(ax);for(var ar=0;ar<L.jqplot.postParseSeriesOptionsHooks.length;ar++){L.jqplot.postParseSeriesOptionsHooks[ar].call(this.series[at],this.options.seriesDefaults,this.options.series[at])}for(var ar=0;ar<this.postParseSeriesOptionsHooks.hooks.length;ar++){this.postParseSeriesOptionsHooks.hooks[ar].call(this.series[at],this.options.seriesDefaults,this.options.series[at])}}L.extend(true,this.grid,this.options.grid);for(var at=0,aq=U.length;at<aq;at++){var an=U[at];var ap=this.axes[an];if(ap.borderWidth==null){ap.borderWidth=this.grid.borderWidth}}if(typeof this.options.title=="string"){this.title.text=this.options.title}else{if(typeof this.options.title=="object"){L.extend(true,this.title,this.options.title)}}this.title._plotWidth=this._width;this.legend.setOptions(this.options.legend);for(var at=0;at<L.jqplot.postParseOptionsHooks.length;at++){L.jqplot.postParseOptionsHooks[at].call(this,ay)}for(var at=0;at<this.postParseOptionsHooks.hooks.length;at++){this.postParseOptionsHooks.hooks[at].call(this,ay)}};this.destroy=function(){this.canvasManager.freeAllCanvases();if(this.eventCanvas&&this.eventCanvas._elem){this.eventCanvas._elem.unbind()}this.target.empty();this.target[0].innerHTML=""};this.replot=function(am){var an=am||{};var ap=an.data||null;var al=(an.clear===false)?false:true;var ao=an.resetAxes||false;delete an.data;delete an.clear;delete an.resetAxes;this.target.trigger("jqplotPreReplot");if(al){this.destroy()}if(ap||!L.isEmptyObject(an)){this.reInitialize(ap,an)}else{this.quickInit()}if(ao){this.resetAxesScale(ao,an.axes)}this.draw();this.target.trigger("jqplotPostReplot")};this.redraw=function(al){al=(al!=null)?al:true;this.target.trigger("jqplotPreRedraw");if(al){this.canvasManager.freeAllCanvases();this.eventCanvas._elem.unbind();this.target.empty()}for(var an in this.axes){this.axes[an]._ticks=[]}this.computePlotData();this._sumy=0;this._sumx=0;for(var am=0,ao=this.series.length;am<ao;am++){this._sumy+=this.series[am]._sumy;this._sumx+=this.series[am]._sumx}this.draw();this.target.trigger("jqplotPostRedraw")};this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var aH,aF,aE,ao;for(aH=0,aE=L.jqplot.preDrawHooks.length;aH<aE;aH++){L.jqplot.preDrawHooks[aH].call(this)}for(aH=0,aE=this.preDrawHooks.hooks.length;aH<aE;aH++){this.preDrawHooks.hooks[aH].apply(this,this.preDrawSeriesHooks.args[aH])}this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas",null,this));this.baseCanvas.setContext();this.target.append(this.title.draw());this.title.pack({top:0,left:0});var aL=this.legend.draw({},this);var al={top:0,left:0,bottom:0,right:0};if(this.legend.placement=="outsideGrid"){this.target.append(aL);switch(this.legend.location){case"n":al.top+=this.legend.getHeight();break;case"s":al.bottom+=this.legend.getHeight();break;case"ne":case"e":case"se":al.right+=this.legend.getWidth();break;case"nw":case"w":case"sw":al.left+=this.legend.getWidth();break;default:al.right+=this.legend.getWidth();break}aL=aL.detach()}var ar=this.axes;var aM;for(aH=0;aH<12;aH++){aM=U[aH];this.target.append(ar[aM].draw(this.baseCanvas._ctx,this));ar[aM].set()}if(ar.yaxis.show){al.left+=ar.yaxis.getWidth()}var aG=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var az=[0,0,0,0,0,0,0,0];var aC=0;var aB;for(aB=0;aB<8;aB++){if(ar[aG[aB]].show){aC+=ar[aG[aB]].getWidth();az[aB]=aC}}al.right+=aC;if(ar.x2axis.show){al.top+=ar.x2axis.getHeight()}if(this.title.show){al.top+=this.title.getHeight()}if(ar.xaxis.show){al.bottom+=ar.xaxis.getHeight()}if(this.options.gridDimensions&&L.isPlainObject(this.options.gridDimensions)){var at=parseInt(this.options.gridDimensions.width,10)||0;var aI=parseInt(this.options.gridDimensions.height,10)||0;var an=(this._width-al.left-al.right-at)/2;var aK=(this._height-al.top-al.bottom-aI)/2;if(aK>=0&&an>=0){al.top+=aK;al.bottom+=aK;al.left+=an;al.right+=an}}var am=["top","bottom","left","right"];for(var aB in am){if(this._gridPadding[am[aB]]==null&&al[am[aB]]>0){this._gridPadding[am[aB]]=al[am[aB]]}else{if(this._gridPadding[am[aB]]==null){this._gridPadding[am[aB]]=this._defaultGridPadding[am[aB]]}}}var aA=this._gridPadding;if(this.legend.placement==="outsideGrid"){aA={top:this.title.getHeight(),left:0,right:0,bottom:0};if(this.legend.location==="s"){aA.left=this._gridPadding.left;aA.right=this._gridPadding.right}}ar.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-ar.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});ar.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-ar.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});ar.x2axis.pack({position:"absolute",top:this._gridPadding.top-ar.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(aH=8;aH>0;aH--){ar[aG[aH-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-az[aH-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}var au=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-ar.yMidAxis.getWidth()/2;ar.yMidAxis.pack({position:"absolute",top:0,left:au,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.target.append(this.grid.createElement(this._gridPadding,this));this.grid.draw();var aq=this.series;var aJ=aq.length;for(aH=0,aE=aJ;aH<aE;aH++){aF=this.seriesStack[aH];this.target.append(aq[aF].shadowCanvas.createElement(this._gridPadding,"jqplot-series-shadowCanvas",null,this));aq[aF].shadowCanvas.setContext();aq[aF].shadowCanvas._elem.data("seriesIndex",aF)}for(aH=0,aE=aJ;aH<aE;aH++){aF=this.seriesStack[aH];this.target.append(aq[aF].canvas.createElement(this._gridPadding,"jqplot-series-canvas",null,this));aq[aF].canvas.setContext();aq[aF].canvas._elem.data("seriesIndex",aF)}this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas",null,this));this.eventCanvas.setContext();this.eventCanvas._ctx.fillStyle="rgba(0,0,0,0)";this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width,this.eventCanvas._ctx.canvas.height);this.bindCustomEvents();if(this.legend.preDraw){this.eventCanvas._elem.before(aL);this.legend.pack(aA);if(this.legend._elem){this.drawSeries({legendInfo:{location:this.legend.location,placement:this.legend.placement,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}})}else{this.drawSeries()}}else{this.drawSeries();if(aJ){L(aq[aJ-1].canvas._elem).after(aL)}this.legend.pack(aA)}for(var aH=0,aE=L.jqplot.eventListenerHooks.length;aH<aE;aH++){this.eventCanvas._elem.bind(L.jqplot.eventListenerHooks[aH][0],{plot:this},L.jqplot.eventListenerHooks[aH][1])}for(var aH=0,aE=this.eventListenerHooks.hooks.length;aH<aE;aH++){this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[aH][0],{plot:this},this.eventListenerHooks.hooks[aH][1])}var ay=this.fillBetween;if(ay.fill&&ay.series1!==ay.series2&&ay.series1<aJ&&ay.series2<aJ&&aq[ay.series1]._type==="line"&&aq[ay.series2]._type==="line"){this.doFillBetweenLines()}for(var aH=0,aE=L.jqplot.postDrawHooks.length;aH<aE;aH++){L.jqplot.postDrawHooks[aH].call(this)}for(var aH=0,aE=this.postDrawHooks.hooks.length;aH<aE;aH++){this.postDrawHooks.hooks[aH].apply(this,this.postDrawHooks.args[aH])}if(this.target.is(":visible")){this._drawCount+=1}var av,aw,aD,ap;for(aH=0,aE=aJ;aH<aE;aH++){av=aq[aH];aw=av.renderer;aD=".jqplot-point-label.jqplot-series-"+aH;if(aw.animation&&aw.animation._supported&&aw.animation.show&&(this._drawCount<2||this.animateReplot)){ap=this.target.find(aD);ap.stop(true,true).hide();av.canvas._elem.stop(true,true).hide();av.shadowCanvas._elem.stop(true,true).hide();av.canvas._elem.jqplotEffect("blind",{mode:"show",direction:aw.animation.direction},aw.animation.speed);av.shadowCanvas._elem.jqplotEffect("blind",{mode:"show",direction:aw.animation.direction},aw.animation.speed);ap.fadeIn(aw.animation.speed*0.8)}}ap=null;this.target.trigger("jqplotPostDraw",[this])}};R.prototype.doFillBetweenLines=function(){var an=this.fillBetween;var ax=an.series1;var av=an.series2;var aw=(ax<av)?ax:av;var au=(av>ax)?av:ax;var ar=this.series[aw];var aq=this.series[au];if(aq.renderer.smooth){var ap=aq.renderer._smoothedData.slice(0).reverse()}else{var ap=aq.gridData.slice(0).reverse()}if(ar.renderer.smooth){var at=ar.renderer._smoothedData.concat(ap)}else{var at=ar.gridData.concat(ap)}var ao=(an.color!==null)?an.color:this.series[ax].fillColor;var ay=(an.baseSeries!==null)?an.baseSeries:aw;var am=this.series[ay].renderer.shapeRenderer;var al={fillStyle:ao,fill:true,closePath:true};am.draw(ar.shadowCanvas._ctx,at,al)};this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick);this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick);this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown);this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove);this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter);this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave);if(this.captureRightClick){this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)}};function ai(av){var au=av.data.plot;var ap=au.eventCanvas._elem.offset();var at={x:av.pageX-ap.left,y:av.pageY-ap.top};var aq={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null};var ar=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];var al=au.axes;var am,ao;for(am=11;am>0;am--){ao=ar[am-1];if(al[ao].show){aq[ao]=al[ao].series_p2u(at[ao.charAt(0)])}}return{offsets:ap,gridPos:at,dataPos:aq}}function ak(al,am){var aq=am.series;var aW,aU,aT,aO,aP,aJ,aI,aw,au,az,aA,aK;var aS,aX,aQ,ar,aH,aM,aV;var an,aN;for(aT=am.seriesStack.length-1;aT>=0;aT--){aW=am.seriesStack[aT];aO=aq[aW];aV=aO._highlightThreshold;switch(aO.renderer.constructor){case L.jqplot.BarRenderer:aJ=al.x;aI=al.y;for(aU=0;aU<aO._barPoints.length;aU++){aH=aO._barPoints[aU];aQ=aO.gridData[aU];if(aJ>aH[0][0]&&aJ<aH[2][0]&&aI>aH[2][1]&&aI<aH[0][1]){return{seriesIndex:aO.index,pointIndex:aU,gridData:aQ,data:aO.data[aU],points:aO._barPoints[aU]}}}break;case L.jqplot.PyramidRenderer:aJ=al.x;aI=al.y;for(aU=0;aU<aO._barPoints.length;aU++){aH=aO._barPoints[aU];aQ=aO.gridData[aU];if(aJ>aH[0][0]+aV[0][0]&&aJ<aH[2][0]+aV[2][0]&&aI>aH[2][1]&&aI<aH[0][1]){return{seriesIndex:aO.index,pointIndex:aU,gridData:aQ,data:aO.data[aU],points:aO._barPoints[aU]}}}break;case L.jqplot.DonutRenderer:az=aO.startAngle/180*Math.PI;aJ=al.x-aO._center[0];aI=al.y-aO._center[1];aP=Math.sqrt(Math.pow(aJ,2)+Math.pow(aI,2));if(aJ>0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aP<aO._radius&&aP>aO._innerRadius){for(aU=0;aU<aO.gridData.length;aU++){aA=(aU>0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw<aK){return{seriesIndex:aO.index,pointIndex:aU,gridData:[al.x,al.y],data:aO.data[aU]}}}}break;case L.jqplot.PieRenderer:az=aO.startAngle/180*Math.PI;aJ=al.x-aO._center[0];aI=al.y-aO._center[1];aP=Math.sqrt(Math.pow(aJ,2)+Math.pow(aI,2));if(aJ>0&&-aI>=0){aw=2*Math.PI-Math.atan(-aI/aJ)}else{if(aJ>0&&-aI<0){aw=-Math.atan(-aI/aJ)}else{if(aJ<0){aw=Math.PI-Math.atan(-aI/aJ)}else{if(aJ==0&&-aI>0){aw=3*Math.PI/2}else{if(aJ==0&&-aI<0){aw=Math.PI/2}else{if(aJ==0&&aI==0){aw=0}}}}}}if(az){aw-=az;if(aw<0){aw+=2*Math.PI}else{if(aw>2*Math.PI){aw-=2*Math.PI}}}au=aO.sliceMargin/180*Math.PI;if(aP<aO._radius){for(aU=0;aU<aO.gridData.length;aU++){aA=(aU>0)?aO.gridData[aU-1][1]+au:au;aK=aO.gridData[aU][1];if(aw>aA&&aw<aK){return{seriesIndex:aO.index,pointIndex:aU,gridData:[al.x,al.y],data:aO.data[aU]}}}}break;case L.jqplot.BubbleRenderer:aJ=al.x;aI=al.y;var aF=null;if(aO.show){for(var aU=0;aU<aO.gridData.length;aU++){aQ=aO.gridData[aU];aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=aQ[2]&&(aX<=aS||aS==null)){aS=aX;aF={seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}if(aF!=null){return aF}}break;case L.jqplot.FunnelRenderer:aJ=al.x;aI=al.y;var aL=aO._vertices,ap=aL[0],ao=aL[aL.length-1],at,aE,ay;function aR(a0,a2,a1){var aZ=(a2[1]-a1[1])/(a2[0]-a1[0]);var aY=a2[1]-aZ*a2[0];var a3=a0+a2[1];return[(a3-aY)/aZ,a3]}at=aR(aI,ap[0],ao[3]);aE=aR(aI,ap[1],ao[2]);for(aU=0;aU<aL.length;aU++){ay=aL[aU];if(aI>=ay[0][1]&&aI<=ay[3][1]&&aJ>=at[0]&&aJ<=aE[0]){return{seriesIndex:aO.index,pointIndex:aU,gridData:null,data:aO.data[aU]}}}break;case L.jqplot.LineRenderer:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){if((aO.fill||(aO.renderer.bands.show&&aO.renderer.bands.fill))&&(!am.plugins.highlighter||!am.plugins.highlighter.show)){var ax=false;if(aJ>aO._boundingBox[0][0]&&aJ<aO._boundingBox[1][0]&&aI>aO._boundingBox[1][1]&&aI<aO._boundingBox[0][1]){var aD=aO._areaPoints.length;var aG;var aU=aD-1;for(var aG=0;aG<aD;aG++){var aC=[aO._areaPoints[aG][0],aO._areaPoints[aG][1]];var aB=[aO._areaPoints[aU][0],aO._areaPoints[aU][1]];if(aC[1]<aI&&aB[1]>=aI||aB[1]<aI&&aC[1]>=aI){if(aC[0]+(aI-aC[1])/(aB[1]-aC[1])*(aB[0]-aC[0])<aJ){ax=!ax}}aU=aG}}if(ax){return{seriesIndex:aW,pointIndex:null,gridData:aO.gridData,data:aO.data,points:aO._areaPoints}}break}else{aN=aO.markerRenderer.size/2+aO.neighborThreshold;an=(aN>0)?aN:0;for(var aU=0;aU<aO.gridData.length;aU++){aQ=aO.gridData[aU];if(aP.constructor==L.jqplot.OHLCRenderer){if(aP.candleStick){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{if(aQ[0]!=null&&aQ[1]!=null){aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}}}break;default:aJ=al.x;aI=al.y;aP=aO.renderer;if(aO.show){aN=aO.markerRenderer.size/2+aO.neighborThreshold;an=(aN>0)?aN:0;for(var aU=0;aU<aO.gridData.length;aU++){aQ=aO.gridData[aU];if(aP.constructor==L.jqplot.OHLCRenderer){if(aP.candleStick){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._bodyWidth/2&&aJ<=aQ[0]+aP._bodyWidth/2&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{if(!aP.hlc){var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][2])&&aI<=av(aO.data[aU][3])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}else{var av=aO._yaxis.series_u2p;if(aJ>=aQ[0]-aP._tickLength&&aJ<=aQ[0]+aP._tickLength&&aI>=av(aO.data[aU][1])&&aI<=av(aO.data[aU][2])){return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}else{aX=Math.sqrt((aJ-aQ[0])*(aJ-aQ[0])+(aI-aQ[1])*(aI-aQ[1]));if(aX<=an&&(aX<=aS||aS==null)){aS=aX;return{seriesIndex:aW,pointIndex:aU,gridData:aQ,data:aO.data[aU]}}}}}break}}return null}this.onClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onDblClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotDblClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseDown=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseDown");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseUp=function(an){var am=ai(an);var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,null,an.data.plot])};this.onRightClick=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);if(ap.captureRightClick){if(an.which==3){var al=L.Event("jqplotRightClick");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}else{var al=L.Event("jqplotMouseUp");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])}}};this.onMouseMove=function(an){var am=ai(an);var ap=an.data.plot;var ao=ak(am.gridPos,ap);var al=L.Event("jqplotMouseMove");al.pageX=an.pageX;al.pageY=an.pageY;L(this).trigger(al,[am.gridPos,am.dataPos,ao,ap])};this.onMouseEnter=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseEnter");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.onMouseLeave=function(an){var am=ai(an);var ao=an.data.plot;var al=L.Event("jqplotMouseLeave");al.pageX=an.pageX;al.pageY=an.pageY;al.relatedTarget=an.relatedTarget;L(this).trigger(al,[am.gridPos,am.dataPos,null,ao])};this.drawSeries=function(an,al){var ap,ao,am;al=(typeof(an)==="number"&&al==null)?an:al;an=(typeof(an)==="object")?an:{};if(al!=u){ao=this.series[al];am=ao.shadowCanvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.drawShadow(am,an,this);am=ao.canvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.draw(am,an,this);if(ao.renderer.constructor==L.jqplot.BezierCurveRenderer){if(al<this.series.length-1){this.drawSeries(al+1)}}}else{for(ap=0;ap<this.series.length;ap++){ao=this.series[ap];am=ao.shadowCanvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.drawShadow(am,an,this);am=ao.canvas._ctx;am.clearRect(0,0,am.canvas.width,am.canvas.height);ao.draw(am,an,this)}}an=al=ap=ao=am=null};this.moveSeriesToFront=function(am){am=parseInt(am,10);var ap=L.inArray(am,this.seriesStack);if(ap==-1){return}if(ap==this.seriesStack.length-1){this.previousSeriesStack=this.seriesStack.slice(0);return}var al=this.seriesStack[this.seriesStack.length-1];var ao=this.series[am].canvas._elem.detach();var an=this.series[am].shadowCanvas._elem.detach();this.series[al].shadowCanvas._elem.after(an);this.series[al].canvas._elem.after(ao);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(ap,1);this.seriesStack.push(am)};this.moveSeriesToBack=function(am){am=parseInt(am,10);var ap=L.inArray(am,this.seriesStack);if(ap==0||ap==-1){return}var al=this.seriesStack[0];var ao=this.series[am].canvas._elem.detach();var an=this.series[am].shadowCanvas._elem.detach();this.series[al].shadowCanvas._elem.before(an);this.series[al].canvas._elem.before(ao);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(ap,1);this.seriesStack.unshift(am)};this.restorePreviousSeriesOrder=function(){var ar,aq,ap,ao,an,al,am;if(this.seriesStack==this.previousSeriesStack){return}for(ar=1;ar<this.previousSeriesStack.length;ar++){al=this.previousSeriesStack[ar];am=this.previousSeriesStack[ar-1];ap=this.series[al].canvas._elem.detach();ao=this.series[al].shadowCanvas._elem.detach();this.series[am].shadowCanvas._elem.after(ao);this.series[am].canvas._elem.after(ap)}an=this.seriesStack.slice(0);this.seriesStack=this.previousSeriesStack.slice(0);this.previousSeriesStack=an};this.restoreOriginalSeriesOrder=function(){var ap,ao,al=[],an,am;for(ap=0;ap<this.series.length;ap++){al.push(ap)}if(this.seriesStack==al){return}this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack=al;for(ap=1;ap<this.seriesStack.length;ap++){an=this.series[ap].canvas._elem.detach();am=this.series[ap].shadowCanvas._elem.detach();this.series[ap-1].shadowCanvas._elem.after(am);this.series[ap-1].canvas._elem.after(an)}};this.activateTheme=function(al){this.themeEngine.activate(this,al)}}L.jqplot.computeHighlightColors=function(ai){var ak;if(L.isArray(ai)){ak=[];for(var am=0;am<ai.length;am++){var al=L.jqplot.getColorComponents(ai[am]);var ah=[al[0],al[1],al[2]];var an=ah[0]+ah[1]+ah[2];for(var aj=0;aj<3;aj++){ah[aj]=(an>660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak.push("rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")")}}else{var al=L.jqplot.getColorComponents(ai);var ah=[al[0],al[1],al[2]];var an=ah[0]+ah[1]+ah[2];for(var aj=0;aj<3;aj++){ah[aj]=(an>660)?ah[aj]*0.85:0.73*ah[aj]+90;ah[aj]=parseInt(ah[aj],10);(ah[aj]>255)?255:ah[aj]}ah[3]=0.3+0.35*al[3];ak="rgba("+ah[0]+","+ah[1]+","+ah[2]+","+ah[3]+")"}return ak};L.jqplot.ColorGenerator=function(ai){ai=ai||L.jqplot.config.defaultColors;var ah=0;this.next=function(){if(ah<ai.length){return ai[ah++]}else{ah=0;return ai[ah++]}};this.previous=function(){if(ah>0){return ai[ah--]}else{ah=ai.length-1;return ai[ah]}};this.get=function(ak){var aj=ak-ai.length*Math.floor(ak/ai.length);return ai[aj]};this.setColors=function(aj){ai=aj};this.reset=function(){ah=0};this.getIndex=function(){return ah};this.setIndex=function(aj){ah=aj}};L.jqplot.hex2rgb=function(aj,ah){aj=aj.replace("#","");if(aj.length==3){aj=aj.charAt(0)+aj.charAt(0)+aj.charAt(1)+aj.charAt(1)+aj.charAt(2)+aj.charAt(2)}var ai;ai="rgba("+parseInt(aj.slice(0,2),16)+", "+parseInt(aj.slice(2,4),16)+", "+parseInt(aj.slice(4,6),16);if(ah){ai+=", "+ah}ai+=")";return ai};L.jqplot.rgb2hex=function(am){var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var ah=am.match(aj);var al="#";for(var ak=1;ak<4;ak++){var ai;if(ah[ak].search(/%/)!=-1){ai=parseInt(255*ah[ak]/100,10).toString(16);if(ai.length==1){ai="0"+ai}}else{ai=parseInt(ah[ak],10).toString(16);if(ai.length==1){ai="0"+ai}}al+=ai}return al};L.jqplot.normalize2rgb=function(ai,ah){if(ai.search(/^ *rgba?\(/)!=-1){return ai}else{if(ai.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return L.jqplot.hex2rgb(ai,ah)}else{throw new Error("Invalid color spec")}}};L.jqplot.getColorComponents=function(am){am=L.jqplot.colorKeywordMap[am]||am;var ak=L.jqplot.normalize2rgb(am);var aj=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var ah=ak.match(aj);var ai=[];for(var al=1;al<4;al++){if(ah[al].search(/%/)!=-1){ai[al-1]=parseInt(255*ah[al]/100,10)}else{ai[al-1]=parseInt(ah[al],10)}}ai[3]=parseFloat(ah[4])?parseFloat(ah[4]):1;return ai};L.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"};L.jqplot.AxisLabelRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this.fontFamily=null;this.fontSize=null;this.textColor=null;this._elem;this.escapeHTML=false;L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisLabelRenderer.prototype.constructor=L.jqplot.AxisLabelRenderer;L.jqplot.AxisLabelRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisLabelRenderer.prototype.draw=function(ah,ai){if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};L.jqplot.AxisLabelRenderer.prototype.pack=function(){};L.jqplot.AxisTickRenderer=function(ah){L.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label=null;this.value=null;this._styles={};this.formatter=L.jqplot.DefaultTickFormatter;this.prefix="";this.suffix="";this.formatString="";this.fontFamily;this.fontSize;this.textColor;this.escapeHTML=false;this._elem;this._breakTick=false;L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.AxisTickRenderer.prototype=new L.jqplot.ElemContainer();L.jqplot.AxisTickRenderer.prototype.constructor=L.jqplot.AxisTickRenderer;L.jqplot.AxisTickRenderer.prototype.setTick=function(ah,aj,ai){this.value=ah;this.axis=aj;if(ai){this.isMinorTick=true}return this};L.jqplot.AxisTickRenderer.prototype.draw=function(){if(this.label===null){this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix}var ai={position:"absolute"};if(Number(this.label)){ai.whitSpace="nowrap"}if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L(document.createElement("div"));this._elem.addClass("jqplot-"+this.axis+"-tick");if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}this._elem.css(ai);for(var ah in this._styles){this._elem.css(ah,this._styles[ah])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}if(this._breakTick){this._elem.addClass("jqplot-breakTick")}return this._elem};L.jqplot.DefaultTickFormatter=function(ah,ai){if(typeof ai=="number"){if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.PercentTickFormatter=function(ah,ai){if(typeof ai=="number"){ai=100*ai;if(!ah){ah=L.jqplot.config.defaultTickFormatString}return L.jqplot.sprintf(ah,ai)}else{return String(ai)}};L.jqplot.AxisTickRenderer.prototype.pack=function(){};L.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.CanvasGridRenderer.prototype.init=function(ai){this._ctx;L.extend(true,this,ai);var ah={lineJoin:"miter",lineCap:"round",fill:false,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:false,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(ah)};L.jqplot.CanvasGridRenderer.prototype.createElement=function(ak){var aj;if(this._elem){if(L.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==u){aj=this._elem.get(0);window.G_vmlCanvasManager.uninitElement(aj);aj=null}this._elem.emptyForce();this._elem=null}aj=ak.canvasManager.getCanvas();var ah=this._plotDimensions.width;var ai=this._plotDimensions.height;aj.width=ah;aj.height=ai;this._elem=L(aj);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});aj=ak.canvasManager.initCanvas(aj);this._top=this._offsets.top;this._bottom=ai-this._offsets.bottom;this._left=this._offsets.left;this._right=ah-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;aj=null;return this._elem};L.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var at=this._ctx;var aw=this._axes;at.save();at.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height);at.fillStyle=this.backgroundColor||this.background;at.fillRect(this._left,this._top,this._width,this._height);at.save();at.lineJoin="miter";at.lineCap="butt";at.lineWidth=this.gridLineWidth;at.strokeStyle=this.gridLineColor;var aA,az,ap,aq;var am=["xaxis","yaxis","x2axis","y2axis"];for(var ay=4;ay>0;ay--){var aD=am[ay-1];var ah=aw[aD];var aB=ah._ticks;var ar=aB.length;if(ah.show){if(ah.drawBaseline){var aC={};if(ah.baselineWidth!==null){aC.lineWidth=ah.baselineWidth}if(ah.baselineColor!==null){aC.strokeStyle=ah.baselineColor}switch(aD){case"xaxis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"yaxis":ao(this._left,this._bottom,this._left,this._top,aC);break;case"x2axis":ao(this._left,this._bottom,this._right,this._bottom,aC);break;case"y2axis":ao(this._right,this._bottom,this._right,this._top,aC);break}}for(var au=ar;au>0;au--){var an=aB[au-1];if(an.show){var ak=Math.round(ah.u2p(an.value))+0.5;switch(aD){case"xaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._top,ak,this._bottom)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._bottom;az=this._bottom+ap;break;case"inside":aA=this._bottom-ap;az=this._bottom;break;case"cross":aA=this._bottom-ap;az=this._bottom+ap;break;default:aA=this._bottom;az=this._bottom+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"yaxis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._right,ak,this._left,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._left-ap;az=this._left;break;case"inside":aA=this._left;az=this._left+ap;break;case"cross":aA=this._left-ap;az=this._left+ap;break;default:aA=this._left-ap;az=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;case"x2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(ak,this._bottom,ak,this._top)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._top-ap;az=this._top;break;case"inside":aA=this._top;az=this._top+ap;break;case"cross":aA=this._top-ap;az=this._top+ap;break;default:aA=this._top-ap;az=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[ak,aA],[ak,az]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ao(ak,aA,ak,az)}break;case"y2axis":if(an.showGridline&&this.drawGridlines&&((!an.isMinorTick&&ah.drawMajorGridlines)||(an.isMinorTick&&ah.drawMinorGridlines))){ao(this._left,ak,this._right,ak)}if(an.showMark&&an.mark&&((!an.isMinorTick&&ah.drawMajorTickMarks)||(an.isMinorTick&&ah.drawMinorTickMarks))){ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;switch(aq){case"outside":aA=this._right;az=this._right+ap;break;case"inside":aA=this._right-ap;az=this._right;break;case"cross":aA=this._right-ap;az=this._right+ap;break;default:aA=this._right;az=this._right+ap;break}if(this.shadow){this.renderer.shadowRenderer.draw(at,[[aA,ak],[az,ak]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}break;default:break}}}an=null}ah=null;aB=null}am=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var ay=7;ay>0;ay--){var ah=aw[am[ay-1]];var aB=ah._ticks;if(ah.show){var ai=aB[ah.numberTicks-1];var al=aB[0];var aj=ah.getLeft();var av=[[aj,ai.getTop()+ai.getHeight()/2],[aj,al.getTop()+al.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",fill:false,closePath:false})}ao(av[0][0],av[0][1],av[1][0],av[1][1],{lineCap:"butt",strokeStyle:ah.borderColor,lineWidth:ah.borderWidth});for(var au=aB.length;au>0;au--){var an=aB[au-1];ap=an.markSize;aq=an.mark;var ak=Math.round(ah.u2p(an.value))+0.5;if(an.showMark&&an.mark){switch(aq){case"outside":aA=aj;az=aj+ap;break;case"inside":aA=aj-ap;az=aj;break;case"cross":aA=aj-ap;az=aj+ap;break;default:aA=aj;az=aj+ap;break}av=[[aA,ak],[az,ak]];if(this.shadow){this.renderer.shadowRenderer.draw(at,av,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ao(aA,ak,az,ak,{strokeStyle:ah.borderColor})}an=null}al=null}ah=null;aB=null}at.restore();function ao(aH,aG,aE,ax,aF){at.save();aF=aF||{};if(aF.lineWidth==null||aF.lineWidth!=0){L.extend(true,at,aF);at.beginPath();at.moveTo(aH,aG);at.lineTo(aE,ax);at.stroke();at.restore()}}if(this.shadow){var av=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(at,av)}if(this.borderWidth!=0&&this.drawBorder){ao(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:aw.x2axis.borderColor,lineWidth:aw.x2axis.borderWidth});ao(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:aw.y2axis.borderColor,lineWidth:aw.y2axis.borderWidth});ao(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:aw.xaxis.borderColor,lineWidth:aw.xaxis.borderWidth});ao(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:aw.yaxis.borderColor,lineWidth:aw.yaxis.borderWidth})}at.restore();at=null;aw=null};L.jqplot.DivTitleRenderer=function(){};L.jqplot.DivTitleRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.DivTitleRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}var ak=this.renderer;var aj=document.createElement("div");this._elem=L(aj);this._elem.addClass("jqplot-title");if(!this.text){this.show=false;this._elem.height(0);this._elem.width(0)}else{if(this.text){var ah;if(this.color){ah=this.color}else{if(this.textColor){ah=this.textColor}}var ai={position:"absolute",top:"0px",left:"0px"};if(this._plotWidth){ai.width=this._plotWidth+"px"}if(this.fontSize){ai.fontSize=this.fontSize}if(typeof this.textAlign==="string"){ai.textAlign=this.textAlign}else{ai.textAlign="center"}if(ah){ai.color=ah}if(this.paddingBottom){ai.paddingBottom=this.paddingBottom}if(this.fontFamily){ai.fontFamily=this.fontFamily}this._elem.css(ai);if(this.escapeHtml){this._elem.text(this.text)}else{this._elem.html(this.text)}}}aj=null;return this._elem};L.jqplot.DivTitleRenderer.prototype.pack=function(){};var r=0.1;L.jqplot.LinePattern=function(aw,aq){var ap={dotted:[r,L.jqplot.config.dotGapLength],dashed:[L.jqplot.config.dashLength,L.jqplot.config.gapLength],solid:null};if(typeof aq==="string"){if(aq[0]==="."||aq[0]==="-"){var ax=aq;aq=[];for(var ao=0,al=ax.length;ao<al;ao++){if(ax[ao]==="."){aq.push(r)}else{if(ax[ao]==="-"){aq.push(L.jqplot.config.dashLength)}else{continue}}aq.push(L.jqplot.config.gapLength)}}else{aq=ap[aq]}}if(!(aq&&aq.length)){return aw}var ak=0;var ar=aq[0];var au=0;var at=0;var an=0;var ah=0;var av=function(ay,az){aw.moveTo(ay,az);au=ay;at=az;an=ay;ah=az};var aj=function(ay,aE){var aC=aw.lineWidth;var aA=ay-au;var az=aE-at;var aB=Math.sqrt(aA*aA+az*az);if((aB>0)&&(aC>0)){aA/=aB;az/=aB;while(true){var aD=aC*ar;if(aD<aB){au+=aD*aA;at+=aD*az;if((ak&1)==0){aw.lineTo(au,at)}else{aw.moveTo(au,at)}aB-=aD;ak++;if(ak>=aq.length){ak=0}ar=aq[ak]}else{au=ay;at=aE;if((ak&1)==0){aw.lineTo(au,at)}else{aw.moveTo(au,at)}ar-=aB/aC;break}}}};var ai=function(){aw.beginPath()};var am=function(){aj(an,ah)};return{moveTo:av,lineTo:aj,beginPath:ai,closePath:am}};L.jqplot.LineRenderer=function(){this.shapeRenderer=new L.jqplot.ShapeRenderer();this.shadowRenderer=new L.jqplot.ShadowRenderer()};L.jqplot.LineRenderer.prototype.init=function(ai,an){ai=ai||{};this._type="line";this.renderer.animation={show:false,direction:"left",speed:2500,_supported:true};this.renderer.smooth=false;this.renderer.tension=null;this.renderer.constrainSmoothing=true;this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];this.renderer.bandData=[];this.renderer.bands={show:false,hiData:[],lowData:[],color:this.color,showLines:false,fill:true,fillColor:null,_min:null,_max:null,interval:"3%"};var al={highlightMouseOver:ai.highlightMouseOver,highlightMouseDown:ai.highlightMouseDown,highlightColor:ai.highlightColor};delete (ai.highlightMouseOver);delete (ai.highlightMouseDown);delete (ai.highlightColor);L.extend(true,this.renderer,ai);this.renderer.options=ai;if(this.renderer.bandData.length>1&&(!ai.bands||ai.bands.show==null)){this.renderer.bands.show=true}else{if(ai.bands&&ai.bands.show==null&&ai.bands.interval!=null){this.renderer.bands.show=true}}if(this.fill){this.renderer.bands.show=false}if(this.renderer.bands.show){this.renderer.initBands.call(this,this.renderer.options,an)}if(this._stack){this.renderer.smooth=false}var am={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shapeRenderer.init(am);var aj=ai.shadowOffset;if(aj==null){if(this.lineWidth>2.5){aj=1.25*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{aj=1.25*Math.atan((this.lineWidth/2.5))/0.785398163}}var ah={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,angle:this.shadowAngle,offset:aj,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shadowRenderer.init(ah);this._areaPoints=[];this._boundingBox=[[],[]];if(!this.isTrendline&&this.fill||this.renderer.bands.show){this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColor=null;if(al.highlightMouseDown&&al.highlightMouseOver==null){al.highlightMouseOver=false}L.extend(true,this,{highlightMouseOver:al.highlightMouseOver,highlightMouseDown:al.highlightMouseDown,highlightColor:al.highlightColor});if(!this.highlightColor){var ak=(this.renderer.bands.show)?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=L.jqplot.computeHighlightColors(ak)}if(this.highlighter){this.highlighter.show=false}}if(!this.isTrendline&&an){an.plugins.lineRenderer={};an.postInitHooks.addOnce(z);an.postDrawHooks.addOnce(af);an.eventListenerHooks.addOnce("jqplotMouseMove",h);an.eventListenerHooks.addOnce("jqplotMouseDown",e);an.eventListenerHooks.addOnce("jqplotMouseUp",ad);an.eventListenerHooks.addOnce("jqplotClick",g);an.eventListenerHooks.addOnce("jqplotRightClick",s)}};L.jqplot.LineRenderer.prototype.initBands=function(ak,av){var al=ak.bandData||[];var an=this.renderer.bands;an.hiData=[];an.lowData=[];var aB=this.data;an._max=null;an._min=null;if(al.length==2){if(L.isArray(al[0][0])){var ao;var ah=0,ar=0;for(var aw=0,at=al[0].length;aw<at;aw++){ao=al[0][aw];if((ao[1]!=null&&ao[1]>an._max)||an._max==null){an._max=ao[1]}if((ao[1]!=null&&ao[1]<an._min)||an._min==null){an._min=ao[1]}}for(var aw=0,at=al[1].length;aw<at;aw++){ao=al[1][aw];if((ao[1]!=null&&ao[1]>an._max)||an._max==null){an._max=ao[1];ar=1}if((ao[1]!=null&&ao[1]<an._min)||an._min==null){an._min=ao[1];ah=1}}if(ar===ah){an.show=false}an.hiData=al[ar];an.lowData=al[ah]}else{if(al[0].length===aB.length&&al[1].length===aB.length){var aj=(al[0][0]>al[1][0])?0:1;var aC=(aj)?0:1;for(var aw=0,at=aB.length;aw<at;aw++){an.hiData.push([aB[aw][0],al[aj][aw]]);an.lowData.push([aB[aw][0],al[aC][aw]])}}else{an.show=false}}}else{if(al.length>2&&!L.isArray(al[0][0])){var aj=(al[0][0]>al[0][1])?0:1;var aC=(aj)?0:1;for(var aw=0,at=al.length;aw<at;aw++){an.hiData.push([aB[aw][0],al[aw][aj]]);an.lowData.push([aB[aw][0],al[aw][aC]])}}else{var aq=an.interval;var aA=null;var az=null;var ai=null;var au=null;if(L.isArray(aq)){aA=aq[0];az=aq[1]}else{aA=aq}if(isNaN(aA)){if(aA.charAt(aA.length-1)==="%"){ai="multiply";aA=parseFloat(aA)/100+1}}else{aA=parseFloat(aA);ai="add"}if(az!==null&&isNaN(az)){if(az.charAt(az.length-1)==="%"){au="multiply";az=parseFloat(az)/100+1}}else{if(az!==null){az=parseFloat(az);au="add"}}if(aA!==null){if(az===null){az=-aA;au=ai;if(au==="multiply"){az+=2}}if(aA<az){var ax=aA;aA=az;az=ax;ax=ai;ai=au;au=ax}for(var aw=0,at=aB.length;aw<at;aw++){switch(ai){case"add":an.hiData.push([aB[aw][0],aB[aw][1]+aA]);break;case"multiply":an.hiData.push([aB[aw][0],aB[aw][1]*aA]);break}switch(au){case"add":an.lowData.push([aB[aw][0],aB[aw][1]+az]);break;case"multiply":an.lowData.push([aB[aw][0],aB[aw][1]*az]);break}}}else{an.show=false}}}var am=an.hiData;var ap=an.lowData;for(var aw=0,at=am.length;aw<at;aw++){if((am[aw][1]!=null&&am[aw][1]>an._max)||an._max==null){an._max=am[aw][1]}}for(var aw=0,at=ap.length;aw<at;aw++){if((ap[aw][1]!=null&&ap[aw][1]<an._min)||an._min==null){an._min=ap[aw][1]}}if(an.fillColor===null){var ay=L.jqplot.getColorComponents(an.color);ay[3]=ay[3]*0.5;an.fillColor="rgba("+ay[0]+", "+ay[1]+", "+ay[2]+", "+ay[3]+")"}};function K(ai,ah){return(3.4182054+ah)*Math.pow(ai,-0.3534992)}function n(aj,ai){var ah=Math.sqrt(Math.pow((ai[0]-aj[0]),2)+Math.pow((ai[1]-aj[1]),2));return 5.7648*Math.log(ah)+7.4456}function A(ah){var ai=(Math.exp(2*ah)-1)/(Math.exp(2*ah)+1);return ai}function J(aJ){var at=this.renderer.smooth;var aD=this.canvas.getWidth();var an=this._xaxis.series_p2u;var aG=this._yaxis.series_p2u;var aF=null;var am=null;var az=aJ.length/aD;var aj=[];var ay=[];if(!isNaN(parseFloat(at))){aF=parseFloat(at)}else{aF=K(az,0.5)}var aw=[];var ak=[];for(var aE=0,aA=aJ.length;aE<aA;aE++){aw.push(aJ[aE][1]);ak.push(aJ[aE][0])}function av(aK,aL){if(aK-aL==0){return Math.pow(10,10)}else{return aK-aL}}var ax,ar,aq,ap;var ah=aJ.length-1;for(var al=1,aB=aJ.length;al<aB;al++){var ai=[];var au=[];for(var aC=0;aC<2;aC++){var aE=al-1+aC;if(aE==0||aE==ah){ai[aC]=Math.pow(10,10)}else{if(aw[aE+1]-aw[aE]==0||aw[aE]-aw[aE-1]==0){ai[aC]=0}else{if(((ak[aE+1]-ak[aE])/(aw[aE+1]-aw[aE])+(ak[aE]-ak[aE-1])/(aw[aE]-aw[aE-1]))==0){ai[aC]=0}else{if((aw[aE+1]-aw[aE])*(aw[aE]-aw[aE-1])<0){ai[aC]=0}else{ai[aC]=2/(av(ak[aE+1],ak[aE])/(aw[aE+1]-aw[aE])+av(ak[aE],ak[aE-1])/(aw[aE]-aw[aE-1]))}}}}}if(al==1){ai[0]=3/2*(aw[1]-aw[0])/av(ak[1],ak[0])-ai[1]/2}else{if(al==ah){ai[1]=3/2*(aw[ah]-aw[ah-1])/av(ak[ah],ak[ah-1])-ai[0]/2}}au[0]=-2*(ai[1]+2*ai[0])/av(ak[al],ak[al-1])+6*(aw[al]-aw[al-1])/Math.pow(av(ak[al],ak[al-1]),2);au[1]=2*(2*ai[1]+ai[0])/av(ak[al],ak[al-1])-6*(aw[al]-aw[al-1])/Math.pow(av(ak[al],ak[al-1]),2);ap=1/6*(au[1]-au[0])/av(ak[al],ak[al-1]);aq=1/2*(ak[al]*au[0]-ak[al-1]*au[1])/av(ak[al],ak[al-1]);ar=(aw[al]-aw[al-1]-aq*(Math.pow(ak[al],2)-Math.pow(ak[al-1],2))-ap*(Math.pow(ak[al],3)-Math.pow(ak[al-1],3)))/av(ak[al],ak[al-1]);ax=aw[al-1]-ar*ak[al-1]-aq*Math.pow(ak[al-1],2)-ap*Math.pow(ak[al-1],3);var aI=(ak[al]-ak[al-1])/aF;var aH,ao;for(var aC=0,aA=aF;aC<aA;aC++){aH=[];ao=ak[al-1]+aC*aI;aH.push(ao);aH.push(ax+ar*ao+aq*Math.pow(ao,2)+ap*Math.pow(ao,3));aj.push(aH);ay.push([an(aH[0]),aG(aH[1])])}}aj.push(aJ[aE]);ay.push([an(aJ[aE][0]),aG(aJ[aE][1])]);return[aj,ay]}function F(ap){var ao=this.renderer.smooth;var aU=this.renderer.tension;var ah=this.canvas.getWidth();var aH=this._xaxis.series_p2u;var aq=this._yaxis.series_p2u;var aI=null;var aJ=null;var aT=null;var aO=null;var aM=null;var at=null;var aR=null;var am=null;var aK,aL,aD,aC,aA,ay;var ak,ai,av,au;var aB,az,aN;var aw=[];var aj=[];var al=ap.length/ah;var aS,ax,aF,aG,aE;var ar=[];var an=[];if(!isNaN(parseFloat(ao))){aI=parseFloat(ao)}else{aI=K(al,0.5)}if(!isNaN(parseFloat(aU))){aU=parseFloat(aU)}for(var aQ=0,aP=ap.length-1;aQ<aP;aQ++){if(aU===null){at=Math.abs((ap[aQ+1][1]-ap[aQ][1])/(ap[aQ+1][0]-ap[aQ][0]));aS=0.3;ax=0.6;aF=(ax-aS)/2;aG=2.5;aE=-1.4;am=at/aG+aE;aO=aF*A(am)-aF*A(aE)+aS;if(aQ>0){aR=Math.abs((ap[aQ][1]-ap[aQ-1][1])/(ap[aQ][0]-ap[aQ-1][0]))}am=aR/aG+aE;aM=aF*A(am)-aF*A(aE)+aS;aT=(aO+aM)/2}else{aT=aU}for(aK=0;aK<aI;aK++){aL=aK/aI;aD=(1+2*aL)*Math.pow((1-aL),2);aC=aL*Math.pow((1-aL),2);aA=Math.pow(aL,2)*(3-2*aL);ay=Math.pow(aL,2)*(aL-1);if(ap[aQ-1]){ak=aT*(ap[aQ+1][0]-ap[aQ-1][0]);ai=aT*(ap[aQ+1][1]-ap[aQ-1][1])}else{ak=aT*(ap[aQ+1][0]-ap[aQ][0]);ai=aT*(ap[aQ+1][1]-ap[aQ][1])}if(ap[aQ+2]){av=aT*(ap[aQ+2][0]-ap[aQ][0]);au=aT*(ap[aQ+2][1]-ap[aQ][1])}else{av=aT*(ap[aQ+1][0]-ap[aQ][0]);au=aT*(ap[aQ+1][1]-ap[aQ][1])}aB=aD*ap[aQ][0]+aA*ap[aQ+1][0]+aC*ak+ay*av;az=aD*ap[aQ][1]+aA*ap[aQ+1][1]+aC*ai+ay*au;aN=[aB,az];ar.push(aN);an.push([aH(aB),aq(az)])}}ar.push(ap[aP]);an.push([aH(ap[aP][0]),aq(ap[aP][1])]);return[ar,an]}L.jqplot.LineRenderer.prototype.setGridData=function(ap){var al=this._xaxis.series_u2p;var ah=this._yaxis.series_u2p;var am=this._plotData;var aq=this._prevPlotData;this.gridData=[];this._prevGridData=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var ak=this.renderer.bands;var ai=false;for(var an=0,aj=am.length;an<aj;an++){if(am[an][0]!=null&&am[an][1]!=null){this.gridData.push([al.call(this._xaxis,am[an][0]),ah.call(this._yaxis,am[an][1])])}else{if(am[an][0]==null){ai=true;this.gridData.push([null,ah.call(this._yaxis,am[an][1])])}else{if(am[an][1]==null){ai=true;this.gridData.push([al.call(this._xaxis,am[an][0]),null])}}}if(aq[an]!=null&&aq[an][0]!=null&&aq[an][1]!=null){this._prevGridData.push([al.call(this._xaxis,aq[an][0]),ah.call(this._yaxis,aq[an][1])])}else{if(aq[an]!=null&&aq[an][0]==null){this._prevGridData.push([null,ah.call(this._yaxis,aq[an][1])])}else{if(aq[an]!=null&&aq[an][0]!=null&&aq[an][1]==null){this._prevGridData.push([al.call(this._xaxis,aq[an][0]),null])}}}}if(ai){this.renderer.smooth=false;if(this._type==="line"){ak.show=false}}if(this._type==="line"&&ak.show){for(var an=0,aj=ak.hiData.length;an<aj;an++){this.renderer._hiBandGridData.push([al.call(this._xaxis,ak.hiData[an][0]),ah.call(this._yaxis,ak.hiData[an][1])])}for(var an=0,aj=ak.lowData.length;an<aj;an++){this.renderer._lowBandGridData.push([al.call(this._xaxis,ak.lowData[an][0]),ah.call(this._yaxis,ak.lowData[an][1])])}}if(this._type==="line"&&this.renderer.smooth&&this.gridData.length>2){var ao;if(this.renderer.constrainSmoothing){ao=J.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}else{ao=F.call(this,this.gridData);this.renderer._smoothedData=ao[0];this.renderer._smoothedPlotData=ao[1];if(ak.show){ao=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ao[0];ao=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ao[0]}ao=null}}};L.jqplot.LineRenderer.prototype.makeGridData=function(ao,aq){var am=this._xaxis.series_u2p;var ah=this._yaxis.series_u2p;var ar=[];var aj=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var al=this.renderer.bands;var ai=false;for(var an=0;an<ao.length;an++){if(ao[an][0]!=null&&ao[an][1]!=null){ar.push([am.call(this._xaxis,ao[an][0]),ah.call(this._yaxis,ao[an][1])])}else{if(ao[an][0]==null){ai=true;ar.push([null,ah.call(this._yaxis,ao[an][1])])}else{if(ao[an][1]==null){ai=true;ar.push([am.call(this._xaxis,ao[an][0]),null])}}}}if(ai){this.renderer.smooth=false;if(this._type==="line"){al.show=false}}if(this._type==="line"&&al.show){for(var an=0,ak=al.hiData.length;an<ak;an++){this.renderer._hiBandGridData.push([am.call(this._xaxis,al.hiData[an][0]),ah.call(this._yaxis,al.hiData[an][1])])}for(var an=0,ak=al.lowData.length;an<ak;an++){this.renderer._lowBandGridData.push([am.call(this._xaxis,al.lowData[an][0]),ah.call(this._yaxis,al.lowData[an][1])])}}if(this._type==="line"&&this.renderer.smooth&&ar.length>2){var ap;if(this.renderer.constrainSmoothing){ap=J.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=J.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=J.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}else{ap=F.call(this,ar);this.renderer._smoothedData=ap[0];this.renderer._smoothedPlotData=ap[1];if(al.show){ap=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ap[0];ap=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ap[0]}ap=null}}return ar};L.jqplot.LineRenderer.prototype.draw=function(ax,aI,ai,aB){var aC;var aq=L.extend(true,{},ai);var ak=(aq.shadow!=u)?aq.shadow:this.shadow;var aJ=(aq.showLine!=u)?aq.showLine:this.showLine;var aA=(aq.fill!=u)?aq.fill:this.fill;var ah=(aq.fillAndStroke!=u)?aq.fillAndStroke:this.fillAndStroke;var ar,ay,av,aE;ax.save();if(aI.length){if(aJ){if(aA){if(this.fillToZero){var aF=this.negativeColor;if(!this.useNegativeColors){aF=aq.fillStyle}var ao=false;var ap=aq.fillStyle;if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var aw=[];var aL=(this.renderer.smooth)?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var aG=this._yaxis.series_u2p(this.fillToValue);var aj=this._xaxis.series_u2p(this.fillToValue);aq.closePath=true;if(this.fillAxis=="y"){aw.push([aI[0][0],aG]);this._areaPoints.push([aI[0][0],aG]);for(var aC=0;aC<aI.length-1;aC++){aw.push(aI[aC]);this._areaPoints.push(aI[aC]);if(aL[aC][1]*aL[aC+1][1]<=0){if(aL[aC][1]<0){ao=true;aq.fillStyle=aF}else{ao=false;aq.fillStyle=ap}var an=aI[aC][0]+(aI[aC+1][0]-aI[aC][0])*(aG-aI[aC][1])/(aI[aC+1][1]-aI[aC][1]);aw.push([an,aG]);this._areaPoints.push([an,aG]);if(ak){this.renderer.shadowRenderer.draw(ax,aw,aq)}this.renderer.shapeRenderer.draw(ax,aw,aq);aw=[[an,aG]]}}if(aL[aI.length-1][1]<0){ao=true;aq.fillStyle=aF}else{ao=false;aq.fillStyle=ap}aw.push(aI[aI.length-1]);this._areaPoints.push(aI[aI.length-1]);aw.push([aI[aI.length-1][0],aG]);this._areaPoints.push([aI[aI.length-1][0],aG])}if(ak){this.renderer.shadowRenderer.draw(ax,aw,aq)}this.renderer.shapeRenderer.draw(ax,aw,aq)}else{var au=this._prevGridData;for(var aC=au.length;aC>0;aC--){aI.push(au[aC-1])}if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this._areaPoints=aI;this.renderer.shapeRenderer.draw(ax,aI,aq)}}else{if(ah){var aH=aI.slice(0)}if(this.index==0||!this._stack){var al=ax.canvas.height;aI.unshift([aI[0][0],al]);var aD=aI.length;aI.push([aI[aD-1][0],al])}else{var au=this._prevGridData;for(var aC=au.length;aC>0;aC--){aI.push(au[aC-1])}}this._areaPoints=aI;if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this.renderer.shapeRenderer.draw(ax,aI,aq)}if(ah){var az=L.extend(true,{},aq,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(ax,aH,az);if(this.markerRenderer.show){if(this.renderer.smooth){aH=this.gridData}for(aC=0;aC<aH.length;aC++){this.markerRenderer.draw(aH[aC][0],aH[aC][1],ax,aq.markerOptions)}}}}else{if(this.renderer.bands.show){var am;var aK=L.extend(true,{},aq);if(this.renderer.bands.showLines){am=(this.renderer.smooth)?this.renderer._hiBandSmoothedData:this.renderer._hiBandGridData;this.renderer.shapeRenderer.draw(ax,am,aq);am=(this.renderer.smooth)?this.renderer._lowBandSmoothedData:this.renderer._lowBandGridData;this.renderer.shapeRenderer.draw(ax,am,aK)}if(this.renderer.bands.fill){if(this.renderer.smooth){am=this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse())}else{am=this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse())}this._areaPoints=am;aK.closePath=true;aK.fill=true;aK.fillStyle=this.renderer.bands.fillColor;this.renderer.shapeRenderer.draw(ax,am,aK)}}if(ak){this.renderer.shadowRenderer.draw(ax,aI,aq)}this.renderer.shapeRenderer.draw(ax,aI,aq)}}var ar=av=ay=aE=null;for(aC=0;aC<this._areaPoints.length;aC++){var at=this._areaPoints[aC];if(ar>at[0]||ar==null){ar=at[0]}if(aE<at[1]||aE==null){aE=at[1]}if(av<at[0]||av==null){av=at[0]}if(ay>at[1]||ay==null){ay=at[1]}}if(this.type==="line"&&this.renderer.bands.show){aE=this._yaxis.series_u2p(this.renderer.bands._min);ay=this._yaxis.series_u2p(this.renderer.bands._max)}this._boundingBox=[[ar,aE],[av,ay]];if(this.markerRenderer.show&&!aA){if(this.renderer.smooth){aI=this.gridData}for(aC=0;aC<aI.length;aC++){if(aI[aC][0]!=null&&aI[aC][1]!=null){this.markerRenderer.draw(aI[aC][0],aI[aC][1],ax,aq.markerOptions)}}}}ax.restore()};L.jqplot.LineRenderer.prototype.drawShadow=function(ah,aj,ai){};function z(ak,aj,ah){for(var ai=0;ai<this.series.length;ai++){if(this.series[ai].renderer.constructor==L.jqplot.LineRenderer){if(this.series[ai].highlightMouseOver){this.series[ai].highlightMouseDown=false}}}}function af(){if(this.plugins.lineRenderer&&this.plugins.lineRenderer.highlightCanvas){this.plugins.lineRenderer.highlightCanvas.resetCanvas();this.plugins.lineRenderer.highlightCanvas=null}this.plugins.lineRenderer.highlightedSeriesIndex=null;this.plugins.lineRenderer.highlightCanvas=new L.jqplot.GenericCanvas();this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-lineRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.lineRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(ah){aa(ah.data.plot)})}function ac(an,am,ak,aj){var ai=an.series[am];var ah=an.plugins.lineRenderer.highlightCanvas;ah._ctx.clearRect(0,0,ah._ctx.canvas.width,ah._ctx.canvas.height);ai._highlightedPoint=ak;an.plugins.lineRenderer.highlightedSeriesIndex=am;var al={fillStyle:ai.highlightColor};if(ai.type==="line"&&ai.renderer.bands.show){al.fill=true;al.closePath=true}ai.renderer.shapeRenderer.draw(ah._ctx,aj,al);ah=null}function aa(aj){var ah=aj.plugins.lineRenderer.highlightCanvas;ah._ctx.clearRect(0,0,ah._ctx.canvas.width,ah._ctx.canvas.height);for(var ai=0;ai<aj.series.length;ai++){aj.series[ai]._highlightedPoint=null}aj.plugins.lineRenderer.highlightedSeriesIndex=null;aj.target.trigger("jqplotDataUnhighlight");ah=null}function h(al,ak,ao,an,am){if(an){var aj=[an.seriesIndex,an.pointIndex,an.data];var ai=jQuery.Event("jqplotDataMouseOver");ai.pageX=al.pageX;ai.pageY=al.pageY;am.target.trigger(ai,aj);if(am.series[aj[0]].highlightMouseOver&&!(aj[0]==am.plugins.lineRenderer.highlightedSeriesIndex)){var ah=jQuery.Event("jqplotDataHighlight");ah.which=al.which;ah.pageX=al.pageX;ah.pageY=al.pageY;am.target.trigger(ah,aj);ac(am,an.seriesIndex,an.pointIndex,an.points)}}else{if(an==null){aa(am)}}}function e(ak,aj,an,am,al){if(am){var ai=[am.seriesIndex,am.pointIndex,am.data];if(al.series[ai[0]].highlightMouseDown&&!(ai[0]==al.plugins.lineRenderer.highlightedSeriesIndex)){var ah=jQuery.Event("jqplotDataHighlight");ah.which=ak.which;ah.pageX=ak.pageX;ah.pageY=ak.pageY;al.target.trigger(ah,ai);ac(al,am.seriesIndex,am.pointIndex,am.points)}}else{if(am==null){aa(al)}}}function ad(aj,ai,am,al,ak){var ah=ak.plugins.lineRenderer.highlightedSeriesIndex;if(ah!=null&&ak.series[ah].highlightMouseDown){aa(ak)}}function g(ak,aj,an,am,al){if(am){var ai=[am.seriesIndex,am.pointIndex,am.data];var ah=jQuery.Event("jqplotDataClick");ah.which=ak.which;ah.pageX=ak.pageX;ah.pageY=ak.pageY;al.target.trigger(ah,ai)}}function s(al,ak,ao,an,am){if(an){var aj=[an.seriesIndex,an.pointIndex,an.data];var ah=am.plugins.lineRenderer.highlightedSeriesIndex;if(ah!=null&&am.series[ah].highlightMouseDown){aa(am)}var ai=jQuery.Event("jqplotDataRightClick");ai.which=al.which;ai.pageX=al.pageX;ai.pageY=al.pageY;am.target.trigger(ai,aj)}}L.jqplot.LinearAxisRenderer=function(){};L.jqplot.LinearAxisRenderer.prototype.init=function(ah){this.breakPoints=null;this.breakTickLabel="&asymp;";this.drawBaseline=true;this.baselineWidth=null;this.baselineColor=null;this.forceTickAt0=false;this.forceTickAt100=false;this.tickInset=0;this.minorTicks=0;this.alignTicks=false;this._autoFormatString="";this._overrideFormatString=false;this._scalefact=1;L.extend(true,this,ah);if(this.breakPoints){if(!L.isArray(this.breakPoints)){this.breakPoints=null}else{if(this.breakPoints.length<2||this.breakPoints[1]<=this.breakPoints[0]){this.breakPoints=null}}}if(this.numberTicks!=null&&this.numberTicks<2){this.numberTicks=2}this.resetDataBounds()};L.jqplot.LinearAxisRenderer.prototype.draw=function(ah,ao){if(this.show){this.renderer.createTicks.call(this,ao);var an=0;var ai;if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=L(document.createElement("div"));this._elem.addClass("jqplot-axis jqplot-"+this.name);this._elem.css("position","absolute");if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var am=this._label.draw(ah,ao);am.appendTo(this._elem);am=null}var al=this._ticks;var ak;for(var aj=0;aj<al.length;aj++){ak=al[aj];if(ak.show&&ak.showLabel&&(!ak.isMinorTick||this.showMinorTicks)){this._elem.append(ak.draw(ah,ao))}}ak=null;al=null}return this._elem};L.jqplot.LinearAxisRenderer.prototype.reset=function(){this.min=this._options.min;this.max=this._options.max;this.tickInterval=this._options.tickInterval;this.numberTicks=this._options.numberTicks;this._autoFormatString="";if(this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString){this.tickOptions.formatString=""}};L.jqplot.LinearAxisRenderer.prototype.set=function(){var ao=0;var aj;var ai=0;var an=0;var ah=(this._label==null)?false:this._label.show;if(this.show){var am=this._ticks;var al;for(var ak=0;ak<am.length;ak++){al=am[ak];if(!al._breakTick&&al.show&&al.showLabel&&(!al.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){aj=al._elem.outerHeight(true)}else{aj=al._elem.outerWidth(true)}if(aj>ao){ao=aj}}}al=null;am=null;if(ah){ai=this._label._elem.outerWidth(true);an=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){ao=ao+an;this._elem.css({height:ao+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){ao=ao+ai;this._elem.css({width:ao+"px",left:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}else{ao=ao+ai;this._elem.css({width:ao+"px",right:"0px",top:"0px"});if(ah&&this._label.constructor==L.jqplot.AxisLabelRenderer){this._label._elem.css("width",ai+"px")}}}}}};L.jqplot.LinearAxisRenderer.prototype.createTicks=function(aj){var aT=this._ticks;var aK=this.ticks;var az=this.name;var aB=this._dataBounds;var ah=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var an;var a6,aI;var ap,ao;var a4,a0;var aH=this.min;var a5=this.max;var aW=this.numberTicks;var ba=this.tickInterval;var am=30;this._scalefact=(Math.max(ah,am+1)-am)/300;if(aK.length){for(a0=0;a0<aK.length;a0++){var aO=aK[a0];var aU=new this.tickRenderer(this.tickOptions);if(L.isArray(aO)){aU.value=aO[0];if(this.breakPoints){if(aO[0]==this.breakPoints[0]){aU.label=this.breakTickLabel;aU._breakTick=true;aU.showGridline=false;aU.showMark=false}else{if(aO[0]>this.breakPoints[0]&&aO[0]<=this.breakPoints[1]){aU.show=false;aU.showGridline=false;aU.label=aO[1]}else{aU.label=aO[1]}}}else{aU.label=aO[1]}aU.setTick(aO[0],this.name);this._ticks.push(aU)}else{if(L.isPlainObject(aO)){L.extend(true,aU,aO);aU.axis=this.name;this._ticks.push(aU)}else{aU.value=aO;if(this.breakPoints){if(aO==this.breakPoints[0]){aU.label=this.breakTickLabel;aU._breakTick=true;aU.showGridline=false;aU.showMark=false}else{if(aO>this.breakPoints[0]&&aO<=this.breakPoints[1]){aU.show=false;aU.showGridline=false}}}aU.setTick(aO,this.name);this._ticks.push(aU)}}}this.numberTicks=aK.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{if(az=="xaxis"||az=="x2axis"){ah=this._plotDimensions.width}else{ah=this._plotDimensions.height}var ax=this.numberTicks;if(this.alignTicks){if(this.name==="x2axis"&&aj.axes.xaxis.show){ax=aj.axes.xaxis.numberTicks}else{if(this.name.charAt(0)==="y"&&this.name!=="yaxis"&&this.name!=="yMidAxis"&&aj.axes.yaxis.show){ax=aj.axes.yaxis.numberTicks}}}a6=((this.min!=null)?this.min:aB.min);aI=((this.max!=null)?this.max:aB.max);var av=aI-a6;var aS,ay;var at;if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(this.min==null||this.max==null&&this.tickInterval==null&&!this.autoscale){if(this.forceTickAt0){if(a6>0){a6=0}if(aI<0){aI=0}}if(this.forceTickAt100){if(a6>100){a6=100}if(aI<100){aI=100}}var aE=false,a1=false;if(this.min!=null){aE=true}else{if(this.max!=null){a1=true}}var aP=L.jqplot.LinearTickGenerator(a6,aI,this._scalefact,ax,aE,a1);var aw=(this.min!=null)?a6:a6+av*(this.padMin-1);var aQ=(this.max!=null)?aI:aI-av*(this.padMax-1);if(a6<aw||aI>aQ){aw=(this.min!=null)?a6:a6-av*(this.padMin-1);aQ=(this.max!=null)?aI:aI+av*(this.padMax-1);aP=L.jqplot.LinearTickGenerator(aw,aQ,this._scalefact,ax,aE,a1)}this.min=aP[0];this.max=aP[1];this.numberTicks=aP[2];this._autoFormatString=aP[3];this.tickInterval=aP[4]}else{if(a6==aI){var ai=0.05;if(a6>0){ai=Math.max(Math.log(a6)/Math.LN10,0.05)}a6-=ai;aI+=ai}if(this.autoscale&&this.min==null&&this.max==null){var ak,al,ar;var aC=false;var aN=false;var aA={min:null,max:null,average:null,stddev:null};for(var a0=0;a0<this._series.length;a0++){var aV=this._series[a0];var aD=(aV.fillAxis=="x")?aV._xaxis.name:aV._yaxis.name;if(this.name==aD){var aR=aV._plotValues[aV.fillAxis];var aG=aR[0];var a2=aR[0];for(var aZ=1;aZ<aR.length;aZ++){if(aR[aZ]<aG){aG=aR[aZ]}else{if(aR[aZ]>a2){a2=aR[aZ]}}}var au=(a2-aG)/a2;if(aV.renderer.constructor==L.jqplot.BarRenderer){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{aC=false;if(aV.fill&&aV.fillToZero&&aG<0&&a2>0){aN=true}else{aN=false}}}else{if(aV.fill){if(aG>=0&&(aV.fillToZero||au>0.1)){aC=true}else{if(aG<0&&a2>0&&aV.fillToZero){aC=false;aN=true}else{aC=false;aN=false}}}else{if(aG<0){aC=false}}}}}if(aC){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);this.min=0;aH=0;al=aI/(this.numberTicks-1);at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));if(al/at==parseInt(al/at,10)){al+=at}this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*(this.numberTicks-1)}else{if(aN){this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing);var aJ=Math.ceil(Math.abs(a6)/av*(this.numberTicks-1));var a9=this.numberTicks-1-aJ;al=Math.max(Math.abs(a6/aJ),Math.abs(aI/a9));at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)));this.tickInterval=Math.ceil(al/at)*at;this.max=this.tickInterval*a9;this.min=-this.tickInterval*aJ}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(av/this.tickInterval)}else{this.numberTicks=2+Math.ceil((ah-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){al=av/(this.numberTicks-1);if(al<1){at=Math.pow(10,Math.abs(Math.floor(Math.log(al)/Math.LN10)))}else{at=1}this.tickInterval=Math.ceil(al*at*this.pad)/at}else{at=1/this.tickInterval}ak=this.tickInterval*(this.numberTicks-1);ar=(ak-av)/2;if(this.min==null){this.min=Math.floor(at*(a6-ar))/at}if(this.max==null){this.max=this.min+ak}}}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM}else{aS=(this.min!=null)?this.min:a6-av*(this.padMin-1);ay=(this.max!=null)?this.max:aI+av*(this.padMax-1);av=ay-aS;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((ay-aS)/this.tickInterval)+1}else{if(ah>100){this.numberTicks=parseInt(3+(ah-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=av/(this.numberTicks-1)}if(this.max==null){ay=aS+this.tickInterval*(this.numberTicks-1)}if(this.min==null){aS=ay-this.tickInterval*(this.numberTicks-1)}var aF=L.jqplot.getSignificantFigures(this.tickInterval);var aM;if(aF.digitsLeft>=aF.significantDigits){aM="%d"}else{var at=Math.max(0,5-aF.digitsLeft);at=Math.min(at,aF.digitsRight);aM="%."+at+"f"}this._autoFormatString=aM;this.min=aS;this.max=ay}if(this.renderer.constructor==L.jqplot.LinearAxisRenderer&&this._autoFormatString==""){av=this.max-this.min;var a7=new this.tickRenderer(this.tickOptions);var aL=a7.formatString||L.jqplot.config.defaultTickFormatString;var aL=aL.match(L.jqplot.sprintf.regex)[0];var a3=0;if(aL){if(aL.search(/[fFeEgGpP]/)>-1){var aY=aL.match(/\%\.(\d{0,})?[eEfFgGpP]/);if(aY){a3=parseInt(aY[1],10)}else{a3=6}}else{if(aL.search(/[di]/)>-1){a3=0}}var aq=Math.pow(10,-a3);if(this.tickInterval<aq){if(aW==null&&ba==null){this.tickInterval=aq;if(a5==null&&aH==null){this.min=Math.floor(this._dataBounds.min/aq)*aq;if(this.min==this._dataBounds.min){this.min=this._dataBounds.min-this.tickInterval}this.max=Math.ceil(this._dataBounds.max/aq)*aq;if(this.max==this._dataBounds.max){this.max=this._dataBounds.max+this.tickInterval}var aX=(this.max-this.min)/this.tickInterval;aX=aX.toFixed(11);aX=Math.ceil(aX);this.numberTicks=aX+1}else{if(a5==null){var aX=(this._dataBounds.max-this.min)/this.tickInterval;aX=aX.toFixed(11);this.numberTicks=Math.ceil(aX)+2;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(aH==null){var aX=(this.max-this._dataBounds.min)/this.tickInterval;aX=aX.toFixed(11);this.numberTicks=Math.ceil(aX)+2;this.min=this.max-this.tickInterval*(this.numberTicks-1)}else{this.numberTicks=Math.ceil((a5-aH)/this.tickInterval)+1;this.min=Math.floor(aH*Math.pow(10,a3))/Math.pow(10,a3);this.max=Math.ceil(a5*Math.pow(10,a3))/Math.pow(10,a3);this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1}}}}}}}}if(this._overrideFormatString&&this._autoFormatString!=""){this.tickOptions=this.tickOptions||{};this.tickOptions.formatString=this._autoFormatString}var aU,a8;for(var a0=0;a0<this.numberTicks;a0++){a4=this.min+a0*this.tickInterval;aU=new this.tickRenderer(this.tickOptions);aU.setTick(a4,this.name);this._ticks.push(aU);if(a0<this.numberTicks-1){for(var aZ=0;aZ<this.minorTicks;aZ++){a4+=this.tickInterval/(this.minorTicks+1);a8=L.extend(true,{},this.tickOptions,{name:this.name,value:a4,label:"",isMinorTick:true});aU=new this.tickRenderer(a8);this._ticks.push(aU)}}aU=null}}if(this.tickInset){this.min=this.min-this.tickInset*this.tickInterval;this.max=this.max+this.tickInset*this.tickInterval}aT=null};L.jqplot.LinearAxisRenderer.prototype.resetTickValues=function(aj){if(L.isArray(aj)&&aj.length==this._ticks.length){var ai;for(var ah=0;ah<aj.length;ah++){ai=this._ticks[ah];ai.value=aj[ah];ai.label=ai.formatter(ai.formatString,aj[ah]);ai.label=ai.prefix+ai.label;ai._elem.html(ai.label)}ai=null;this.min=L.jqplot.arrayMin(aj);this.max=L.jqplot.arrayMax(aj);this.pack()}};L.jqplot.LinearAxisRenderer.prototype.pack=function(aj,ai){aj=aj||{};ai=ai||this._offsets;var ay=this._ticks;var au=this.max;var at=this.min;var ao=ai.max;var am=ai.min;var aq=(this._label==null)?false:this._label.show;for(var ar in aj){this._elem.css(ar,aj[ar])}this._offsets=ai;var ak=ao-am;var al=au-at;if(this.breakPoints){al=al-this.breakPoints[1]+this.breakPoints[0];this.p2u=function(aA){return(aA-am)*al/ak+at};this.u2p=function(aA){if(aA>this.breakPoints[0]&&aA<this.breakPoints[1]){aA=this.breakPoints[0]}if(aA<=this.breakPoints[0]){return(aA-at)*ak/al+am}else{return(aA-this.breakPoints[1]+this.breakPoints[0]-at)*ak/al+am}};if(this.name.charAt(0)=="x"){this.series_u2p=function(aA){if(aA>this.breakPoints[0]&&aA<this.breakPoints[1]){aA=this.breakPoints[0]}if(aA<=this.breakPoints[0]){return(aA-at)*ak/al}else{return(aA-this.breakPoints[1]+this.breakPoints[0]-at)*ak/al}};this.series_p2u=function(aA){return aA*al/ak+at}}else{this.series_u2p=function(aA){if(aA>this.breakPoints[0]&&aA<this.breakPoints[1]){aA=this.breakPoints[0]}if(aA>=this.breakPoints[1]){return(aA-au)*ak/al}else{return(aA+this.breakPoints[1]-this.breakPoints[0]-au)*ak/al}};this.series_p2u=function(aA){return aA*al/ak+au}}}else{this.p2u=function(aA){return(aA-am)*al/ak+at};this.u2p=function(aA){return(aA-at)*ak/al+am};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(aA){return(aA-at)*ak/al};this.series_p2u=function(aA){return aA*al/ak+at}}else{this.series_u2p=function(aA){return(aA-au)*ak/al};this.series_p2u=function(aA){return aA*al/ak+au}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var av=0;av<ay.length;av++){var ap=ay[av];if(ap.show&&ap.showLabel){var ah;if(ap.constructor==L.jqplot.CanvasAxisTickRenderer&&ap.angle){var ax=(this.name=="xaxis")?1:-1;switch(ap.labelPosition){case"auto":if(ax*ap.angle<0){ah=-ap.getWidth()+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2}else{ah=-ap._textRenderer.height*Math.sin(ap._textRenderer.angle)/2}break;case"end":ah=-ap.getWidth()+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2;break;case"start":ah=-ap._textRenderer.height*Math.sin(ap._textRenderer.angle)/2;break;case"middle":ah=-ap.getWidth()/2+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2;break;default:ah=-ap.getWidth()/2+ap._textRenderer.height*Math.sin(-ap._textRenderer.angle)/2;break}}else{ah=-ap.getWidth()/2}var az=this.u2p(ap.value)+ah+"px";ap._elem.css("left",az);ap.pack()}}if(aq){var an=this._label._elem.outerWidth(true);this._label._elem.css("left",am+ak/2-an/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(var av=0;av<ay.length;av++){var ap=ay[av];if(ap.show&&ap.showLabel){var ah;if(ap.constructor==L.jqplot.CanvasAxisTickRenderer&&ap.angle){var ax=(this.name=="yaxis")?1:-1;switch(ap.labelPosition){case"auto":case"end":if(ax*ap.angle<0){ah=-ap._textRenderer.height*Math.cos(-ap._textRenderer.angle)/2}else{ah=-ap.getHeight()+ap._textRenderer.height*Math.cos(ap._textRenderer.angle)/2}break;case"start":if(ap.angle>0){ah=-ap._textRenderer.height*Math.cos(-ap._textRenderer.angle)/2}else{ah=-ap.getHeight()+ap._textRenderer.height*Math.cos(ap._textRenderer.angle)/2}break;case"middle":ah=-ap.getHeight()/2;break;default:ah=-ap.getHeight()/2;break}}else{ah=-ap.getHeight()/2}var az=this.u2p(ap.value)+ah+"px";ap._elem.css("top",az);ap.pack()}}if(aq){var aw=this._label._elem.outerHeight(true);this._label._elem.css("top",ao-ak/2-aw/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}ay=null};function i(ai){var ah;ai=Math.abs(ai);if(ai>=10){ah="%d"}else{if(ai>1){if(ai===parseInt(ai,10)){ah="%d"}else{ah="%.1f"}}else{var aj=-Math.floor(Math.log(ai)/Math.LN10);ah="%."+aj+"f"}}return ah}var b=[0.1,0.2,0.3,0.4,0.5,0.8,1,2,3,4,5];var c=function(ai){var ah=b.indexOf(ai);if(ah>0){return b[ah-1]}else{return b[b.length-1]/100}};var k=function(ai){var ah=b.indexOf(ai);if(ah<b.length-1){return b[ah+1]}else{return b[0]*100}};function d(al,au,at){var aq=Math.floor(at/2);var ai=Math.ceil(at*1.5);var ak=Number.MAX_VALUE;var ah=(au-al);var ax;var ap;var ar;var ay=L.jqplot.getSignificantFigures;var aw;var an;var ao;var av;for(var am=0,aj=ai-aq+1;am<aj;am++){ao=aq+am;ax=ah/(ao-1);ap=ay(ax);ax=Math.abs(at-ao)+ap.digitsRight;if(ax<ak){ak=ax;ar=ao;av=ap.digitsRight}else{if(ax===ak){if(ap.digitsRight<av){ar=ao;av=ap.digitsRight}}}}aw=Math.max(av,Math.max(ay(al).digitsRight,ay(au).digitsRight));if(aw===0){an="%d"}else{an="%."+aw+"f"}ax=ah/(ar-1);return[al,au,ar,an,ax]}function W(ai,al){al=al||7;var ak=ai/(al-1);var aj=Math.pow(10,Math.floor(Math.log(ak)/Math.LN10));var am=ak/aj;var ah;if(aj<1){if(am>5){ah=10*aj}else{if(am>2){ah=5*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}else{if(am>5){ah=10*aj}else{if(am>4){ah=5*aj}else{if(am>3){ah=4*aj}else{if(am>2){ah=3*aj}else{if(am>1){ah=2*aj}else{ah=aj}}}}}}return ah}function Q(ai,ah){ah=ah||1;var ak=Math.floor(Math.log(ai)/Math.LN10);var am=Math.pow(10,ak);var al=ai/am;var aj;al=al/ah;if(al<=0.38){aj=0.1}else{if(al<=1.6){aj=0.2}else{if(al<=4){aj=0.5}else{if(al<=8){aj=1}else{if(al<=16){aj=2}else{aj=5}}}}}return aj*am}function x(aj,ai){var al=Math.floor(Math.log(aj)/Math.LN10);var an=Math.pow(10,al);var am=aj/an;var ah;var ak;am=am/ai;if(am<=0.38){ak=0.1}else{if(am<=1.6){ak=0.2}else{if(am<=4){ak=0.5}else{if(am<=8){ak=1}else{if(am<=16){ak=2}else{ak=5}}}}}ah=ak*an;return[ah,ak,an]}L.jqplot.LinearTickGenerator=function(an,aq,aj,ak,ao,ar){ao=(ao===null)?false:ao;ar=(ar===null||ao)?false:ar;if(an===aq){aq=(aq)?0:1}aj=aj||1;if(aq<an){var at=aq;aq=an;an=at}var ai=[];var aw=Q(aq-an,aj);var av=L.jqplot.getSignificantFigures;if(ak==null){if(!ao&&!ar){ai[0]=Math.floor(an/aw)*aw;ai[1]=Math.ceil(aq/aw)*aw;ai[2]=Math.round((ai[1]-ai[0])/aw+1);ai[3]=i(aw);ai[4]=aw}else{if(ao){ai[0]=an;ai[2]=Math.ceil((aq-an)/aw+1);ai[1]=an+(ai[2]-1)*aw;var au=av(an).digitsRight;var ap=av(aw).digitsRight;if(au<ap){ai[3]=i(aw)}else{ai[3]="%."+au+"f"}ai[4]=aw}else{if(ar){ai[1]=aq;ai[2]=Math.ceil((aq-an)/aw+1);ai[0]=aq-(ai[2]-1)*aw;var al=av(aq).digitsRight;var ap=av(aw).digitsRight;if(al<ap){ai[3]=i(aw)}else{ai[3]="%."+al+"f"}ai[4]=aw}}}}else{var am=[];am[0]=Math.floor(an/aw)*aw;am[1]=Math.ceil(aq/aw)*aw;am[2]=Math.round((am[1]-am[0])/aw+1);am[3]=i(aw);am[4]=aw;if(am[2]===ak){ai=am}else{var ah=W(am[1]-am[0],ak);ai[0]=am[0];ai[2]=ak;ai[4]=ah;ai[3]=i(ah);ai[1]=ai[0]+(ai[2]-1)*ai[4]}}return ai};L.jqplot.LinearTickGenerator.bestLinearInterval=Q;L.jqplot.LinearTickGenerator.bestInterval=W;L.jqplot.LinearTickGenerator.bestLinearComponents=x;L.jqplot.LinearTickGenerator.bestConstrainedInterval=d;L.jqplot.MarkerRenderer=function(ah){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new L.jqplot.ShadowRenderer();this.shapeRenderer=new L.jqplot.ShapeRenderer();L.extend(true,this,ah)};L.jqplot.MarkerRenderer.prototype.init=function(ah){L.extend(true,this,ah);var aj={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){aj.fill=true}if(this.style.indexOf("ircle")!=-1){aj.isarc=true;aj.closePath=false}this.shadowRenderer.init(aj);var ai={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){ai.fill=true}if(this.style.indexOf("ircle")!=-1){ai.isarc=true;ai.closePath=false}this.shapeRenderer.init(ai)};L.jqplot.MarkerRenderer.prototype.drawDiamond=function(aj,ai,am,al,ao){var ah=1.2;var ap=this.size/2/ah;var an=this.size/2*ah;var ak=[[aj-ap,ai],[aj,ai+an],[aj+ap,ai],[aj,ai-an]];if(this.shadow){this.shadowRenderer.draw(am,ak)}this.shapeRenderer.draw(am,ak,ao)};L.jqplot.MarkerRenderer.prototype.drawPlus=function(ak,aj,an,am,aq){var ai=1;var ar=this.size/2*ai;var ao=this.size/2*ai;var ap=[[ak,aj-ao],[ak,aj+ao]];var al=[[ak+ar,aj],[ak-ar,aj]];var ah=L.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(an,ap,{closePath:false});this.shadowRenderer.draw(an,al,{closePath:false})}this.shapeRenderer.draw(an,ap,ah);this.shapeRenderer.draw(an,al,ah)};L.jqplot.MarkerRenderer.prototype.drawX=function(ak,aj,an,am,aq){var ai=1;var ar=this.size/2*ai;var ao=this.size/2*ai;var ah=L.extend(true,{},this.options,{closePath:false});var ap=[[ak-ar,aj-ao],[ak+ar,aj+ao]];var al=[[ak-ar,aj+ao],[ak+ar,aj-ao]];if(this.shadow){this.shadowRenderer.draw(an,ap,{closePath:false});this.shadowRenderer.draw(an,al,{closePath:false})}this.shapeRenderer.draw(an,ap,ah);this.shapeRenderer.draw(an,al,ah)};L.jqplot.MarkerRenderer.prototype.drawDash=function(aj,ai,am,al,ao){var ah=1;var ap=this.size/2*ah;var an=this.size/2*ah;var ak=[[aj-ap,ai],[aj+ap,ai]];if(this.shadow){this.shadowRenderer.draw(am,ak)}this.shapeRenderer.draw(am,ak,ao)};L.jqplot.MarkerRenderer.prototype.drawLine=function(am,al,ah,ak,ai){var aj=[am,al];if(this.shadow){this.shadowRenderer.draw(ah,aj)}this.shapeRenderer.draw(ah,aj,ai)};L.jqplot.MarkerRenderer.prototype.drawSquare=function(aj,ai,am,al,ao){var ah=1;var ap=this.size/2/ah;var an=this.size/2*ah;var ak=[[aj-ap,ai-an],[aj-ap,ai+an],[aj+ap,ai+an],[aj+ap,ai-an]];if(this.shadow){this.shadowRenderer.draw(am,ak)}this.shapeRenderer.draw(am,ak,ao)};L.jqplot.MarkerRenderer.prototype.drawCircle=function(ai,ao,ak,an,al){var ah=this.size/2;var aj=2*Math.PI;var am=[ai,ao,ah,0,aj,true];if(this.shadow){this.shadowRenderer.draw(ak,am)}this.shapeRenderer.draw(ak,am,al)};L.jqplot.MarkerRenderer.prototype.draw=function(ah,ak,ai,aj){aj=aj||{};if(aj.show==null||aj.show!=false){if(aj.color&&!aj.fillStyle){aj.fillStyle=aj.color}if(aj.color&&!aj.strokeStyle){aj.strokeStyle=aj.color}switch(this.style){case"diamond":this.drawDiamond(ah,ak,ai,false,aj);break;case"filledDiamond":this.drawDiamond(ah,ak,ai,true,aj);break;case"circle":this.drawCircle(ah,ak,ai,false,aj);break;case"filledCircle":this.drawCircle(ah,ak,ai,true,aj);break;case"square":this.drawSquare(ah,ak,ai,false,aj);break;case"filledSquare":this.drawSquare(ah,ak,ai,true,aj);break;case"x":this.drawX(ah,ak,ai,true,aj);break;case"plus":this.drawPlus(ah,ak,ai,true,aj);break;case"dash":this.drawDash(ah,ak,ai,true,aj);break;case"line":this.drawLine(ah,ak,ai,false,aj);break;default:this.drawDiamond(ah,ak,ai,false,aj);break}}};L.jqplot.ShadowRenderer=function(ah){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.strokeStyle="rgba(0,0,0,0.1)";this.isarc=false;L.extend(true,this,ah)};L.jqplot.ShadowRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.ShadowRenderer.prototype.draw=function(av,at,ax){av.save();var ah=(ax!=null)?ax:{};var au=(ah.fill!=null)?ah.fill:this.fill;var ap=(ah.fillRect!=null)?ah.fillRect:this.fillRect;var ao=(ah.closePath!=null)?ah.closePath:this.closePath;var al=(ah.offset!=null)?ah.offset:this.offset;var aj=(ah.alpha!=null)?ah.alpha:this.alpha;var an=(ah.depth!=null)?ah.depth:this.depth;var aw=(ah.isarc!=null)?ah.isarc:this.isarc;var aq=(ah.linePattern!=null)?ah.linePattern:this.linePattern;av.lineWidth=(ah.lineWidth!=null)?ah.lineWidth:this.lineWidth;av.lineJoin=(ah.lineJoin!=null)?ah.lineJoin:this.lineJoin;av.lineCap=(ah.lineCap!=null)?ah.lineCap:this.lineCap;av.strokeStyle=ah.strokeStyle||this.strokeStyle||"rgba(0,0,0,"+aj+")";av.fillStyle=ah.fillStyle||this.fillStyle||"rgba(0,0,0,"+aj+")";for(var ak=0;ak<an;ak++){var ar=L.jqplot.LinePattern(av,aq);av.translate(Math.cos(this.angle*Math.PI/180)*al,Math.sin(this.angle*Math.PI/180)*al);ar.beginPath();if(aw){av.arc(at[0],at[1],at[2],at[3],at[4],true)}else{if(ap){if(ap){av.fillRect(at[0],at[1],at[2],at[3])}}else{if(at&&at.length){var ai=true;for(var am=0;am<at.length;am++){if(at[am][0]!=null&&at[am][1]!=null){if(ai){ar.moveTo(at[am][0],at[am][1]);ai=false}else{ar.lineTo(at[am][0],at[am][1])}}else{ai=true}}}}}if(ao){ar.closePath()}if(au){av.fill()}else{av.stroke()}}av.restore()};L.jqplot.ShapeRenderer=function(ah){this.lineWidth=1.5;this.linePattern="solid";this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.isarc=false;this.fillRect=false;this.strokeRect=false;this.clearRect=false;this.strokeStyle="#999999";this.fillStyle="#999999";L.extend(true,this,ah)};L.jqplot.ShapeRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.ShapeRenderer.prototype.draw=function(at,aq,av){at.save();var ah=(av!=null)?av:{};var ar=(ah.fill!=null)?ah.fill:this.fill;var am=(ah.closePath!=null)?ah.closePath:this.closePath;var an=(ah.fillRect!=null)?ah.fillRect:this.fillRect;var ak=(ah.strokeRect!=null)?ah.strokeRect:this.strokeRect;var ai=(ah.clearRect!=null)?ah.clearRect:this.clearRect;var au=(ah.isarc!=null)?ah.isarc:this.isarc;var ao=(ah.linePattern!=null)?ah.linePattern:this.linePattern;var ap=L.jqplot.LinePattern(at,ao);at.lineWidth=ah.lineWidth||this.lineWidth;at.lineJoin=ah.lineJoin||this.lineJoin;at.lineCap=ah.lineCap||this.lineCap;at.strokeStyle=(ah.strokeStyle||ah.color)||this.strokeStyle;at.fillStyle=ah.fillStyle||this.fillStyle;at.beginPath();if(au){at.arc(aq[0],aq[1],aq[2],aq[3],aq[4],true);if(am){at.closePath()}if(ar){at.fill()}else{at.stroke()}at.restore();return}else{if(ai){at.clearRect(aq[0],aq[1],aq[2],aq[3]);at.restore();return}else{if(an||ak){if(an){at.fillRect(aq[0],aq[1],aq[2],aq[3])}if(ak){at.strokeRect(aq[0],aq[1],aq[2],aq[3]);at.restore();return}}else{if(aq&&aq.length){var aj=true;for(var al=0;al<aq.length;al++){if(aq[al][0]!=null&&aq[al][1]!=null){if(aj){ap.moveTo(aq[al][0],aq[al][1]);aj=false}else{ap.lineTo(aq[al][0],aq[al][1])}}else{aj=true}}if(am){ap.closePath()}if(ar){at.fill()}else{at.stroke()}}}}}at.restore()};L.jqplot.TableLegendRenderer=function(){};L.jqplot.TableLegendRenderer.prototype.init=function(ah){L.extend(true,this,ah)};L.jqplot.TableLegendRenderer.prototype.addrow=function(aq,ak,ah,ao){var al=(ah)?this.rowSpacing+"px":"0px";var ap;var aj;var ai;var an;var am;ai=document.createElement("tr");ap=L(ai);ap.addClass("jqplot-table-legend");ai=null;if(ao){ap.prependTo(this._elem)}else{ap.appendTo(this._elem)}if(this.showSwatches){aj=L(document.createElement("td"));aj.addClass("jqplot-table-legend jqplot-table-legend-swatch");aj.css({textAlign:"center",paddingTop:al});an=L(document.createElement("div"));an.addClass("jqplot-table-legend-swatch-outline");am=L(document.createElement("div"));am.addClass("jqplot-table-legend-swatch");am.css({backgroundColor:ak,borderColor:ak});ap.append(aj.append(an.append(am)))}if(this.showLabels){aj=L(document.createElement("td"));aj.addClass("jqplot-table-legend jqplot-table-legend-label");aj.css("paddingTop",al);ap.append(aj);if(this.escapeHtml){aj.text(aq)}else{aj.html(aq)}}aj=null;an=null;am=null;ap=null;ai=null};L.jqplot.TableLegendRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}if(this.show){var am=this._series;var ai=document.createElement("table");this._elem=L(ai);this._elem.addClass("jqplot-table-legend");var ar={position:"absolute"};if(this.background){ar.background=this.background}if(this.border){ar.border=this.border}if(this.fontSize){ar.fontSize=this.fontSize}if(this.fontFamily){ar.fontFamily=this.fontFamily}if(this.textColor){ar.textColor=this.textColor}if(this.marginTop!=null){ar.marginTop=this.marginTop}if(this.marginBottom!=null){ar.marginBottom=this.marginBottom}if(this.marginLeft!=null){ar.marginLeft=this.marginLeft}if(this.marginRight!=null){ar.marginRight=this.marginRight}var ah=false,ao=false,aq;for(var an=0;an<am.length;an++){aq=am[an];if(aq._stack||aq.renderer.constructor==L.jqplot.BezierCurveRenderer){ao=true}if(aq.show&&aq.showLabel){var al=this.labels[an]||aq.label.toString();if(al){var aj=aq.color;if(ao&&an<am.length-1){ah=true}else{if(ao&&an==am.length-1){ah=false}}this.renderer.addrow.call(this,al,aj,ah,ao);ah=true}for(var ak=0;ak<L.jqplot.addLegendRowHooks.length;ak++){var ap=L.jqplot.addLegendRowHooks[ak].call(this,aq);if(ap){this.renderer.addrow.call(this,ap.label,ap.color,ah);ah=true}}al=null}}}return this._elem};L.jqplot.TableLegendRenderer.prototype.pack=function(aj){if(this.show){if(this.placement=="insideGrid"){switch(this.location){case"nw":var ai=aj.left;var ah=aj.top;this._elem.css("left",ai);this._elem.css("top",ah);break;case"n":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=aj.top;this._elem.css("left",ai);this._elem.css("top",ah);break;case"ne":var ai=aj.right;var ah=aj.top;this._elem.css({right:ai,top:ah});break;case"e":var ai=aj.right;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({right:ai,top:ah});break;case"se":var ai=aj.right;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break;case"s":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=aj.bottom;this._elem.css({left:ai,bottom:ah});break;case"sw":var ai=aj.left;var ah=aj.bottom;this._elem.css({left:ai,bottom:ah});break;case"w":var ai=aj.left;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({left:ai,top:ah});break;default:var ai=aj.right;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break}}else{if(this.placement=="outside"){switch(this.location){case"nw":var ai=this._plotDimensions.width-aj.left;var ah=aj.top;this._elem.css("right",ai);this._elem.css("top",ah);break;case"n":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=this._plotDimensions.height-aj.top;this._elem.css("left",ai);this._elem.css("bottom",ah);break;case"ne":var ai=this._plotDimensions.width-aj.right;var ah=aj.top;this._elem.css({left:ai,top:ah});break;case"e":var ai=this._plotDimensions.width-aj.right;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({left:ai,top:ah});break;case"se":var ai=this._plotDimensions.width-aj.right;var ah=aj.bottom;this._elem.css({left:ai,bottom:ah});break;case"s":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;var ah=this._plotDimensions.height-aj.bottom;this._elem.css({left:ai,top:ah});break;case"sw":var ai=this._plotDimensions.width-aj.left;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break;case"w":var ai=this._plotDimensions.width-aj.left;var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({right:ai,top:ah});break;default:var ai=aj.right;var ah=aj.bottom;this._elem.css({right:ai,bottom:ah});break}}else{switch(this.location){case"nw":this._elem.css({left:0,top:aj.top});break;case"n":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;this._elem.css({left:ai,top:aj.top});break;case"ne":this._elem.css({right:0,top:aj.top});break;case"e":var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({right:aj.right,top:ah});break;case"se":this._elem.css({right:aj.right,bottom:aj.bottom});break;case"s":var ai=(aj.left+(this._plotDimensions.width-aj.right))/2-this.getWidth()/2;this._elem.css({left:ai,bottom:aj.bottom});break;case"sw":this._elem.css({left:aj.left,bottom:aj.bottom});break;case"w":var ah=(aj.top+(this._plotDimensions.height-aj.bottom))/2-this.getHeight()/2;this._elem.css({left:aj.left,top:ah});break;default:this._elem.css({right:aj.right,bottom:aj.bottom});break}}}}};L.jqplot.ThemeEngine=function(){this.themes={};this.activeTheme=null};L.jqplot.ThemeEngine.prototype.init=function(){var ak=new L.jqplot.Theme({_name:"Default"});var an,ai,am;for(an in ak.target){if(an=="textColor"){ak.target[an]=this.target.css("color")}else{ak.target[an]=this.target.css(an)}}if(this.title.show&&this.title._elem){for(an in ak.title){if(an=="textColor"){ak.title[an]=this.title._elem.css("color")}else{ak.title[an]=this.title._elem.css(an)}}}for(an in ak.grid){ak.grid[an]=this.grid[an]}if(ak.grid.backgroundColor==null&&this.grid.background!=null){ak.grid.backgroundColor=this.grid.background}if(this.legend.show&&this.legend._elem){for(an in ak.legend){if(an=="textColor"){ak.legend[an]=this.legend._elem.css("color")}else{ak.legend[an]=this.legend._elem.css(an)}}}var aj;for(ai=0;ai<this.series.length;ai++){aj=this.series[ai];if(aj.renderer.constructor==L.jqplot.LineRenderer){ak.series.push(new p())}else{if(aj.renderer.constructor==L.jqplot.BarRenderer){ak.series.push(new T())}else{if(aj.renderer.constructor==L.jqplot.PieRenderer){ak.series.push(new f())}else{if(aj.renderer.constructor==L.jqplot.DonutRenderer){ak.series.push(new G())}else{if(aj.renderer.constructor==L.jqplot.FunnelRenderer){ak.series.push(new Z())}else{if(aj.renderer.constructor==L.jqplot.MeterGaugeRenderer){ak.series.push(new D())}else{ak.series.push({})}}}}}}for(an in ak.series[ai]){ak.series[ai][an]=aj[an]}}var ah,al;for(an in this.axes){al=this.axes[an];ah=ak.axes[an]=new P();ah.borderColor=al.borderColor;ah.borderWidth=al.borderWidth;if(al._ticks&&al._ticks[0]){for(am in ah.ticks){if(al._ticks[0].hasOwnProperty(am)){ah.ticks[am]=al._ticks[0][am]}else{if(al._ticks[0]._elem){ah.ticks[am]=al._ticks[0]._elem.css(am)}}}}if(al._label&&al._label.show){for(am in ah.label){if(al._label[am]){ah.label[am]=al._label[am]}else{if(al._label._elem){if(am=="textColor"){ah.label[am]=al._label._elem.css("color")}else{ah.label[am]=al._label._elem.css(am)}}}}}}this.themeEngine._add(ak);this.themeEngine.activeTheme=this.themeEngine.themes[ak._name]};L.jqplot.ThemeEngine.prototype.get=function(ah){if(!ah){return this.activeTheme}else{return this.themes[ah]}};function O(ai,ah){return ai-ah}L.jqplot.ThemeEngine.prototype.getThemeNames=function(){var ah=[];for(var ai in this.themes){ah.push(ai)}return ah.sort(O)};L.jqplot.ThemeEngine.prototype.getThemes=function(){var ai=[];var ah=[];for(var ak in this.themes){ai.push(ak)}ai.sort(O);for(var aj=0;aj<ai.length;aj++){ah.push(this.themes[ai[aj]])}return ah};L.jqplot.ThemeEngine.prototype.activate=function(av,aB){var ah=false;if(!aB&&this.activeTheme&&this.activeTheme._name){aB=this.activeTheme._name}if(!this.themes.hasOwnProperty(aB)){throw new Error("No theme of that name")}else{var am=this.themes[aB];this.activeTheme=am;var aA,at=false,ar=false;var ai=["xaxis","x2axis","yaxis","y2axis"];for(aw=0;aw<ai.length;aw++){var an=ai[aw];if(am.axesStyles.borderColor!=null){av.axes[an].borderColor=am.axesStyles.borderColor}if(am.axesStyles.borderWidth!=null){av.axes[an].borderWidth=am.axesStyles.borderWidth}}for(var az in av.axes){var ak=av.axes[az];if(ak.show){var aq=am.axes[az]||{};var ao=am.axesStyles;var al=L.jqplot.extend(true,{},aq,ao);aA=(am.axesStyles.borderColor!=null)?am.axesStyles.borderColor:al.borderColor;if(al.borderColor!=null){ak.borderColor=al.borderColor;ah=true}aA=(am.axesStyles.borderWidth!=null)?am.axesStyles.borderWidth:al.borderWidth;if(al.borderWidth!=null){ak.borderWidth=al.borderWidth;ah=true}if(ak._ticks&&ak._ticks[0]){for(var aj in al.ticks){aA=al.ticks[aj];if(aA!=null){ak.tickOptions[aj]=aA;ak._ticks=[];ah=true}}}if(ak._label&&ak._label.show){for(var aj in al.label){aA=al.label[aj];if(aA!=null){ak.labelOptions[aj]=aA;ah=true}}}}}for(var au in am.grid){if(am.grid[au]!=null){av.grid[au]=am.grid[au]}}if(!ah){av.grid.draw()}if(av.legend.show){for(au in am.legend){if(am.legend[au]!=null){av.legend[au]=am.legend[au]}}}if(av.title.show){for(au in am.title){if(am.title[au]!=null){av.title[au]=am.title[au]}}}var aw;for(aw=0;aw<am.series.length;aw++){var ap={};var ay=false;for(au in am.series[aw]){aA=(am.seriesStyles[au]!=null)?am.seriesStyles[au]:am.series[aw][au];if(aA!=null){ap[au]=aA;if(au=="color"){av.series[aw].renderer.shapeRenderer.fillStyle=aA;av.series[aw].renderer.shapeRenderer.strokeStyle=aA;av.series[aw][au]=aA}else{if((au=="lineWidth")||(au=="linePattern")){av.series[aw].renderer.shapeRenderer[au]=aA;av.series[aw][au]=aA}else{if(au=="markerOptions"){V(av.series[aw].markerOptions,aA);V(av.series[aw].markerRenderer,aA)}else{av.series[aw][au]=aA}}}ah=true}}}if(ah){av.target.empty();av.draw()}for(au in am.target){if(am.target[au]!=null){av.target.css(au,am.target[au])}}}};L.jqplot.ThemeEngine.prototype._add=function(ai,ah){if(ah){ai._name=ah}if(!ai._name){ai._name=Date.parse(new Date())}if(!this.themes.hasOwnProperty(ai._name)){this.themes[ai._name]=ai}else{throw new Error("jqplot.ThemeEngine Error: Theme already in use")}};L.jqplot.ThemeEngine.prototype.remove=function(ah){if(ah=="Default"){return false}return delete this.themes[ah]};L.jqplot.ThemeEngine.prototype.newTheme=function(ah,aj){if(typeof(ah)=="object"){aj=aj||ah;ah=null}if(aj&&aj._name){ah=aj._name}else{ah=ah||Date.parse(new Date())}var ai=this.copy(this.themes.Default._name,ah);L.jqplot.extend(ai,aj);return ai};function B(aj){if(aj==null||typeof(aj)!="object"){return aj}var ah=new aj.constructor();for(var ai in aj){ah[ai]=B(aj[ai])}return ah}L.jqplot.clone=B;function V(aj,ai){if(ai==null||typeof(ai)!="object"){return}for(var ah in ai){if(ah=="highlightColors"){aj[ah]=B(ai[ah])}if(ai[ah]!=null&&typeof(ai[ah])=="object"){if(!aj.hasOwnProperty(ah)){aj[ah]={}}V(aj[ah],ai[ah])}else{aj[ah]=ai[ah]}}}L.jqplot.merge=V;L.jqplot.extend=function(){var am=arguments[0]||{},ak=1,al=arguments.length,ah=false,aj;if(typeof am==="boolean"){ah=am;am=arguments[1]||{};ak=2}if(typeof am!=="object"&&!toString.call(am)==="[object Function]"){am={}}for(;ak<al;ak++){if((aj=arguments[ak])!=null){for(var ai in aj){var an=am[ai],ao=aj[ai];if(am===ao){continue}if(ah&&ao&&typeof ao==="object"&&!ao.nodeType){am[ai]=L.jqplot.extend(ah,an||(ao.length!=null?[]:{}),ao)}else{if(ao!==u){am[ai]=ao}}}}}return am};L.jqplot.ThemeEngine.prototype.rename=function(ai,ah){if(ai=="Default"||ah=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot rename from/to Default")}if(this.themes.hasOwnProperty(ah)){throw new Error("jqplot.ThemeEngine Error: New name already in use.")}else{if(this.themes.hasOwnProperty(ai)){var aj=this.copy(ai,ah);this.remove(ai);return aj}}throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid")};L.jqplot.ThemeEngine.prototype.copy=function(ah,aj,al){if(aj=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot copy over Default theme")}if(!this.themes.hasOwnProperty(ah)){var ai="jqplot.ThemeEngine Error: Source name invalid";throw new Error(ai)}if(this.themes.hasOwnProperty(aj)){var ai="jqplot.ThemeEngine Error: Target name invalid";throw new Error(ai)}else{var ak=B(this.themes[ah]);ak._name=aj;L.jqplot.extend(true,ak,al);this._add(ak);return ak}};L.jqplot.Theme=function(ah,ai){if(typeof(ah)=="object"){ai=ai||ah;ah=null}ah=ah||Date.parse(new Date());this._name=ah;this.target={backgroundColor:null};this.legend={textColor:null,fontFamily:null,fontSize:null,border:null,background:null};this.title={textColor:null,fontFamily:null,fontSize:null,textAlign:null};this.seriesStyles={};this.series=[];this.grid={drawGridlines:null,gridLineColor:null,gridLineWidth:null,backgroundColor:null,borderColor:null,borderWidth:null,shadow:null};this.axesStyles={label:{},ticks:{}};this.axes={};if(typeof(ai)=="string"){this._name=ai}else{if(typeof(ai)=="object"){L.jqplot.extend(true,this,ai)}}};var P=function(){this.borderColor=null;this.borderWidth=null;this.ticks=new o();this.label=new t()};var o=function(){this.show=null;this.showGridline=null;this.showLabel=null;this.showMark=null;this.size=null;this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null};var t=function(){this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null;this.fontWeight=null};var p=function(){this.color=null;this.lineWidth=null;this.linePattern=null;this.shadow=null;this.fillColor=null;this.showMarker=null;this.markerOptions=new I()};var I=function(){this.show=null;this.style=null;this.lineWidth=null;this.size=null;this.color=null;this.shadow=null};var T=function(){this.color=null;this.seriesColors=null;this.lineWidth=null;this.shadow=null;this.barPadding=null;this.barMargin=null;this.barWidth=null;this.highlightColors=null};var f=function(){this.seriesColors=null;this.padding=null;this.sliceMargin=null;this.fill=null;this.shadow=null;this.startAngle=null;this.lineWidth=null;this.highlightColors=null};var G=function(){this.seriesColors=null;this.padding=null;this.sliceMargin=null;this.fill=null;this.shadow=null;this.startAngle=null;this.lineWidth=null;this.innerDiameter=null;this.thickness=null;this.ringMargin=null;this.highlightColors=null};var Z=function(){this.color=null;this.lineWidth=null;this.shadow=null;this.padding=null;this.sectionMargin=null;this.seriesColors=null;this.highlightColors=null};var D=function(){this.padding=null;this.backgroundColor=null;this.ringColor=null;this.tickColor=null;this.ringWidth=null;this.intervalColors=null;this.intervalInnerRadius=null;this.intervalOuterRadius=null;this.hubRadius=null;this.needleThickness=null;this.needlePad=null};L.fn.jqplotChildText=function(){return L(this).contents().filter(function(){return this.nodeType==3}).text()};L.fn.jqplotGetComputedFontStyle=function(){var ak=window.getComputedStyle?window.getComputedStyle(this[0],""):this[0].currentStyle;var ai=ak["font-style"]?["font-style","font-weight","font-size","font-family"]:["fontStyle","fontWeight","fontSize","fontFamily"];var al=[];for(var aj=0;aj<ai.length;++aj){var ah=String(ak[ai[aj]]);if(ah&&ah!="normal"){al.push(ah)}}return al.join(" ")};L.fn.jqplotToImageCanvas=function(aj){aj=aj||{};var av=(aj.x_offset==null)?0:aj.x_offset;var ax=(aj.y_offset==null)?0:aj.y_offset;var al=(aj.backgroundColor==null)?"rgb(255,255,255)":aj.backgroundColor;if(L(this).width()==0||L(this).height()==0){return null}if(L.jqplot.use_excanvas){return null}var an=document.createElement("canvas");var aA=L(this).outerHeight(true);var at=L(this).outerWidth(true);var am=L(this).offset();var ao=am.left;var aq=am.top;var au=0,ar=0;var ay=["jqplot-table-legend","jqplot-xaxis-tick","jqplot-x2axis-tick","jqplot-yaxis-tick","jqplot-y2axis-tick","jqplot-y3axis-tick","jqplot-y4axis-tick","jqplot-y5axis-tick","jqplot-y6axis-tick","jqplot-y7axis-tick","jqplot-y8axis-tick","jqplot-y9axis-tick","jqplot-xaxis-label","jqplot-x2axis-label","jqplot-yaxis-label","jqplot-y2axis-label","jqplot-y3axis-label","jqplot-y4axis-label","jqplot-y5axis-label","jqplot-y6axis-label","jqplot-y7axis-label","jqplot-y8axis-label","jqplot-y9axis-label"];var ap,ah,ai,aB;for(var az=0;az<ay.length;az++){L(this).find("."+ay[az]).each(function(){ap=L(this).offset().top-aq;ah=L(this).offset().left-ao;aB=ah+L(this).outerWidth(true)+au;ai=ap+L(this).outerHeight(true)+ar;if(ah<-au){at=at-au-ah;au=-ah}if(ap<-ar){aA=aA-ar-ap;ar=-ap}if(aB>at){at=aB}if(ai>aA){aA=ai}})}an.width=at+Number(av);an.height=aA+Number(ax);var ak=an.getContext("2d");ak.save();ak.fillStyle=al;ak.fillRect(0,0,an.width,an.height);ak.restore();ak.translate(au,ar);ak.textAlign="left";ak.textBaseline="top";function aC(aE){var aF=parseInt(L(aE).css("line-height"),10);if(isNaN(aF)){aF=parseInt(L(aE).css("font-size"),10)*1.2}return aF}function aD(aF,aE,aS,aG,aO,aH){var aQ=aC(aF);var aK=L(aF).innerWidth();var aL=L(aF).innerHeight();var aN=aS.split(/\s+/);var aR=aN.length;var aP="";var aM=[];var aU=aO;var aT=aG;for(var aJ=0;aJ<aR;aJ++){aP+=aN[aJ];if(aE.measureText(aP).width>aK){aM.push(aJ);aP="";aJ--}}if(aM.length===0){if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aS,aT,aO)}else{aP=aN.slice(0,aM[0]).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU);aU+=aQ;for(var aJ=1,aI=aM.length;aJ<aI;aJ++){aP=aN.slice(aM[aJ-1],aM[aJ]).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU);aU+=aQ}aP=aN.slice(aM[aJ-1],aN.length).join(" ");if(L(aF).css("textAlign")==="center"){aT=aG+(aH-aE.measureText(aP).width)/2-au}aE.fillText(aP,aT,aU)}}function aw(aG,aJ,aE){var aN=aG.tagName.toLowerCase();var aF=L(aG).position();var aK=window.getComputedStyle?window.getComputedStyle(aG,""):aG.currentStyle;var aI=aJ+aF.left+parseInt(aK.marginLeft,10)+parseInt(aK.borderLeftWidth,10)+parseInt(aK.paddingLeft,10);var aL=aE+aF.top+parseInt(aK.marginTop,10)+parseInt(aK.borderTopWidth,10)+parseInt(aK.paddingTop,10);var aM=an.width;if((aN=="div"||aN=="span")&&!L(aG).hasClass("jqplot-highlighter-tooltip")){L(aG).children().each(function(){aw(this,aI,aL)});var aO=L(aG).jqplotChildText();if(aO){ak.font=L(aG).jqplotGetComputedFontStyle();ak.fillStyle=L(aG).css("color");aD(aG,ak,aO,aI,aL,aM)}}else{if(aN==="table"&&L(aG).hasClass("jqplot-table-legend")){ak.strokeStyle=L(aG).css("border-top-color");ak.fillStyle=L(aG).css("background-color");ak.fillRect(aI,aL,L(aG).innerWidth(),L(aG).innerHeight());if(parseInt(L(aG).css("border-top-width"),10)>0){ak.strokeRect(aI,aL,L(aG).innerWidth(),L(aG).innerHeight())}L(aG).find("div.jqplot-table-legend-swatch-outline").each(function(){var aU=L(this);ak.strokeStyle=aU.css("border-top-color");var aQ=aI+aU.position().left;var aR=aL+aU.position().top;ak.strokeRect(aQ,aR,aU.innerWidth(),aU.innerHeight());aQ+=parseInt(aU.css("padding-left"),10);aR+=parseInt(aU.css("padding-top"),10);var aT=aU.innerHeight()-2*parseInt(aU.css("padding-top"),10);var aP=aU.innerWidth()-2*parseInt(aU.css("padding-left"),10);var aS=aU.children("div.jqplot-table-legend-swatch");ak.fillStyle=aS.css("background-color");ak.fillRect(aQ,aR,aP,aT)});L(aG).find("td.jqplot-table-legend-label").each(function(){var aR=L(this);var aP=aI+aR.position().left;var aQ=aL+aR.position().top+parseInt(aR.css("padding-top"),10);ak.font=aR.jqplotGetComputedFontStyle();ak.fillStyle=aR.css("color");aD(aR,ak,aR.text(),aP,aQ,aM)});var aH=null}else{if(aN=="canvas"){ak.drawImage(aG,aI,aL)}}}}L(this).children().each(function(){aw(this,av,ax)});return an};L.fn.jqplotToImageStr=function(ai){var ah=L(this).jqplotToImageCanvas(ai);if(ah){return ah.toDataURL("image/png")}else{return null}};L.fn.jqplotToImageElem=function(ah){var ai=document.createElement("img");var aj=L(this).jqplotToImageStr(ah);ai.src=aj;return ai};L.fn.jqplotToImageElemStr=function(ah){var ai="<img src="+L(this).jqplotToImageStr(ah)+" />";return ai};L.fn.jqplotSaveImage=function(){var ah=L(this).jqplotToImageStr({});if(ah){window.location.href=ah.replace("image/png","image/octet-stream")}};L.fn.jqplotViewImage=function(){var ai=L(this).jqplotToImageElemStr({});var aj=L(this).jqplotToImageStr({});if(ai){var ah=window.open("");ah.document.open("image/png");ah.document.write(ai);ah.document.close();ah=null}};var ag=function(){this.syntax=ag.config.syntax;this._type="jsDate";this.proxy=new Date();this.options={};this.locale=ag.regional.getLocale();this.formatString="";this.defaultCentury=ag.config.defaultCentury;switch(arguments.length){case 0:break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai<arguments.length;ai++){ah.push(arguments[ai])}this.proxy=new Date();this.proxy.setFullYear.apply(this.proxy,ah.slice(0,3));if(ah.slice(3).length){this.proxy.setHours.apply(this.proxy,ah.slice(3))}break}};ag.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900};ag.prototype.add=function(aj,ai){var ah=E[ai]||E.day;if(typeof ah=="number"){this.proxy.setTime(this.proxy.getTime()+(ah*aj))}else{ah.add(this,aj)}return this};ag.prototype.clone=function(){return new ag(this.proxy.getTime())};ag.prototype.getUtcOffset=function(){return this.proxy.getTimezoneOffset()*60000};ag.prototype.diff=function(ai,al,ah){ai=new ag(ai);if(ai===null){return null}var aj=E[al]||E.day;if(typeof aj=="number"){var ak=(this.proxy.getTime()-ai.proxy.getTime())/aj}else{var ak=aj.diff(this.proxy,ai.proxy)}return(ah?ak:Math[ak>0?"floor":"ceil"](ak))};ag.prototype.getAbbrDayName=function(){return ag.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]};ag.prototype.getAbbrMonthName=function(){return ag.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]};ag.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"};ag.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"};ag.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)};ag.prototype.getDate=function(){return this.proxy.getDate()};ag.prototype.getDay=function(){return this.proxy.getDay()};ag.prototype.getDayOfWeek=function(){var ah=this.proxy.getDay();return ah===0?7:ah};ag.prototype.getDayOfYear=function(){var ai=this.proxy;var ah=ai-new Date(""+ai.getFullYear()+"/1/1 GMT");ah+=ai.getTimezoneOffset()*60000;ai=null;return parseInt(ah/60000/60/24,10)+1};ag.prototype.getDayName=function(){return ag.regional[this.locale]["dayNames"][this.proxy.getDay()]};ag.prototype.getFullWeekOfYear=function(){var ak=this.proxy;var ah=this.getDayOfYear();var aj=6-ak.getDay();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getFullYear=function(){return this.proxy.getFullYear()};ag.prototype.getGmtOffset=function(){var ah=this.proxy.getTimezoneOffset()/60;var ai=ah<0?"+":"-";ah=Math.abs(ah);return ai+N(Math.floor(ah),2)+":"+N((ah%1)*60,2)};ag.prototype.getHours=function(){return this.proxy.getHours()};ag.prototype.getHours12=function(){var ah=this.proxy.getHours();return ah>12?ah-12:(ah==0?12:ah)};ag.prototype.getIsoWeek=function(){var ak=this.proxy;var aj=this.getWeekOfYear();var ah=(new Date(""+ak.getFullYear()+"/1/1")).getDay();var ai=aj+(ah>4||ah<=1?0:1);if(ai==53&&(new Date(""+ak.getFullYear()+"/12/31")).getDay()<4){ai=1}else{if(ai===0){ak=new ag(new Date(""+(ak.getFullYear()-1)+"/12/31"));ai=ak.getIsoWeek()}}ak=null;return ai};ag.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()};ag.prototype.getMinutes=function(){return this.proxy.getMinutes()};ag.prototype.getMonth=function(){return this.proxy.getMonth()};ag.prototype.getMonthName=function(){return ag.regional[this.locale]["monthNames"][this.proxy.getMonth()]};ag.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1};ag.prototype.getSeconds=function(){return this.proxy.getSeconds()};ag.prototype.getShortYear=function(){return this.proxy.getYear()%100};ag.prototype.getTime=function(){return this.proxy.getTime()};ag.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")};ag.prototype.getTimezoneName=function(){var ah=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return ah[1]||ah[2]||"GMT"+this.getGmtOffset()};ag.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()};ag.prototype.getWeekOfYear=function(){var ah=this.getDayOfYear();var aj=7-this.getDayOfWeek();var ai=parseInt((ah+aj)/7,10);return ai};ag.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1000,0)};ag.prototype.getYear=function(){return this.proxy.getYear()};ag.prototype.next=function(ah){ah=ah||"day";return this.clone().add(1,ah)};ag.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date();break;case 1:if(l(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var aj=this.options=arguments[0];this.syntax=aj.syntax||this.syntax;this.defaultCentury=aj.defaultCentury||this.defaultCentury;this.proxy=ag.createDate(aj.date)}else{this.proxy=ag.createDate(arguments[0])}break;default:var ah=[];for(var ai=0;ai<arguments.length;ai++){ah.push(arguments[ai])}this.proxy=new Date();this.proxy.setFullYear.apply(this.proxy,ah.slice(0,3));if(ah.slice(3).length){this.proxy.setHours.apply(this.proxy,ah.slice(3))}break}return this};ag.prototype.setDate=function(ah){this.proxy.setDate(ah);return this};ag.prototype.setFullYear=function(){this.proxy.setFullYear.apply(this.proxy,arguments);return this};ag.prototype.setHours=function(){this.proxy.setHours.apply(this.proxy,arguments);return this};ag.prototype.setMilliseconds=function(ah){this.proxy.setMilliseconds(ah);return this};ag.prototype.setMinutes=function(){this.proxy.setMinutes.apply(this.proxy,arguments);return this};ag.prototype.setMonth=function(){this.proxy.setMonth.apply(this.proxy,arguments);return this};ag.prototype.setSeconds=function(){this.proxy.setSeconds.apply(this.proxy,arguments);return this};ag.prototype.setTime=function(ah){this.proxy.setTime(ah);return this};ag.prototype.setYear=function(){this.proxy.setYear.apply(this.proxy,arguments);return this};ag.prototype.strftime=function(ah){ah=ah||this.formatString||ag.regional[this.locale]["formatString"];return ag.strftime(this,ah,this.syntax)};ag.prototype.toString=function(){return this.proxy.toString()};ag.prototype.toYmdInt=function(){return(this.proxy.getFullYear()*10000)+(this.getMonthNumber()*100)+this.proxy.getDate()};ag.regional={en:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],formatString:"%Y-%m-%d %H:%M:%S"},fr:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthNamesShort:["Jan","Fév","Mar","Avr","Mai","Jun","Jul","Aoû","Sep","Oct","Nov","Déc"],dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],formatString:"%Y-%m-%d %H:%M:%S"},de:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],formatString:"%Y-%m-%d %H:%M:%S"},es:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado"],dayNamesShort:["Dom","Lun","Mar","Mi&eacute;","Juv","Vie","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},ru:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],formatString:"%Y-%m-%d %H:%M:%S"},ar:{monthNames:["كانون الثاني","شباط","آذار","نيسان","آذار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["السبت","الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة"],dayNamesShort:["سبت","أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة"],formatString:"%Y-%m-%d %H:%M:%S"},pt:{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},"pt-BR":{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},pl:{monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthNamesShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],dayNames:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Ni","Pn","Wt","Śr","Cz","Pt","Sb"],formatString:"%Y-%m-%d %H:%M:%S"},nl:{monthNames:["Januari","Februari","Maart","April","Mei","Juni","July","Augustus","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:","["Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag"],dayNamesShort:["Zo","Ma","Di","Wo","Do","Vr","Za"],formatString:"%Y-%m-%d %H:%M:%S"},sv:{monthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthNamesShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],dayNamesShort:["sön","mån","tis","ons","tor","fre","lör"],formatString:"%Y-%m-%d %H:%M:%S"}};ag.regional["en-US"]=ag.regional["en-GB"]=ag.regional.en;ag.regional.getLocale=function(){var ah=ag.config.defaultLocale;if(document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){ah=document.getElementsByTagName("html")[0].lang;if(!ag.regional.hasOwnProperty(ah)){ah=ag.config.defaultLocale}}return ah};var C=24*60*60*1000;var N=function(ah,ak){ah=String(ah);var ai=ak-ah.length;var aj=String(Math.pow(10,ai)).slice(1);return aj.concat(ah)};var E={millisecond:1,second:1000,minute:60*1000,hour:60*60*1000,day:C,week:7*C,month:{add:function(aj,ah){E.year.add(aj,Math[ah>0?"floor":"ceil"](ah/12));var ai=aj.getMonth()+(ah%12);if(ai==12){ai=0;aj.setYear(aj.getFullYear()+1)}else{if(ai==-1){ai=11;aj.setYear(aj.getFullYear()-1)}}aj.setMonth(ai)},diff:function(al,aj){var ah=al.getFullYear()-aj.getFullYear();var ai=al.getMonth()-aj.getMonth()+(ah*12);var ak=al.getDate()-aj.getDate();return ai+(ak/30)}},year:{add:function(ai,ah){ai.setYear(ai.getFullYear()+Math[ah>0?"floor":"ceil"](ah))},diff:function(ai,ah){return E.month.diff(ai,ah)/12}}};for(var Y in E){if(Y.substring(Y.length-1)!="s"){E[Y+"s"]=E[Y]}}var H=function(al,ak,ai){if(ag.formats[ai]["shortcuts"][ak]){return ag.strftime(al,ag.formats[ai]["shortcuts"][ak],ai)}else{var ah=(ag.formats[ai]["codes"][ak]||"").split(".");var aj=al["get"+ah[0]]?al["get"+ah[0]]():"";if(ah[1]){aj=N(aj,ah[1])}return aj}};ag.strftime=function(an,ak,aj,ao){var ai="perl";var am=ag.regional.getLocale();if(aj&&ag.formats.hasOwnProperty(aj)){ai=aj}else{if(aj&&ag.regional.hasOwnProperty(aj)){am=aj}}if(ao&&ag.formats.hasOwnProperty(ao)){ai=ao}else{if(ao&&ag.regional.hasOwnProperty(ao)){am=ao}}if(l(an)!="[object Object]"||an._type!="jsDate"){an=new ag(an);an.locale=am}if(!ak){ak=an.formatString||ag.regional[am]["formatString"]}var ah=ak||"%Y-%m-%d",ap="",al;while(ah.length>0){if(al=ah.match(ag.formats[ai].codes.matcher)){ap+=ah.slice(0,al.index);ap+=(al[1]||"")+H(an,al[2],ai);ah=ah.slice(al.index+al[0].length)}else{ap+=ah;ah=""}}return ap};ag.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"};ag.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};ag.createDate=function(aj){if(aj==null){return new Date()}if(aj instanceof Date){return aj}if(typeof aj=="number"){return new Date(aj)}var ao=String(aj).replace(/^\s*(.+)\s*$/g,"$1");ao=ao.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var an=ao.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(an&&an.length>3){var at=parseFloat(an[3]);var am=ag.config.defaultCentury+at;am=String(am);ao=ao.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,an[1]+" "+an[2]+" "+am)}an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);function ar(ax,aw){var aC=parseFloat(aw[1]);var aB=parseFloat(aw[2]);var aA=parseFloat(aw[3]);var az=ag.config.defaultCentury;var av,au,aD,ay;if(aC>31){au=aA;aD=aB;av=az+aC}else{au=aB;aD=aC;av=az+aA}ay=aD+"/"+au+"/"+av;return ax.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,ay)}if(an&&an.length>3){ao=ar(ao,an)}var an=ao.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);if(an&&an.length>3){ao=ar(ao,an)}var al=0;var ai=ag.matchers.length;var aq,ah,ap=ao,ak;while(al<ai){ah=Date.parse(ap);if(!isNaN(ah)){return new Date(ah)}aq=ag.matchers[al];if(typeof aq=="function"){ak=aq.call(ag,ap);if(ak instanceof Date){return ak}}else{ap=ao.replace(aq[0],aq[1])}al++}return NaN};ag.daysInMonth=function(ah,ai){if(ai==2){return new Date(ah,1,29).getDate()==29?29:28}return[u,31,u,31,30,31,30,31,31,30,31,30,31][ai]};ag.matchers=[[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,"$2/$1/$3"],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,"$2/$3/$1"],function(ak){var ai=ak.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(ai){if(ai[1]){var aj=this.createDate(ai[1]);if(isNaN(aj)){return}}else{var aj=new Date();aj.setMilliseconds(0)}var ah=parseFloat(ai[2]);if(ai[6]){ah=ai[6].toLowerCase()=="am"?(ah==12?0:ah):(ah==12?12:ah+12)}aj.setHours(ah,parseInt(ai[3]||0,10),parseInt(ai[4]||0,10),((parseFloat(ai[5]||0))||0)*1000);return aj}else{return ak}},function(ak){var ai=ak.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(ai){if(ai[1]){var aj=this.createDate(ai[1]);if(isNaN(aj)){return}}else{var aj=new Date();aj.setMilliseconds(0)}var ah=parseFloat(ai[2]);aj.setHours(ah,parseInt(ai[3],10),parseInt(ai[4],10),parseFloat(ai[5])*1000);return aj}else{return ak}},function(al){var aj=al.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(aj){var ak=new Date();var am=ag.config.defaultCentury;var ao=parseFloat(aj[1]);var an=parseFloat(aj[3]);var ai,ah,ap;if(ao>31){ah=an;ai=am+ao}else{ah=ao;ai=am+an}var ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNamesShort"]);if(ap==-1){ap=ab(aj[2],ag.regional[ag.regional.getLocale()]["monthNames"])}ak.setFullYear(ai,ap,ah);ak.setHours(0,0,0,0);return ak}else{return al}}];function ab(aj,ak){if(ak.indexOf){return ak.indexOf(aj)}for(var ah=0,ai=ak.length;ah<ai;ah++){if(ak[ah]===aj){return ah}}return -1}function l(ah){if(ah===null){return"[object Null]"}return Object.prototype.toString.call(ah)}L.jsDate=ag;L.jqplot.sprintf=function(){function an(au,ap,aq,at){var ar=(au.length>=ap)?"":Array(1+ap-au.length>>>0).join(aq);return at?au+ar:ar+au}function ak(ar){var aq=new String(ar);for(var ap=10;ap>0;ap--){if(aq==(aq=aq.replace(/^(\d+)(\d{3})/,"$1"+L.jqplot.sprintf.thousandsSeparator+"$2"))){break}}return aq}function aj(av,au,ax,ar,at,aq){var aw=ar-av.length;if(aw>0){var ap=" ";if(aq){ap="&nbsp;"}if(ax||!at){av=an(av,ar,ap,ax)}else{av=av.slice(0,au.length)+an("",aw,"0",true)+av.slice(au.length)}}return av}function ao(ay,aq,aw,ar,ap,av,ax,au){var at=ay>>>0;aw=aw&&at&&{"2":"0b","8":"0","16":"0x"}[aq]||"";ay=aw+an(at.toString(aq),av||0,"0",false);return aj(ay,aw,ar,ap,ax,au)}function ah(au,av,ar,ap,at,aq){if(ap!=null){au=au.slice(0,ap)}return aj(au,"",av,ar,at,aq)}var ai=arguments,al=0,am=ai[al++];return am.replace(L.jqplot.sprintf.regex,function(aM,ax,ay,aB,aO,aJ,av){if(aM=="%%"){return"%"}var aD=false,az="",aA=false,aL=false,aw=false,au=false;for(var aI=0;ay&&aI<ay.length;aI++){switch(ay.charAt(aI)){case" ":az=" ";break;case"+":az="+";break;case"-":aD=true;break;case"0":aA=true;break;case"#":aL=true;break;case"&":aw=true;break;case"'":au=true;break}}if(!aB){aB=0}else{if(aB=="*"){aB=+ai[al++]}else{if(aB.charAt(0)=="*"){aB=+ai[aB.slice(1,-1)]}else{aB=+aB}}}if(aB<0){aB=-aB;aD=true}if(!isFinite(aB)){throw new Error("$.jqplot.sprintf: (minimum-)width must be finite")}if(!aJ){aJ="fFeE".indexOf(av)>-1?6:(av=="d")?0:void (0)}else{if(aJ=="*"){aJ=+ai[al++]}else{if(aJ.charAt(0)=="*"){aJ=+ai[aJ.slice(1,-1)]}else{aJ=+aJ}}}var aF=ax?ai[ax.slice(0,-1)]:ai[al++];switch(av){case"s":if(aF==null){return""}return ah(String(aF),aD,aB,aJ,aA,aw);case"c":return ah(String.fromCharCode(+aF),aD,aB,aJ,aA,aw);case"b":return ao(aF,2,aL,aD,aB,aJ,aA,aw);case"o":return ao(aF,8,aL,aD,aB,aJ,aA,aw);case"x":return ao(aF,16,aL,aD,aB,aJ,aA,aw);case"X":return ao(aF,16,aL,aD,aB,aJ,aA,aw).toUpperCase();case"u":return ao(aF,10,aL,aD,aB,aJ,aA,aw);case"i":var ar=parseInt(+aF,10);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"d":var ar=Math.round(+aF);if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aK=au?ak(String(Math.abs(ar))):String(Math.abs(ar));aF=aH+an(aK,aJ,"0",false);return aj(aF,aH,aD,aB,aA,aw);case"e":case"E":case"f":case"F":case"g":case"G":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var at=["toExponential","toFixed","toPrecision"]["efg".indexOf(av.toLowerCase())];var aN=["toString","toUpperCase"]["eEfFgG".indexOf(av)%2];var aK=Math.abs(ar)[at](aJ);var aE=aK.toString().split(".");aE[0]=au?ak(aE[0]):aE[0];aK=aE.join(L.jqplot.sprintf.decimalMark);aF=aH+aK;var aC=aj(aF,aH,aD,aB,aA,aw)[aN]();return aC;case"p":case"P":var ar=+aF;if(isNaN(ar)){return""}var aH=ar<0?"-":az;var aE=String(Number(Math.abs(ar)).toExponential()).split(/e|E/);var aq=(aE[0].indexOf(".")!=-1)?aE[0].length-1:String(ar).length;var aG=(aE[1]<0)?-aE[1]-1:0;if(Math.abs(ar)<1){if(aq+aG<=aJ){aF=aH+Math.abs(ar).toPrecision(aq)}else{if(aq<=aJ-1){aF=aH+Math.abs(ar).toExponential(aq-1)}else{aF=aH+Math.abs(ar).toExponential(aJ-1)}}}else{var ap=(aq<=aJ)?aq:aJ;aF=aH+Math.abs(ar).toPrecision(ap)}var aN=["toString","toUpperCase"]["pP".indexOf(av)%2];return aj(aF,aH,aD,aB,aA,aw)[aN]();case"n":return"";default:return aM}})};L.jqplot.sprintf.thousandsSeparator=",";L.jqplot.sprintf.decimalMark=".";L.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;L.jqplot.getSignificantFigures=function(al){var an=String(Number(Math.abs(al)).toExponential()).split(/e|E/);var am=(an[0].indexOf(".")!=-1)?an[0].length-1:an[0].length;var ai=(an[1]<0)?-an[1]-1:0;var ah=parseInt(an[1],10);var aj=(ah+1>0)?ah+1:0;var ak=(am<=aj)?0:am-ah-1;return{significantDigits:am,digitsLeft:aj,digitsRight:ak,zeros:ai,exponent:ah}};L.jqplot.getPrecision=function(ah){return L.jqplot.getSignificantFigures(ah).digitsRight};var X=L.uiBackCompat!==false;L.jqplot.effects={effect:{}};var m="jqplot.storage.";L.extend(L.jqplot.effects,{version:"1.9pre",save:function(ai,aj){for(var ah=0;ah<aj.length;ah++){if(aj[ah]!==null){ai.data(m+aj[ah],ai[0].style[aj[ah]])}}},restore:function(ai,aj){for(var ah=0;ah<aj.length;ah++){if(aj[ah]!==null){ai.css(aj[ah],ai.data(m+aj[ah]))}}},setMode:function(ah,ai){if(ai==="toggle"){ai=ah.is(":hidden")?"show":"hide"}return ai},createWrapper:function(ai){if(ai.parent().is(".ui-effects-wrapper")){return ai.parent()}var aj={width:ai.outerWidth(true),height:ai.outerHeight(true),"float":ai.css("float")},al=L("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),ah={width:ai.width(),height:ai.height()},ak=document.activeElement;ai.wrap(al);if(ai[0]===ak||L.contains(ai[0],ak)){L(ak).focus()}al=ai.parent();if(ai.css("position")==="static"){al.css({position:"relative"});ai.css({position:"relative"})}else{L.extend(aj,{position:ai.css("position"),zIndex:ai.css("z-index")});L.each(["top","left","bottom","right"],function(am,an){aj[an]=ai.css(an);if(isNaN(parseInt(aj[an],10))){aj[an]="auto"}});ai.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}ai.css(ah);return al.css(aj).show()},removeWrapper:function(ah){var ai=document.activeElement;if(ah.parent().is(".ui-effects-wrapper")){ah.parent().replaceWith(ah);if(ah[0]===ai||L.contains(ah[0],ai)){L(ai).focus()}}return ah}});function j(ai,ah,aj,ak){if(L.isPlainObject(ai)){return ai}ai={effect:ai};if(ah===u){ah={}}if(L.isFunction(ah)){ak=ah;aj=null;ah={}}if(L.type(ah)==="number"||L.fx.speeds[ah]){ak=aj;aj=ah;ah={}}if(L.isFunction(aj)){ak=aj;aj=null}if(ah){L.extend(ai,ah)}aj=aj||ah.duration;ai.duration=L.fx.off?0:typeof aj==="number"?aj:aj in L.fx.speeds?L.fx.speeds[aj]:L.fx.speeds._default;ai.complete=ak||ah.complete;return ai}function ae(ah){if(!ah||typeof ah==="number"||L.fx.speeds[ah]){return true}if(typeof ah==="string"&&!L.jqplot.effects.effect[ah]){if(X&&L.jqplot.effects[ah]){return false}return true}return false}L.fn.extend({jqplotEffect:function(ap,aq,ai,ao){var an=j.apply(this,arguments),ak=an.mode,al=an.queue,am=L.jqplot.effects.effect[an.effect],ah=!am&&X&&L.jqplot.effects[an.effect];if(L.fx.off||!(am||ah)){if(ak){return this[ak](an.duration,an.complete)}else{return this.each(function(){if(an.complete){an.complete.call(this)}})}}function aj(au){var av=L(this),at=an.complete,aw=an.mode;function ar(){if(L.isFunction(at)){at.call(av[0])}if(L.isFunction(au)){au()}}if(av.is(":hidden")?aw==="hide":aw==="show"){ar()}else{am.call(av[0],an,ar)}}if(am){return al===false?this.each(aj):this.queue(al||"fx",aj)}else{return ah.call(this,{options:an,duration:an.duration,callback:an.complete,mode:an.mode})}}});var a=/up|down|vertical/,v=/up|left|vertical|horizontal/;L.jqplot.effects.effect.blind=function(aj,ao){var ak=L(this),ar=["position","top","bottom","left","right","height","width"],ap=L.jqplot.effects.setMode(ak,aj.mode||"hide"),au=aj.direction||"up",am=a.test(au),al=am?"height":"width",aq=am?"top":"left",aw=v.test(au),an={},av=ap==="show",ai,ah,at;if(ak.parent().is(".ui-effects-wrapper")){L.jqplot.effects.save(ak.parent(),ar)}else{L.jqplot.effects.save(ak,ar)}ak.show();at=parseInt(ak.css("top"),10);ai=L.jqplot.effects.createWrapper(ak).css({overflow:"hidden"});ah=am?ai[al]()+at:ai[al]();an[al]=av?String(ah):"0";if(!aw){ak.css(am?"bottom":"right",0).css(am?"top":"left","").css({position:"absolute"});an[aq]=av?"0":String(ah)}if(av){ai.css(al,0);if(!aw){ai.css(aq,ah)}}ai.animate(an,{duration:aj.duration,easing:aj.easing,queue:false,complete:function(){if(ap==="hide"){ak.hide()}L.jqplot.effects.restore(ak,ar);L.jqplot.effects.removeWrapper(ak);ao()}})}})(jQuery);
js/jqplot/plugins/jqplot.pieRenderer.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2
- jsDate | (c) 2010-2013 Chris Leonello
3
  */(function(e){e.jqplot.PieRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.PieRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.PieRenderer.prototype.constructor=e.jqplot.PieRenderer;e.jqplot.PieRenderer.prototype.init=function(q,u){this.diameter=null;this.padding=20;this.sliceMargin=0;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.dataLabelPositionFactor=0.52;this.dataLabelNudge=2;this.dataLabelCenterOn=true;this.startAngle=0;this.tickRenderer=e.jqplot.PieTickRenderer;this._drawData=true;this._type="pie";if(q.highlightMouseDown&&q.highlightMouseOver==null){q.highlightMouseOver=false}e.extend(true,this,q);if(this.sliceMargin<0){this.sliceMargin=0}this._diameter=null;this._radius=null;this._sliceAngles=[];this._highlightedPoint=null;if(this.highlightColors.length==0){for(var s=0;s<this.seriesColors.length;s++){var r=e.jqplot.getColorComponents(this.seriesColors[s]);var o=[r[0],r[1],r[2]];var t=o[0]+o[1]+o[2];for(var p=0;p<3;p++){o[p]=(t>570)?o[p]*0.8:o[p]+0.3*(255-o[p]);o[p]=parseInt(o[p],10)}this.highlightColors.push("rgb("+o[0]+","+o[1]+","+o[2]+")")}}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors);u.postParseOptionsHooks.addOnce(m);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",b);u.eventListenerHooks.addOnce("jqplotMouseDown",a);u.eventListenerHooks.addOnce("jqplotMouseUp",l);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",n);u.postDrawHooks.addOnce(i)};e.jqplot.PieRenderer.prototype.setGridData=function(t){var p=[];var u=[];var o=this.startAngle/180*Math.PI;var s=0;this._drawData=false;for(var r=0;r<this.data.length;r++){if(this.data[r][1]!=0){this._drawData=true}p.push(this.data[r][1]);u.push([this.data[r][0]]);if(r>0){p[r]+=p[r-1]}s+=this.data[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r<p.length;r++){u[r][1]=p[r]*q;u[r][2]=this.data[r][1]/s}this.gridData=u};e.jqplot.PieRenderer.prototype.makeGridData=function(t,u){var p=[];var v=[];var s=0;var o=this.startAngle/180*Math.PI;this._drawData=false;for(var r=0;r<t.length;r++){if(this.data[r][1]!=0){this._drawData=true}p.push(t[r][1]);v.push([t[r][0]]);if(r>0){p[r]+=p[r-1]}s+=t[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r<p.length;r++){v[r][1]=p[r]*q;v[r][2]=t[r][1]/s}return v};function h(o){return Math.sin((o-(o-Math.PI)/8/Math.PI)/2)}function j(u,t,o,v,r){var w=0;var q=t-u;var s=Math.abs(q);var p=o;if(v==false){p+=r}if(p>0&&s>0.01&&s<6.282){w=parseFloat(p)/2/h(q)}return w}e.jqplot.PieRenderer.prototype.drawSlice=function(B,z,y,u,w){if(this._drawData){var p=this._radius;var A=this.fill;var x=this.lineWidth;var s=this.sliceMargin;if(this.fill==false){s+=this.lineWidth}B.save();B.translate(this._center[0],this._center[1]);var D=j(z,y,this.sliceMargin,this.fill,this.lineWidth);var o=D*Math.cos((z+y)/2);var C=D*Math.sin((z+y)/2);if((y-z)<=Math.PI){p-=D}else{p+=D}B.translate(o,C);if(w){for(var v=0,t=this.shadowDepth;v<t;v++){B.save();B.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));q(p)}for(var v=0,t=this.shadowDepth;v<t;v++){B.restore()}}else{q(p)}B.restore()}function q(r){if(y>6.282+this.startAngle){y=6.282+this.startAngle;if(z>y){z=6.281+this.startAngle}}if(z>=y){return}B.beginPath();B.fillStyle=u;B.strokeStyle=u;B.lineWidth=x;B.arc(0,0,r,z,y,false);B.lineTo(0,0);B.closePath();if(A){B.fill()}else{B.stroke()}}};e.jqplot.PieRenderer.prototype.draw=function(B,z,E,o){var W;var H=(E!=undefined)?E:{};var t=0;var s=0;var N=1;var L=new e.jqplot.ColorGenerator(this.seriesColors);if(E.legendInfo&&E.legendInfo.placement=="insideGrid"){var J=E.legendInfo;switch(J.location){case"nw":t=J.width+J.xoffset;break;case"w":t=J.width+J.xoffset;break;case"sw":t=J.width+J.xoffset;break;case"ne":t=J.width+J.xoffset;N=-1;break;case"e":t=J.width+J.xoffset;N=-1;break;case"se":t=J.width+J.xoffset;N=-1;break;case"n":s=J.height+J.yoffset;break;case"s":s=J.height+J.yoffset;N=-1;break;default:break}}var K=(H.shadow!=undefined)?H.shadow:this.shadow;var A=(H.fill!=undefined)?H.fill:this.fill;var C=B.canvas.width;var I=B.canvas.height;var Q=C-t-2*this.padding;var X=I-s-2*this.padding;var M=Math.min(Q,X);var Y=M;this._sliceAngles=[];var v=this.sliceMargin;if(this.fill==false){v+=this.lineWidth}var q;var G=0;var R,aa,Z,ab;var D=this.startAngle/180*Math.PI;for(var W=0,V=z.length;W<V;W++){aa=(W==0)?D:z[W-1][1]+D;Z=z[W][1]+D;this._sliceAngles.push([aa,Z]);q=j(aa,Z,this.sliceMargin,this.fill,this.lineWidth);if(Math.abs(Z-aa)>Math.PI){G=Math.max(q,G)}}if(this.diameter!=null&&this.diameter>0){this._diameter=this.diameter-2*G}else{this._diameter=Y-2*G}if(this._diameter<6){e.jqplot.log("Diameter of pie too small, not rendering.");return}var S=this._radius=this._diameter/2;this._center=[(C-N*t)/2+N*t+G*Math.cos(D),(I-N*s)/2+N*s+G*Math.sin(D)];if(this.shadow){for(var W=0,V=z.length;W<V;W++){ab="rgba(0,0,0,"+this.shadowAlpha+")";this.renderer.drawSlice.call(this,B,this._sliceAngles[W][0],this._sliceAngles[W][1],ab,true)}}for(var W=0;W<z.length;W++){this.renderer.drawSlice.call(this,B,this._sliceAngles[W][0],this._sliceAngles[W][1],L.next(),false);if(this.showDataLabels&&z[W][2]*100>=this.dataLabelThreshold){var F,U=(this._sliceAngles[W][0]+this._sliceAngles[W][1])/2,T;if(this.dataLabels=="label"){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,z[W][0])}else{if(this.dataLabels=="value"){F=this.dataLabelFormatString||"%d";T=e.jqplot.sprintf(F,this.data[W][1])}else{if(this.dataLabels=="percent"){F=this.dataLabelFormatString||"%d%%";T=e.jqplot.sprintf(F,z[W][2]*100)}else{if(this.dataLabels.constructor==Array){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,this.dataLabels[W])}}}}var p=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var P=this._center[0]+Math.cos(U)*p+this.canvas._offsets.left;var O=this._center[1]+Math.sin(U)*p+this.canvas._offsets.top;var u=e('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">'+T+"</div>").insertBefore(o.eventCanvas._elem);if(this.dataLabelCenterOn){P-=u.width()/2;O-=u.height()/2}else{P-=u.width()*Math.sin(U/2);O-=u.height()/2}P=Math.round(P);O=Math.round(O);u.css({left:P,top:O})}}};e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer;e.jqplot.PieAxisRenderer.prototype.init=function(o){this.tickRenderer=e.jqplot.PieTickRenderer;e.extend(true,this,o);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer;e.jqplot.PieLegendRenderer.prototype.init=function(o){this.numberRows=null;this.numberColumns=null;e.extend(true,this,o)};e.jqplot.PieLegendRenderer.prototype.draw=function(){var r=this;if(this.show){var B=this._series;this._elem=e(document.createElement("table"));this._elem.addClass("jqplot-table-legend");var E={position:"absolute"};if(this.background){E.background=this.background}if(this.border){E.border=this.border}if(this.fontSize){E.fontSize=this.fontSize}if(this.fontFamily){E.fontFamily=this.fontFamily}if(this.textColor){E.textColor=this.textColor}if(this.marginTop!=null){E.marginTop=this.marginTop}if(this.marginBottom!=null){E.marginBottom=this.marginBottom}if(this.marginLeft!=null){E.marginLeft=this.marginLeft}if(this.marginRight!=null){E.marginRight=this.marginRight}this._elem.css(E);var I=false,A=false,o,y;var C=B[0];var p=new e.jqplot.ColorGenerator(C.seriesColors);if(C.show){var J=C.data;if(this.numberRows){o=this.numberRows;if(!this.numberColumns){y=Math.ceil(J.length/o)}else{y=this.numberColumns}}else{if(this.numberColumns){y=this.numberColumns;o=Math.ceil(J.length/this.numberColumns)}else{o=J.length;y=1}}var H,G;var q,w,v;var x,z,F;var D=0;var u,t;for(H=0;H<o;H++){q=e(document.createElement("tr"));q.addClass("jqplot-table-legend");if(A){q.prependTo(this._elem)}else{q.appendTo(this._elem)}for(G=0;G<y;G++){if(D<J.length){x=this.labels[D]||J[D][0].toString();F=p.next();if(!A){if(H>0){I=true}else{I=false}}else{if(H==o-1){I=false}else{I=true}}z=(I)?this.rowSpacing:"0";w=e(document.createElement("td"));w.addClass("jqplot-table-legend jqplot-table-legend-swatch");w.css({textAlign:"center",paddingTop:z});u=e(document.createElement("div"));u.addClass("jqplot-table-legend-swatch-outline");t=e(document.createElement("div"));t.addClass("jqplot-table-legend-swatch");t.css({backgroundColor:F,borderColor:F});w.append(u.append(t));v=e(document.createElement("td"));v.addClass("jqplot-table-legend jqplot-table-legend-label");v.css("paddingTop",z);if(this.escapeHtml){v.text(x)}else{v.html(x)}if(A){v.prependTo(q);w.prependTo(q)}else{w.appendTo(q);v.appendTo(q)}I=true}D++}}}}return this._elem};e.jqplot.PieRenderer.prototype.handleMove=function(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];r.target.trigger("jqplotDataMouseOver",o);if(r.series[o[0]].highlightMouseOver&&!(o[0]==r.plugins.pieRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){r.target.trigger("jqplotDataHighlight",o);d(r,o[0],o[1])}}else{if(s==null){k(r)}}};function c(s,r,p){p=p||{};p.axesDefaults=p.axesDefaults||{};p.legend=p.legend||{};p.seriesDefaults=p.seriesDefaults||{};var o=false;if(p.seriesDefaults.renderer==e.jqplot.PieRenderer){o=true}else{if(p.series){for(var q=0;q<p.series.length;q++){if(p.series[q].renderer==e.jqplot.PieRenderer){o=true}}}}if(o){p.axesDefaults.renderer=e.jqplot.PieAxisRenderer;p.legend.renderer=e.jqplot.PieLegendRenderer;p.legend.preDraw=true;p.seriesDefaults.pointLabels={show:false}}}function g(r,q,o){for(var p=0;p<this.series.length;p++){if(this.series[p].renderer.constructor==e.jqplot.PieRenderer){if(this.series[p].highlightMouseOver){this.series[p].highlightMouseDown=false}}}}function m(o){for(var p=0;p<this.series.length;p++){this.series[p].seriesColors=this.seriesColors;this.series[p].colorGenerator=e.jqplot.colorGenerator}}function d(t,r,q){var p=t.series[r];var o=t.plugins.pieRenderer.highlightCanvas;o._ctx.clearRect(0,0,o._ctx.canvas.width,o._ctx.canvas.height);p._highlightedPoint=q;t.plugins.pieRenderer.highlightedSeriesIndex=r;p.renderer.drawSlice.call(p,o._ctx,p._sliceAngles[q][0],p._sliceAngles[q][1],p.highlightColorGenerator.get(q),false)}function k(q){var o=q.plugins.pieRenderer.highlightCanvas;o._ctx.clearRect(0,0,o._ctx.canvas.width,o._ctx.canvas.height);for(var p=0;p<q.series.length;p++){q.series[p]._highlightedPoint=null}q.plugins.pieRenderer.highlightedSeriesIndex=null;q.target.trigger("jqplotDataUnhighlight")}function b(s,r,v,u,t){if(u){var q=[u.seriesIndex,u.pointIndex,u.data];var p=jQuery.Event("jqplotDataMouseOver");p.pageX=s.pageX;p.pageY=s.pageY;t.target.trigger(p,q);if(t.series[q[0]].highlightMouseOver&&!(q[0]==t.plugins.pieRenderer.highlightedSeriesIndex&&q[1]==t.series[q[0]]._highlightedPoint)){var o=jQuery.Event("jqplotDataHighlight");o.which=s.which;o.pageX=s.pageX;o.pageY=s.pageY;t.target.trigger(o,q);d(t,q[0],q[1])}}else{if(u==null){k(t)}}}function a(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];if(s.series[p[0]].highlightMouseDown&&!(p[0]==s.plugins.pieRenderer.highlightedSeriesIndex&&p[1]==s.series[p[0]]._highlightedPoint)){var o=jQuery.Event("jqplotDataHighlight");o.which=r.which;o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p);d(s,p[0],p[1])}}else{if(t==null){k(s)}}}function l(q,p,t,s,r){var o=r.plugins.pieRenderer.highlightedSeriesIndex;if(o!=null&&r.series[o].highlightMouseDown){k(r)}}function f(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var o=jQuery.Event("jqplotDataClick");o.which=r.which;o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p)}}function n(s,r,v,u,t){if(u){var q=[u.seriesIndex,u.pointIndex,u.data];var o=t.plugins.pieRenderer.highlightedSeriesIndex;if(o!=null&&t.series[o].highlightMouseDown){k(t)}var p=jQuery.Event("jqplotDataRightClick");p.which=s.which;p.pageX=s.pageX;p.pageY=s.pageY;t.target.trigger(p,q)}}function i(){if(this.plugins.pieRenderer&&this.plugins.pieRenderer.highlightCanvas){this.plugins.pieRenderer.highlightCanvas.resetCanvas();this.plugins.pieRenderer.highlightCanvas=null}this.plugins.pieRenderer={highlightedSeriesIndex:null};this.plugins.pieRenderer.highlightCanvas=new e.jqplot.GenericCanvas();var p=e(this.targetId+" .jqplot-data-label");if(p.length){e(p[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this))}else{this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this))}var o=this.plugins.pieRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(q){k(q.data.plot)})}e.jqplot.preInitHooks.push(c);e.jqplot.PieTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)};e.jqplot.PieTickRenderer.prototype=new e.jqplot.AxisTickRenderer();e.jqplot.PieTickRenderer.prototype.constructor=e.jqplot.PieTickRenderer})(jQuery);
1
+ /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2
+ jsDate | (c) 2010-2013 Chris Leonello
3
  */(function(e){e.jqplot.PieRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.PieRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.PieRenderer.prototype.constructor=e.jqplot.PieRenderer;e.jqplot.PieRenderer.prototype.init=function(q,u){this.diameter=null;this.padding=20;this.sliceMargin=0;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.dataLabelPositionFactor=0.52;this.dataLabelNudge=2;this.dataLabelCenterOn=true;this.startAngle=0;this.tickRenderer=e.jqplot.PieTickRenderer;this._drawData=true;this._type="pie";if(q.highlightMouseDown&&q.highlightMouseOver==null){q.highlightMouseOver=false}e.extend(true,this,q);if(this.sliceMargin<0){this.sliceMargin=0}this._diameter=null;this._radius=null;this._sliceAngles=[];this._highlightedPoint=null;if(this.highlightColors.length==0){for(var s=0;s<this.seriesColors.length;s++){var r=e.jqplot.getColorComponents(this.seriesColors[s]);var o=[r[0],r[1],r[2]];var t=o[0]+o[1]+o[2];for(var p=0;p<3;p++){o[p]=(t>570)?o[p]*0.8:o[p]+0.3*(255-o[p]);o[p]=parseInt(o[p],10)}this.highlightColors.push("rgb("+o[0]+","+o[1]+","+o[2]+")")}}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors);u.postParseOptionsHooks.addOnce(m);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",b);u.eventListenerHooks.addOnce("jqplotMouseDown",a);u.eventListenerHooks.addOnce("jqplotMouseUp",l);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",n);u.postDrawHooks.addOnce(i)};e.jqplot.PieRenderer.prototype.setGridData=function(t){var p=[];var u=[];var o=this.startAngle/180*Math.PI;var s=0;this._drawData=false;for(var r=0;r<this.data.length;r++){if(this.data[r][1]!=0){this._drawData=true}p.push(this.data[r][1]);u.push([this.data[r][0]]);if(r>0){p[r]+=p[r-1]}s+=this.data[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r<p.length;r++){u[r][1]=p[r]*q;u[r][2]=this.data[r][1]/s}this.gridData=u};e.jqplot.PieRenderer.prototype.makeGridData=function(t,u){var p=[];var v=[];var s=0;var o=this.startAngle/180*Math.PI;this._drawData=false;for(var r=0;r<t.length;r++){if(this.data[r][1]!=0){this._drawData=true}p.push(t[r][1]);v.push([t[r][0]]);if(r>0){p[r]+=p[r-1]}s+=t[r][1]}var q=Math.PI*2/p[p.length-1];for(var r=0;r<p.length;r++){v[r][1]=p[r]*q;v[r][2]=t[r][1]/s}return v};function h(o){return Math.sin((o-(o-Math.PI)/8/Math.PI)/2)}function j(u,t,o,v,r){var w=0;var q=t-u;var s=Math.abs(q);var p=o;if(v==false){p+=r}if(p>0&&s>0.01&&s<6.282){w=parseFloat(p)/2/h(q)}return w}e.jqplot.PieRenderer.prototype.drawSlice=function(B,z,y,u,w){if(this._drawData){var p=this._radius;var A=this.fill;var x=this.lineWidth;var s=this.sliceMargin;if(this.fill==false){s+=this.lineWidth}B.save();B.translate(this._center[0],this._center[1]);var D=j(z,y,this.sliceMargin,this.fill,this.lineWidth);var o=D*Math.cos((z+y)/2);var C=D*Math.sin((z+y)/2);if((y-z)<=Math.PI){p-=D}else{p+=D}B.translate(o,C);if(w){for(var v=0,t=this.shadowDepth;v<t;v++){B.save();B.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));q(p)}for(var v=0,t=this.shadowDepth;v<t;v++){B.restore()}}else{q(p)}B.restore()}function q(r){if(y>6.282+this.startAngle){y=6.282+this.startAngle;if(z>y){z=6.281+this.startAngle}}if(z>=y){return}B.beginPath();B.fillStyle=u;B.strokeStyle=u;B.lineWidth=x;B.arc(0,0,r,z,y,false);B.lineTo(0,0);B.closePath();if(A){B.fill()}else{B.stroke()}}};e.jqplot.PieRenderer.prototype.draw=function(B,z,E,o){var W;var H=(E!=undefined)?E:{};var t=0;var s=0;var N=1;var L=new e.jqplot.ColorGenerator(this.seriesColors);if(E.legendInfo&&E.legendInfo.placement=="insideGrid"){var J=E.legendInfo;switch(J.location){case"nw":t=J.width+J.xoffset;break;case"w":t=J.width+J.xoffset;break;case"sw":t=J.width+J.xoffset;break;case"ne":t=J.width+J.xoffset;N=-1;break;case"e":t=J.width+J.xoffset;N=-1;break;case"se":t=J.width+J.xoffset;N=-1;break;case"n":s=J.height+J.yoffset;break;case"s":s=J.height+J.yoffset;N=-1;break;default:break}}var K=(H.shadow!=undefined)?H.shadow:this.shadow;var A=(H.fill!=undefined)?H.fill:this.fill;var C=B.canvas.width;var I=B.canvas.height;var Q=C-t-2*this.padding;var X=I-s-2*this.padding;var M=Math.min(Q,X);var Y=M;this._sliceAngles=[];var v=this.sliceMargin;if(this.fill==false){v+=this.lineWidth}var q;var G=0;var R,aa,Z,ab;var D=this.startAngle/180*Math.PI;for(var W=0,V=z.length;W<V;W++){aa=(W==0)?D:z[W-1][1]+D;Z=z[W][1]+D;this._sliceAngles.push([aa,Z]);q=j(aa,Z,this.sliceMargin,this.fill,this.lineWidth);if(Math.abs(Z-aa)>Math.PI){G=Math.max(q,G)}}if(this.diameter!=null&&this.diameter>0){this._diameter=this.diameter-2*G}else{this._diameter=Y-2*G}if(this._diameter<6){e.jqplot.log("Diameter of pie too small, not rendering.");return}var S=this._radius=this._diameter/2;this._center=[(C-N*t)/2+N*t+G*Math.cos(D),(I-N*s)/2+N*s+G*Math.sin(D)];if(this.shadow){for(var W=0,V=z.length;W<V;W++){ab="rgba(0,0,0,"+this.shadowAlpha+")";this.renderer.drawSlice.call(this,B,this._sliceAngles[W][0],this._sliceAngles[W][1],ab,true)}}for(var W=0;W<z.length;W++){this.renderer.drawSlice.call(this,B,this._sliceAngles[W][0],this._sliceAngles[W][1],L.next(),false);if(this.showDataLabels&&z[W][2]*100>=this.dataLabelThreshold){var F,U=(this._sliceAngles[W][0]+this._sliceAngles[W][1])/2,T;if(this.dataLabels=="label"){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,z[W][0])}else{if(this.dataLabels=="value"){F=this.dataLabelFormatString||"%d";T=e.jqplot.sprintf(F,this.data[W][1])}else{if(this.dataLabels=="percent"){F=this.dataLabelFormatString||"%d%%";T=e.jqplot.sprintf(F,z[W][2]*100)}else{if(this.dataLabels.constructor==Array){F=this.dataLabelFormatString||"%s";T=e.jqplot.sprintf(F,this.dataLabels[W])}}}}var p=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var P=this._center[0]+Math.cos(U)*p+this.canvas._offsets.left;var O=this._center[1]+Math.sin(U)*p+this.canvas._offsets.top;var u=e('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">'+T+"</div>").insertBefore(o.eventCanvas._elem);if(this.dataLabelCenterOn){P-=u.width()/2;O-=u.height()/2}else{P-=u.width()*Math.sin(U/2);O-=u.height()/2}P=Math.round(P);O=Math.round(O);u.css({left:P,top:O})}}};e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer;e.jqplot.PieAxisRenderer.prototype.init=function(o){this.tickRenderer=e.jqplot.PieTickRenderer;e.extend(true,this,o);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer;e.jqplot.PieLegendRenderer.prototype.init=function(o){this.numberRows=null;this.numberColumns=null;e.extend(true,this,o)};e.jqplot.PieLegendRenderer.prototype.draw=function(){var r=this;if(this.show){var B=this._series;this._elem=e(document.createElement("table"));this._elem.addClass("jqplot-table-legend");var E={position:"absolute"};if(this.background){E.background=this.background}if(this.border){E.border=this.border}if(this.fontSize){E.fontSize=this.fontSize}if(this.fontFamily){E.fontFamily=this.fontFamily}if(this.textColor){E.textColor=this.textColor}if(this.marginTop!=null){E.marginTop=this.marginTop}if(this.marginBottom!=null){E.marginBottom=this.marginBottom}if(this.marginLeft!=null){E.marginLeft=this.marginLeft}if(this.marginRight!=null){E.marginRight=this.marginRight}this._elem.css(E);var I=false,A=false,o,y;var C=B[0];var p=new e.jqplot.ColorGenerator(C.seriesColors);if(C.show){var J=C.data;if(this.numberRows){o=this.numberRows;if(!this.numberColumns){y=Math.ceil(J.length/o)}else{y=this.numberColumns}}else{if(this.numberColumns){y=this.numberColumns;o=Math.ceil(J.length/this.numberColumns)}else{o=J.length;y=1}}var H,G;var q,w,v;var x,z,F;var D=0;var u,t;for(H=0;H<o;H++){q=e(document.createElement("tr"));q.addClass("jqplot-table-legend");if(A){q.prependTo(this._elem)}else{q.appendTo(this._elem)}for(G=0;G<y;G++){if(D<J.length){x=this.labels[D]||J[D][0].toString();F=p.next();if(!A){if(H>0){I=true}else{I=false}}else{if(H==o-1){I=false}else{I=true}}z=(I)?this.rowSpacing:"0";w=e(document.createElement("td"));w.addClass("jqplot-table-legend jqplot-table-legend-swatch");w.css({textAlign:"center",paddingTop:z});u=e(document.createElement("div"));u.addClass("jqplot-table-legend-swatch-outline");t=e(document.createElement("div"));t.addClass("jqplot-table-legend-swatch");t.css({backgroundColor:F,borderColor:F});w.append(u.append(t));v=e(document.createElement("td"));v.addClass("jqplot-table-legend jqplot-table-legend-label");v.css("paddingTop",z);if(this.escapeHtml){v.text(x)}else{v.html(x)}if(A){v.prependTo(q);w.prependTo(q)}else{w.appendTo(q);v.appendTo(q)}I=true}D++}}}}return this._elem};e.jqplot.PieRenderer.prototype.handleMove=function(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];r.target.trigger("jqplotDataMouseOver",o);if(r.series[o[0]].highlightMouseOver&&!(o[0]==r.plugins.pieRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){r.target.trigger("jqplotDataHighlight",o);d(r,o[0],o[1])}}else{if(s==null){k(r)}}};function c(s,r,p){p=p||{};p.axesDefaults=p.axesDefaults||{};p.legend=p.legend||{};p.seriesDefaults=p.seriesDefaults||{};var o=false;if(p.seriesDefaults.renderer==e.jqplot.PieRenderer){o=true}else{if(p.series){for(var q=0;q<p.series.length;q++){if(p.series[q].renderer==e.jqplot.PieRenderer){o=true}}}}if(o){p.axesDefaults.renderer=e.jqplot.PieAxisRenderer;p.legend.renderer=e.jqplot.PieLegendRenderer;p.legend.preDraw=true;p.seriesDefaults.pointLabels={show:false}}}function g(r,q,o){for(var p=0;p<this.series.length;p++){if(this.series[p].renderer.constructor==e.jqplot.PieRenderer){if(this.series[p].highlightMouseOver){this.series[p].highlightMouseDown=false}}}}function m(o){for(var p=0;p<this.series.length;p++){this.series[p].seriesColors=this.seriesColors;this.series[p].colorGenerator=e.jqplot.colorGenerator}}function d(t,r,q){var p=t.series[r];var o=t.plugins.pieRenderer.highlightCanvas;o._ctx.clearRect(0,0,o._ctx.canvas.width,o._ctx.canvas.height);p._highlightedPoint=q;t.plugins.pieRenderer.highlightedSeriesIndex=r;p.renderer.drawSlice.call(p,o._ctx,p._sliceAngles[q][0],p._sliceAngles[q][1],p.highlightColorGenerator.get(q),false)}function k(q){var o=q.plugins.pieRenderer.highlightCanvas;o._ctx.clearRect(0,0,o._ctx.canvas.width,o._ctx.canvas.height);for(var p=0;p<q.series.length;p++){q.series[p]._highlightedPoint=null}q.plugins.pieRenderer.highlightedSeriesIndex=null;q.target.trigger("jqplotDataUnhighlight")}function b(s,r,v,u,t){if(u){var q=[u.seriesIndex,u.pointIndex,u.data];var p=jQuery.Event("jqplotDataMouseOver");p.pageX=s.pageX;p.pageY=s.pageY;t.target.trigger(p,q);if(t.series[q[0]].highlightMouseOver&&!(q[0]==t.plugins.pieRenderer.highlightedSeriesIndex&&q[1]==t.series[q[0]]._highlightedPoint)){var o=jQuery.Event("jqplotDataHighlight");o.which=s.which;o.pageX=s.pageX;o.pageY=s.pageY;t.target.trigger(o,q);d(t,q[0],q[1])}}else{if(u==null){k(t)}}}function a(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];if(s.series[p[0]].highlightMouseDown&&!(p[0]==s.plugins.pieRenderer.highlightedSeriesIndex&&p[1]==s.series[p[0]]._highlightedPoint)){var o=jQuery.Event("jqplotDataHighlight");o.which=r.which;o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p);d(s,p[0],p[1])}}else{if(t==null){k(s)}}}function l(q,p,t,s,r){var o=r.plugins.pieRenderer.highlightedSeriesIndex;if(o!=null&&r.series[o].highlightMouseDown){k(r)}}function f(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var o=jQuery.Event("jqplotDataClick");o.which=r.which;o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p)}}function n(s,r,v,u,t){if(u){var q=[u.seriesIndex,u.pointIndex,u.data];var o=t.plugins.pieRenderer.highlightedSeriesIndex;if(o!=null&&t.series[o].highlightMouseDown){k(t)}var p=jQuery.Event("jqplotDataRightClick");p.which=s.which;p.pageX=s.pageX;p.pageY=s.pageY;t.target.trigger(p,q)}}function i(){if(this.plugins.pieRenderer&&this.plugins.pieRenderer.highlightCanvas){this.plugins.pieRenderer.highlightCanvas.resetCanvas();this.plugins.pieRenderer.highlightCanvas=null}this.plugins.pieRenderer={highlightedSeriesIndex:null};this.plugins.pieRenderer.highlightCanvas=new e.jqplot.GenericCanvas();var p=e(this.targetId+" .jqplot-data-label");if(p.length){e(p[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this))}else{this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this))}var o=this.plugins.pieRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(q){k(q.data.plot)})}e.jqplot.preInitHooks.push(c);e.jqplot.PieTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)};e.jqplot.PieTickRenderer.prototype=new e.jqplot.AxisTickRenderer();e.jqplot.PieTickRenderer.prototype.constructor=e.jqplot.PieTickRenderer})(jQuery);
js/jqplot/plugins/jqplot.trendline.min.js CHANGED
@@ -1,3 +1,3 @@
1
- /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2
- jsDate | (c) 2010-2013 Chris Leonello
3
  */(function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var j=null;if(k.trendline&&k.trendline.show){var i=k.trendline.label.toString();if(i){j={label:i,color:k.trendline.color}}}return j}function e(m,k,j,i,l){if(this._type&&(this._type==="line"||this._type=="bar")){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(this.trendline&&i.show){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p<v.length;p++){if(v[p]<=0){s--}else{k.push(w[p]);j.push(Math.log(v[p]))}}}}for(var p=0;p<s;p++){o=o+k[p];m=m+j[p];q=q+k[p]*j[p];r=r+k[p]*k[p];l=l+j[p]*j[p]}t=(s*q-o*m)/(s*r-o*o);z=(m-t*o)/s;return[t,z]}function h(k,j){var i;i=b(k,j,"linear");return[i[0],i[1]]}function d(o,m){var k;var i=o;var n=m;k=b(i,n,"exp");var l=Math.exp(k[0]);var j=Math.exp(k[1]);return[l,j]}function c(l,j){var p=(j==null)?"linear":j;var n;var o;var r=[];var q=[];var m=[];for(k=0;k<l.length;k++){if(l[k]!=null&&l[k][0]!=null&&l[k][1]!=null){r.push(l[k][0]);q.push(l[k][1])}}if(p=="linear"){n=h(r,q);for(var k=0;k<r.length;k++){o=n[0]*r[k]+n[1];m.push([r[k],o])}}else{if(p=="exp"||p=="exponential"){n=d(r,q);for(var k=0;k<r.length;k++){o=n[1]*Math.pow(n[0],r[k]);m.push([r[k],o])}}}return{data:m,slope:n[0],intercept:n[1]}}})(jQuery);
1
+ /* jqPlot 1.0.8r1250 | (c) 2009-2013 Chris Leonello | jplot.com
2
+ jsDate | (c) 2010-2013 Chris Leonello
3
  */(function(f){f.jqplot.Trendline=function(){this.show=f.jqplot.config.enablePlugins;this.color="#666666";this.renderer=new f.jqplot.LineRenderer();this.rendererOptions={marker:{show:false}};this.label="";this.type="linear";this.shadow=true;this.markerRenderer={show:false};this.lineWidth=1.5;this.shadowAngle=45;this.shadowOffset=1;this.shadowAlpha=0.07;this.shadowDepth=3;this.isTrendline=true};f.jqplot.postSeriesInitHooks.push(e);f.jqplot.postDrawSeriesHooks.push(g);f.jqplot.addLegendRowHooks.push(a);function a(k){var j=null;if(k.trendline&&k.trendline.show){var i=k.trendline.label.toString();if(i){j={label:i,color:k.trendline.color}}}return j}function e(m,k,j,i,l){if(this._type&&(this._type==="line"||this._type=="bar")){this.trendline=new f.jqplot.Trendline();i=i||{};f.extend(true,this.trendline,{color:this.color},j.trendline,i.trendline);this.trendline.renderer.init.call(this.trendline,null)}}function g(m,i){i=f.extend(true,{},this.trendline,i);if(this.trendline&&i.show){var k;var l=i.data||this.data;k=c(l,this.trendline.type);var j=i.gridData||this.renderer.makeGridData.call(this,k.data);this.trendline.renderer.draw.call(this.trendline,m,j,{showLine:true,shadow:this.trendline.shadow})}}function b(w,v,n){var u=(n==null)?"linear":n;var s=w.length;var t;var z;var o=0;var m=0;var r=0;var q=0;var l=0;var j=[];var k=[];if(u=="linear"){k=w;j=v}else{if(u=="exp"||u=="exponential"){for(var p=0;p<v.length;p++){if(v[p]<=0){s--}else{k.push(w[p]);j.push(Math.log(v[p]))}}}}for(var p=0;p<s;p++){o=o+k[p];m=m+j[p];q=q+k[p]*j[p];r=r+k[p]*k[p];l=l+j[p]*j[p]}t=(s*q-o*m)/(s*r-o*o);z=(m-t*o)/s;return[t,z]}function h(k,j){var i;i=b(k,j,"linear");return[i[0],i[1]]}function d(o,m){var k;var i=o;var n=m;k=b(i,n,"exp");var l=Math.exp(k[0]);var j=Math.exp(k[1]);return[l,j]}function c(l,j){var p=(j==null)?"linear":j;var n;var o;var r=[];var q=[];var m=[];for(k=0;k<l.length;k++){if(l[k]!=null&&l[k][0]!=null&&l[k][1]!=null){r.push(l[k][0]);q.push(l[k][1])}}if(p=="linear"){n=h(r,q);for(var k=0;k<r.length;k++){o=n[0]*r[k]+n[1];m.push([r[k],o])}}else{if(p=="exp"||p=="exponential"){n=d(r,q);for(var k=0;k<r.length;k++){o=n[1]*Math.pow(n[0],r[k]);m.push([r[k],o])}}}return{data:m,slope:n[0],intercept:n[1]}}})(jQuery);
js/jqplot/usage.txt CHANGED
File without changes
js/jqplot/wp-piwik.jqplot.js CHANGED
File without changes
js/sparkline/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
  // Nothing to see...
1
+ <?php
2
  // Nothing to see...
js/sparkline/jquery.sparkline.js CHANGED
File without changes
js/sparkline/jquery.sparkline.min.js CHANGED
File without changes
js/wp-piwik.js CHANGED
File without changes
languages/.htaccess CHANGED
File without changes
languages/.tx/config CHANGED
File without changes
languages/update.sh CHANGED
File without changes
languages/wp-piwik-az_AZ.mo CHANGED
File without changes
languages/wp-piwik-az_AZ.po CHANGED
File without changes
languages/wp-piwik-be_BY.mo CHANGED
File without changes
languages/wp-piwik-be_BY.po CHANGED
File without changes
languages/wp-piwik-cs_CZ.mo CHANGED
File without changes
languages/wp-piwik-cs_CZ.po CHANGED
File without changes
languages/wp-piwik-de_CH.mo CHANGED
File without changes
languages/wp-piwik-de_CH.po CHANGED
File without changes
languages/wp-piwik-de_DE.mo CHANGED
File without changes
languages/wp-piwik-de_DE.po CHANGED
File without changes
languages/wp-piwik-el.mo CHANGED
File without changes
languages/wp-piwik-el.po CHANGED
File without changes
languages/wp-piwik-el_GR.mo CHANGED
File without changes
languages/wp-piwik-el_GR.po CHANGED
File without changes
languages/wp-piwik-es_ES.mo CHANGED
File without changes
languages/wp-piwik-es_ES.po CHANGED
File without changes
languages/wp-piwik-fa_IR.mo CHANGED
File without changes
languages/wp-piwik-fa_IR.po CHANGED
File without changes
languages/wp-piwik-fr_FR.mo CHANGED
File without changes
languages/wp-piwik-fr_FR.po CHANGED
File without changes
languages/wp-piwik-hi.mo CHANGED
File without changes
languages/wp-piwik-hi.po CHANGED
File without changes
languages/wp-piwik-hu_HU.mo CHANGED
File without changes
languages/wp-piwik-hu_HU.po CHANGED
File without changes
languages/wp-piwik-id.mo CHANGED
File without changes
languages/wp-piwik-id.po CHANGED
File without changes
languages/wp-piwik-it_IT.mo CHANGED
File without changes
languages/wp-piwik-it_IT.po CHANGED
File without changes
languages/wp-piwik-lb.mo CHANGED
File without changes
languages/wp-piwik-lb.po CHANGED
File without changes
languages/wp-piwik-lt_LT.mo CHANGED
File without changes
languages/wp-piwik-lt_LT.po CHANGED
File without changes
languages/wp-piwik-nb_NO.mo CHANGED
File without changes
languages/wp-piwik-nb_NO.po CHANGED
File without changes
languages/wp-piwik-nl_NL.mo CHANGED
File without changes
languages/wp-piwik-nl_NL.po CHANGED
File without changes
languages/wp-piwik-pl_PL.mo CHANGED
File without changes
languages/wp-piwik-pl_PL.po CHANGED
File without changes
languages/wp-piwik-pt_BR.mo CHANGED
File without changes
languages/wp-piwik-pt_BR.po CHANGED
File without changes
languages/wp-piwik-ro_RO.mo CHANGED
File without changes
languages/wp-piwik-ro_RO.po CHANGED
File without changes
languages/wp-piwik-ru_RU.mo CHANGED
File without changes
languages/wp-piwik-ru_RU.po CHANGED
File without changes
languages/wp-piwik-sl_SI.mo CHANGED
File without changes
languages/wp-piwik-sl_SI.po CHANGED
File without changes
languages/wp-piwik-sq.mo CHANGED
File without changes
languages/wp-piwik-sq.po CHANGED
File without changes
languages/wp-piwik-sv_SE.mo CHANGED
File without changes
languages/wp-piwik-sv_SE.po CHANGED
File without changes
languages/wp-piwik-tr_TR.mo CHANGED
File without changes
languages/wp-piwik-tr_TR.po CHANGED
File without changes
languages/wp-piwik-ua_UA.mo CHANGED
File without changes
languages/wp-piwik-ua_UA.po CHANGED
File without changes
languages/wp-piwik-uk_UA.mo CHANGED
File without changes
languages/wp-piwik-uk_UA.po CHANGED
File without changes
languages/wp-piwik-zh_CN.mo CHANGED
File without changes
languages/wp-piwik-zh_CN.po CHANGED
File without changes
languages/wp-piwik.pot CHANGED
@@ -1,6 +1,6 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WP-Piwik 1.0.18\n"
4
  "POT-Creation-Date: 2017-10-09 20:37+0200\n"
5
  "MIME-Version: 1.0\n"
6
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -12,7 +12,7 @@ msgid "%s %s installed."
12
  msgstr ""
13
 
14
  #: classes/WP_Piwik.php:203
15
- msgid "Next you should connect to Piwik"
16
  msgstr ""
17
 
18
  #: classes/WP_Piwik.php:237
@@ -33,11 +33,11 @@ msgid "Important"
33
  msgstr ""
34
 
35
  #: classes/WP_Piwik.php:387 classes/WP_Piwik.php:409
36
- msgid "Piwik Statistics"
37
  msgstr ""
38
 
39
  #: classes/WP_Piwik.php:499
40
- msgid "Configure WP-Piwik"
41
  msgstr ""
42
 
43
  #: classes/WP_Piwik.php:992
@@ -61,12 +61,12 @@ msgid "Changes saved."
61
  msgstr ""
62
 
63
  #: classes/WP_Piwik/Admin/Settings.php:55
64
- msgid "Thanks for using WP-Piwik!"
65
  msgstr ""
66
 
67
  #: classes/WP_Piwik/Admin/Settings.php:58
68
  #, php-format
69
- msgid "WP-Piwik %s is successfully connected to Piwik %s."
70
  msgstr ""
71
 
72
  #: classes/WP_Piwik/Admin/Settings.php:58
@@ -77,33 +77,33 @@ msgstr ""
77
  #: classes/WP_Piwik/Admin/Settings.php:58
78
  #, php-format
79
  msgid ""
80
- "You are running a WordPress %s blog network (WPMU). WP-Piwik will handle "
81
  "your sites as different websites."
82
  msgstr ""
83
 
84
  #: classes/WP_Piwik/Admin/Settings.php:62
85
  #, php-format
86
  msgid ""
87
- "WP-Piwik %s was not able to connect to Piwik using your configuration. Check "
88
- "the &raquo;Connect to Piwik&laquo; section below."
89
  msgstr ""
90
 
91
  #: classes/WP_Piwik/Admin/Settings.php:64
92
  #, php-format
93
  msgid ""
94
- "WP-Piwik %s was not able to connect to Piwik using your configuration. "
95
  "During connection the following error occured: <br /><code>%s</code>"
96
  msgstr ""
97
 
98
  #: classes/WP_Piwik/Admin/Settings.php:67
99
  #, php-format
100
  msgid ""
101
- "WP-Piwik %s has to be connected to Piwik first. Check the &raquo;Connect to "
102
- "Piwik&laquo; section below."
103
  msgstr ""
104
 
105
  #: classes/WP_Piwik/Admin/Settings.php:71
106
- msgid "Connect to Piwik"
107
  msgstr ""
108
 
109
  #: classes/WP_Piwik/Admin/Settings.php:76
@@ -124,14 +124,14 @@ msgstr ""
124
 
125
  #: classes/WP_Piwik/Admin/Settings.php:106
126
  msgid ""
127
- "WP-Piwik is a WordPress plugin to show a selection of Piwik stats in your "
128
- "WordPress admin dashboard and to add and configure your Piwik tracking code. "
129
- "To use this you will need your own Piwik instance. If you do not already "
130
- "have a Piwik setup, you have two simple options: use either"
131
  msgstr ""
132
 
133
  #: classes/WP_Piwik/Admin/Settings.php:106
134
- msgid "a self-hosted Piwik"
135
  msgstr ""
136
 
137
  #: classes/WP_Piwik/Admin/Settings.php:106
@@ -139,12 +139,12 @@ msgid "or"
139
  msgstr ""
140
 
141
  #: classes/WP_Piwik/Admin/Settings.php:106
142
- msgid "a cloud-hosted Piwik by InnoCraft"
143
  msgstr ""
144
 
145
  #: classes/WP_Piwik/Admin/Settings.php:109
146
  msgid ""
147
- "Neither cURL nor fopen are available. So WP-Piwik can not use the HTTP API "
148
  "and not connect to InnoCraft Cloud."
149
  msgstr ""
150
 
@@ -164,8 +164,8 @@ msgstr ""
164
 
165
  #: classes/WP_Piwik/Admin/Settings.php:111
166
  msgid ""
167
- "This is the default option for a self-hosted Piwik and should work for most "
168
- "configurations. WP-Piwik will connect to Piwik using http(s)."
169
  msgstr ""
170
 
171
  #: classes/WP_Piwik/Admin/Settings.php:111
@@ -175,8 +175,8 @@ msgstr ""
175
 
176
  #: classes/WP_Piwik/Admin/Settings.php:111
177
  msgid ""
178
- "Choose this, if your self-hosted Piwik and WordPress are running on the same "
179
- "machine and you know the full server path to your Piwik instance."
180
  msgstr ""
181
 
182
  #: classes/WP_Piwik/Admin/Settings.php:111
@@ -186,38 +186,38 @@ msgstr ""
186
 
187
  #: classes/WP_Piwik/Admin/Settings.php:111
188
  msgid ""
189
- "If you are using a cloud-hosted Piwik by InnoCraft, you can simply use this "
190
  "option."
191
  msgstr ""
192
 
193
  #: classes/WP_Piwik/Admin/Settings.php:112
194
- msgid "Piwik Mode"
195
  msgstr ""
196
 
197
  #: classes/WP_Piwik/Admin/Settings.php:113
198
- msgid "Disabled (WP-Piwik will not connect to Piwik)"
199
  msgstr ""
200
 
201
  #: classes/WP_Piwik/Admin/Settings.php:119
202
- msgid "Piwik URL"
203
  msgstr ""
204
 
205
  #: classes/WP_Piwik/Admin/Settings.php:119
206
  msgid ""
207
- "Enter your Piwik URL. This is the same URL you use to access your Piwik "
208
- "instance, e.g. http://www.example.com/piwik/."
209
  msgstr ""
210
 
211
  #: classes/WP_Piwik/Admin/Settings.php:120
212
- msgid "Piwik path"
213
  msgstr ""
214
 
215
  #: classes/WP_Piwik/Admin/Settings.php:120
216
- msgid "Enter the file path to your Piwik instance, e.g. /var/www/piwik/."
217
  msgstr ""
218
 
219
  #: classes/WP_Piwik/Admin/Settings.php:121
220
- msgid "Piwik subdomain"
221
  msgstr ""
222
 
223
  #: classes/WP_Piwik/Admin/Settings.php:121
@@ -232,13 +232,13 @@ msgstr ""
232
 
233
  #: classes/WP_Piwik/Admin/Settings.php:122
234
  msgid ""
235
- "Enter your Piwik auth token here. It is an alphanumerical code like "
236
  "0a1b2c34d56e78901fa2bc3d45678efa."
237
  msgstr ""
238
 
239
  #: classes/WP_Piwik/Admin/Settings.php:122
240
  #, php-format
241
- msgid "See %sWP-Piwik FAQ%s."
242
  msgstr ""
243
 
244
  #: classes/WP_Piwik/Admin/Settings.php:127
@@ -247,14 +247,14 @@ msgstr ""
247
 
248
  #: classes/WP_Piwik/Admin/Settings.php:127
249
  msgid ""
250
- "Check this to automatically choose your blog from your Piwik sites by URL. "
251
- "If your blog is not added to Piwik yet, WP-Piwik will add a new site."
252
  msgstr ""
253
 
254
  #: classes/WP_Piwik/Admin/Settings.php:131
255
  #, php-format
256
  msgid ""
257
- "WP-Piwik %s was not able to get sites with at least view access: <br /><code>"
258
  "%s</code>"
259
  msgstr ""
260
 
@@ -267,7 +267,7 @@ msgid "Select site"
267
  msgstr ""
268
 
269
  #: classes/WP_Piwik/Admin/Settings.php:155
270
- msgid "Piwik default date"
271
  msgstr ""
272
 
273
  #: classes/WP_Piwik/Admin/Settings.php:156
@@ -339,7 +339,7 @@ msgid "Last 30 days"
339
  msgstr ""
340
 
341
  #: classes/WP_Piwik/Admin/Settings.php:172
342
- msgid "Enable WP-Piwik dashboard widget &quot;Overview&quot;."
343
  msgstr ""
344
 
345
  #: classes/WP_Piwik/Admin/Settings.php:174
@@ -347,7 +347,7 @@ msgid "Dashboard graph"
347
  msgstr ""
348
 
349
  #: classes/WP_Piwik/Admin/Settings.php:174
350
- msgid "Enable WP-Piwik dashboard widget &quot;Graph&quot;."
351
  msgstr ""
352
 
353
  #: classes/WP_Piwik/Admin/Settings.php:176
@@ -355,7 +355,7 @@ msgid "Dashboard SEO"
355
  msgstr ""
356
 
357
  #: classes/WP_Piwik/Admin/Settings.php:176
358
- msgid "Enable WP-Piwik dashboard widget &quot;SEO&quot;."
359
  msgstr ""
360
 
361
  #: classes/WP_Piwik/Admin/Settings.php:178
@@ -363,7 +363,7 @@ msgid "Dashboard e-commerce"
363
  msgstr ""
364
 
365
  #: classes/WP_Piwik/Admin/Settings.php:178
366
- msgid "Enable WP-Piwik dashboard widget &quot;E-commerce&quot;."
367
  msgstr ""
368
 
369
  #: classes/WP_Piwik/Admin/Settings.php:180
@@ -391,15 +391,15 @@ msgid "Show stats about single posts at the post edit admin page."
391
  msgstr ""
392
 
393
  #: classes/WP_Piwik/Admin/Settings.php:193
394
- msgid "Piwik shortcut"
395
  msgstr ""
396
 
397
  #: classes/WP_Piwik/Admin/Settings.php:193
398
- msgid "Display a shortcut to Piwik itself."
399
  msgstr ""
400
 
401
  #: classes/WP_Piwik/Admin/Settings.php:195
402
- msgid "WP-Piwik display name"
403
  msgstr ""
404
 
405
  #: classes/WP_Piwik/Admin/Settings.php:195
@@ -420,7 +420,7 @@ msgstr ""
420
 
421
  #: classes/WP_Piwik/Admin/Settings.php:208
422
  msgid ""
423
- "WP-Piwik will not add the tracking code. Use this, if you want to add the "
424
  "tracking code to your template files or you use another plugin to add the "
425
  "tracking code."
426
  msgstr ""
@@ -431,7 +431,7 @@ msgid "Default tracking"
431
  msgstr ""
432
 
433
  #: classes/WP_Piwik/Admin/Settings.php:208
434
- msgid "WP-Piwik will use Piwik's standard tracking code."
435
  msgstr ""
436
 
437
  #: classes/WP_Piwik/Admin/Settings.php:208
@@ -442,7 +442,7 @@ msgstr ""
442
  #: classes/WP_Piwik/Admin/Settings.php:208
443
  msgid ""
444
  "You can choose this tracking code, to deliver a minified proxy code and to "
445
- "avoid using the files called piwik.js or piwik.php."
446
  msgstr ""
447
 
448
  #: classes/WP_Piwik/Admin/Settings.php:208
@@ -456,14 +456,14 @@ msgid "Use proxy script"
456
  msgstr ""
457
 
458
  #: classes/WP_Piwik/Admin/Settings.php:208
459
- msgid "Use this tracking code to not reveal the Piwik server URL."
460
  msgstr ""
461
 
462
  #: classes/WP_Piwik/Admin/Settings.php:208
463
  #: classes/WP_Piwik/Admin/Settings.php:228
464
  #: classes/WP_Piwik/Admin/Settings.php:238
465
  #, php-format
466
- msgid "See %sPiwik FAQ%s."
467
  msgstr ""
468
 
469
  #: classes/WP_Piwik/Admin/Settings.php:208
@@ -479,7 +479,7 @@ msgid ""
479
  msgstr ""
480
 
481
  #: classes/WP_Piwik/Admin/Settings.php:208
482
- msgid "Use the placeholder {ID} to add the Piwik site ID."
483
  msgstr ""
484
 
485
  #: classes/WP_Piwik/Admin/Settings.php:209
@@ -560,7 +560,7 @@ msgstr ""
560
  #: classes/WP_Piwik/Admin/Settings.php:278
561
  #: classes/WP_Piwik/Admin/Settings.php:343
562
  #, php-format
563
- msgid "See %sPiwik documentation%s."
564
  msgstr ""
565
 
566
  #: classes/WP_Piwik/Admin/Settings.php:236
@@ -568,7 +568,7 @@ msgid "Track search"
568
  msgstr ""
569
 
570
  #: classes/WP_Piwik/Admin/Settings.php:236
571
- msgid "Use Piwik's advanced Site Search Analytics feature."
572
  msgstr ""
573
 
574
  #: classes/WP_Piwik/Admin/Settings.php:238
@@ -576,7 +576,7 @@ msgid "Track 404"
576
  msgstr ""
577
 
578
  #: classes/WP_Piwik/Admin/Settings.php:238
579
- msgid "WP-Piwik can automatically add a 404-category to track 404-page-visits."
580
  msgstr ""
581
 
582
  #: classes/WP_Piwik/Admin/Settings.php:241
@@ -677,8 +677,8 @@ msgid ""
677
  "domain by default. When this feature is enabled, it will append a URL "
678
  "parameter \"pk_vid\" that contains the visitor ID when a user clicks on a "
679
  "URL that belongs to one of your domains. For this feature to work, you also "
680
- "have to configure which domains should be treated as local in your Piwik "
681
- "website settings. This feature requires Piwik 3.0.2."
682
  msgstr ""
683
 
684
  #: classes/WP_Piwik/Admin/Settings.php:276
@@ -694,7 +694,7 @@ msgid "Track RSS feed links as campaign"
694
  msgstr ""
695
 
696
  #: classes/WP_Piwik/Admin/Settings.php:278
697
- msgid "This will add Piwik campaign parameters to the RSS feed links. "
698
  msgstr ""
699
 
700
  #: classes/WP_Piwik/Admin/Settings.php:280
@@ -713,7 +713,7 @@ msgstr ""
713
  msgid ""
714
  "Enable a heartbeat timer to get more accurate visit lengths by sending "
715
  "periodical HTTP ping requests as long as the site is opened. Enter the time "
716
- "between the pings in seconds (Piwik default: 15) to enable or 0 to disable "
717
  "this feature. <strong>Note:</strong> This will cause a lot of additional "
718
  "HTTP requests on your site."
719
  msgstr ""
@@ -775,7 +775,7 @@ msgstr ""
775
 
776
  #: classes/WP_Piwik/Admin/Settings.php:303
777
  msgid ""
778
- "Choose whether WP-Piwik should use cURL or fopen to connect to Piwik in HTTP "
779
  "or Cloud mode."
780
  msgstr ""
781
 
@@ -794,7 +794,7 @@ msgid "GET"
794
  msgstr ""
795
 
796
  #: classes/WP_Piwik/Admin/Settings.php:308
797
- msgid "Choose whether WP-Piwik should use POST or GET in HTTP or Cloud mode."
798
  msgstr ""
799
 
800
  #: classes/WP_Piwik/Admin/Settings.php:310
@@ -848,7 +848,7 @@ msgstr ""
848
 
849
  #: classes/WP_Piwik/Admin/Settings.php:323
850
  #, php-format
851
- msgid "See %sPiwik Blog%s."
852
  msgstr ""
853
 
854
  #: classes/WP_Piwik/Admin/Settings.php:323
@@ -879,7 +879,7 @@ msgid "CDN URL (SSL)"
879
  msgstr ""
880
 
881
  #: classes/WP_Piwik/Admin/Settings.php:331
882
- msgid "Force Piwik to use a specific protocol"
883
  msgstr ""
884
 
885
  #: classes/WP_Piwik/Admin/Settings.php:332
@@ -896,7 +896,7 @@ msgstr ""
896
 
897
  #: classes/WP_Piwik/Admin/Settings.php:335
898
  msgid ""
899
- "Choose if you want to explicitly force Piwik to use HTTP or HTTPS. Does not "
900
  "work with a CDN URL."
901
  msgstr ""
902
 
@@ -905,15 +905,15 @@ msgid "Update notice"
905
  msgstr ""
906
 
907
  #: classes/WP_Piwik/Admin/Settings.php:338
908
- msgid "Show always if WP-Piwik is updated"
909
  msgstr ""
910
 
911
  #: classes/WP_Piwik/Admin/Settings.php:339
912
- msgid "Show only if WP-Piwik is updated and settings were changed"
913
  msgstr ""
914
 
915
  #: classes/WP_Piwik/Admin/Settings.php:341
916
- msgid "Choose if you want to get an update notice if WP-Piwik is updated."
917
  msgstr ""
918
 
919
  #: classes/WP_Piwik/Admin/Settings.php:343
@@ -922,8 +922,8 @@ msgstr ""
922
 
923
  #: classes/WP_Piwik/Admin/Settings.php:343
924
  msgid ""
925
- "Replace Piwik's default file extensions for download tracking, divided by a "
926
- "vertical bar (&#124;). Leave blank to keep Piwik's default settings."
927
  msgstr ""
928
 
929
  #: classes/WP_Piwik/Admin/Settings.php:345
@@ -932,15 +932,15 @@ msgstr ""
932
 
933
  #: classes/WP_Piwik/Admin/Settings.php:345
934
  msgid ""
935
- "Set classes to be treated as downloads (in addition to piwik_download), "
936
- "divided by a vertical bar (&#124;). Leave blank to keep Piwik's default "
937
  "settings."
938
  msgstr ""
939
 
940
  #: classes/WP_Piwik/Admin/Settings.php:345
941
  #: classes/WP_Piwik/Admin/Settings.php:347
942
  #, php-format
943
- msgid "See %sPiwik JavaScript Tracking Client reference%s."
944
  msgstr ""
945
 
946
  #: classes/WP_Piwik/Admin/Settings.php:347
@@ -949,7 +949,7 @@ msgstr ""
949
 
950
  #: classes/WP_Piwik/Admin/Settings.php:347
951
  msgid ""
952
- "Set classes to be treated as outlinks (in addition to piwik_link), divided "
953
  "by a vertical bar (&#124;). Leave blank to keep Piwik's default settings."
954
  msgstr ""
955
 
@@ -958,7 +958,7 @@ msgid "Donate"
958
  msgstr ""
959
 
960
  #: classes/WP_Piwik/Admin/Settings.php:511
961
- msgid "If you like WP-Piwik, you can support its development by a donation:"
962
  msgstr ""
963
 
964
  #: classes/WP_Piwik/Admin/Settings.php:530
@@ -975,7 +975,7 @@ msgid "Thank you very much for your donation"
975
  msgstr ""
976
 
977
  #: classes/WP_Piwik/Admin/Settings.php:561
978
- msgid "the Piwik team itself"
979
  msgstr ""
980
 
981
  #: classes/WP_Piwik/Admin/Settings.php:561
@@ -1001,7 +1001,7 @@ msgstr ""
1001
  #: classes/WP_Piwik/Admin/Settings.php:564
1002
  msgid ""
1003
  "Thank you very much, all users who send me mails containing criticism, "
1004
- "commendation, feature requests and bug reports! You help me to make WP-Piwik "
1005
  "much better."
1006
  msgstr ""
1007
 
@@ -1016,7 +1016,7 @@ msgid "The best place to get help:"
1016
  msgstr ""
1017
 
1018
  #: classes/WP_Piwik/Admin/Settings.php:574
1019
- msgid "WP-Piwik support forum"
1020
  msgstr ""
1021
 
1022
  #: classes/WP_Piwik/Admin/Settings.php:577
@@ -1055,7 +1055,7 @@ msgid "is used."
1055
  msgstr ""
1056
 
1057
  #: classes/WP_Piwik/Admin/Settings.php:592
1058
- msgid "Determined Piwik base URL is"
1059
  msgstr ""
1060
 
1061
  #: classes/WP_Piwik/Admin/Settings.php:596
@@ -1079,7 +1079,7 @@ msgid "Are you sure you want to clear all settings?"
1079
  msgstr ""
1080
 
1081
  #: classes/WP_Piwik/Admin/Settings.php:601
1082
- msgid "Reset WP-Piwik"
1083
  msgstr ""
1084
 
1085
  #: classes/WP_Piwik/Admin/Settings.php:603
@@ -1119,7 +1119,7 @@ msgid "URL"
1119
  msgstr ""
1120
 
1121
  #: classes/WP_Piwik/Admin/Sitebrowser.php:37
1122
- msgid "Site ID (Piwik)"
1123
  msgstr ""
1124
 
1125
  #: classes/WP_Piwik/Admin/Sitebrowser.php:84
@@ -1143,15 +1143,15 @@ msgid "realpath() returns false"
1143
  msgstr ""
1144
 
1145
  #: classes/WP_Piwik/Request/Php.php:39
1146
- msgid "Class Piwik\\FrontController does not exists."
1147
  msgstr ""
1148
 
1149
  #: classes/WP_Piwik/Request/Php.php:42
1150
- msgid "Class Piwik\\API\\Request does not exists."
1151
  msgstr ""
1152
 
1153
  #: classes/WP_Piwik/Template/MetaBoxCustomVars.php:10
1154
- msgid "Piwik Custom Variables"
1155
  msgstr ""
1156
 
1157
  #: classes/WP_Piwik/Template/MetaBoxCustomVars.php:21
@@ -1180,7 +1180,7 @@ msgstr ""
1180
  #: classes/WP_Piwik/Widget/SystemDetails.php:33
1181
  #: classes/WP_Piwik/Widget/Systems.php:33
1182
  #: classes/WP_Piwik/Widget/Visitors.php:35
1183
- msgid "Piwik error"
1184
  msgstr ""
1185
 
1186
  #: classes/WP_Piwik/Widget.php:100
@@ -1513,6 +1513,21 @@ msgstr ""
1513
  #: wp-piwik.php:60
1514
  #, php-format
1515
  msgid ""
1516
- "WP-Piwik requires at least PHP 5.3. You are using the deprecated version %s. "
1517
- "Please update PHP to use WP-Piwik."
1518
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WP-Matomo 1.0.18\n"
4
  "POT-Creation-Date: 2017-10-09 20:37+0200\n"
5
  "MIME-Version: 1.0\n"
6
  "Content-Type: text/plain; charset=UTF-8\n"
12
  msgstr ""
13
 
14
  #: classes/WP_Piwik.php:203
15
+ msgid "Next you should connect to Matomo"
16
  msgstr ""
17
 
18
  #: classes/WP_Piwik.php:237
33
  msgstr ""
34
 
35
  #: classes/WP_Piwik.php:387 classes/WP_Piwik.php:409
36
+ msgid "Matomo Statistics"
37
  msgstr ""
38
 
39
  #: classes/WP_Piwik.php:499
40
+ msgid "Configure WP-Matomo"
41
  msgstr ""
42
 
43
  #: classes/WP_Piwik.php:992
61
  msgstr ""
62
 
63
  #: classes/WP_Piwik/Admin/Settings.php:55
64
+ msgid "Thanks for using WP-Matomo!"
65
  msgstr ""
66
 
67
  #: classes/WP_Piwik/Admin/Settings.php:58
68
  #, php-format
69
+ msgid "WP-Matomo %s is successfully connected to Matomo %s."
70
  msgstr ""
71
 
72
  #: classes/WP_Piwik/Admin/Settings.php:58
77
  #: classes/WP_Piwik/Admin/Settings.php:58
78
  #, php-format
79
  msgid ""
80
+ "You are running a WordPress %s blog network (WPMU). WP-Matomo will handle "
81
  "your sites as different websites."
82
  msgstr ""
83
 
84
  #: classes/WP_Piwik/Admin/Settings.php:62
85
  #, php-format
86
  msgid ""
87
+ "WP-Matomo %s was not able to connect to Matomo using your configuration. Check "
88
+ "the &raquo;Connect to Matomo&laquo; section below."
89
  msgstr ""
90
 
91
  #: classes/WP_Piwik/Admin/Settings.php:64
92
  #, php-format
93
  msgid ""
94
+ "WP-Matomo %s was not able to connect to Matomo using your configuration. "
95
  "During connection the following error occured: <br /><code>%s</code>"
96
  msgstr ""
97
 
98
  #: classes/WP_Piwik/Admin/Settings.php:67
99
  #, php-format
100
  msgid ""
101
+ "WP-Matomo %s has to be connected to Matomo first. Check the &raquo;Connect to "
102
+ "Matomo&laquo; section below."
103
  msgstr ""
104
 
105
  #: classes/WP_Piwik/Admin/Settings.php:71
106
+ msgid "Connect to Matomo"
107
  msgstr ""
108
 
109
  #: classes/WP_Piwik/Admin/Settings.php:76
124
 
125
  #: classes/WP_Piwik/Admin/Settings.php:106
126
  msgid ""
127
+ "WP-Matomo is a WordPress plugin to show a selection of Matomo stats in your "
128
+ "WordPress admin dashboard and to add and configure your Matomo tracking code. "
129
+ "To use this you will need your own Matomo instance. If you do not already "
130
+ "have a Matomo setup, you have two simple options: use either"
131
  msgstr ""
132
 
133
  #: classes/WP_Piwik/Admin/Settings.php:106
134
+ msgid "a self-hosted Matomo"
135
  msgstr ""
136
 
137
  #: classes/WP_Piwik/Admin/Settings.php:106
139
  msgstr ""
140
 
141
  #: classes/WP_Piwik/Admin/Settings.php:106
142
+ msgid "a cloud-hosted Matomo by InnoCraft"
143
  msgstr ""
144
 
145
  #: classes/WP_Piwik/Admin/Settings.php:109
146
  msgid ""
147
+ "Neither cURL nor fopen are available. So WP-Matomo can not use the HTTP API "
148
  "and not connect to InnoCraft Cloud."
149
  msgstr ""
150
 
164
 
165
  #: classes/WP_Piwik/Admin/Settings.php:111
166
  msgid ""
167
+ "This is the default option for a self-hosted Matomo and should work for most "
168
+ "configurations. WP-Matomo will connect to Matomo using http(s)."
169
  msgstr ""
170
 
171
  #: classes/WP_Piwik/Admin/Settings.php:111
175
 
176
  #: classes/WP_Piwik/Admin/Settings.php:111
177
  msgid ""
178
+ "Choose this, if your self-hosted Matomo and WordPress are running on the same "
179
+ "machine and you know the full server path to your Matomo instance."
180
  msgstr ""
181
 
182
  #: classes/WP_Piwik/Admin/Settings.php:111
186
 
187
  #: classes/WP_Piwik/Admin/Settings.php:111
188
  msgid ""
189
+ "If you are using a cloud-hosted Matomo by InnoCraft, you can simply use this "
190
  "option."
191
  msgstr ""
192
 
193
  #: classes/WP_Piwik/Admin/Settings.php:112
194
+ msgid "Matomo Mode"
195
  msgstr ""
196
 
197
  #: classes/WP_Piwik/Admin/Settings.php:113
198
+ msgid "Disabled (WP-Matomo will not connect to Matomo)"
199
  msgstr ""
200
 
201
  #: classes/WP_Piwik/Admin/Settings.php:119
202
+ msgid "Matomo URL"
203
  msgstr ""
204
 
205
  #: classes/WP_Piwik/Admin/Settings.php:119
206
  msgid ""
207
+ "Enter your Matomo URL. This is the same URL you use to access your Matomo "
208
+ "instance, e.g. http://www.example.com/matomo/."
209
  msgstr ""
210
 
211
  #: classes/WP_Piwik/Admin/Settings.php:120
212
+ msgid "Matomo path"
213
  msgstr ""
214
 
215
  #: classes/WP_Piwik/Admin/Settings.php:120
216
+ msgid "Enter the file path to your Matomo instance, e.g. /var/www/matomo/."
217
  msgstr ""
218
 
219
  #: classes/WP_Piwik/Admin/Settings.php:121
220
+ msgid "Matomo subdomain"
221
  msgstr ""
222
 
223
  #: classes/WP_Piwik/Admin/Settings.php:121
232
 
233
  #: classes/WP_Piwik/Admin/Settings.php:122
234
  msgid ""
235
+ "Enter your Matomo auth token here. It is an alphanumerical code like "
236
  "0a1b2c34d56e78901fa2bc3d45678efa."
237
  msgstr ""
238
 
239
  #: classes/WP_Piwik/Admin/Settings.php:122
240
  #, php-format
241
+ msgid "See %sWP-Matomo FAQ%s."
242
  msgstr ""
243
 
244
  #: classes/WP_Piwik/Admin/Settings.php:127
247
 
248
  #: classes/WP_Piwik/Admin/Settings.php:127
249
  msgid ""
250
+ "Check this to automatically choose your blog from your Matomo sites by URL. "
251
+ "If your blog is not added to Matomo yet, WP-Matomo will add a new site."
252
  msgstr ""
253
 
254
  #: classes/WP_Piwik/Admin/Settings.php:131
255
  #, php-format
256
  msgid ""
257
+ "WP-Matomo %s was not able to get sites with at least view access: <br /><code>"
258
  "%s</code>"
259
  msgstr ""
260
 
267
  msgstr ""
268
 
269
  #: classes/WP_Piwik/Admin/Settings.php:155
270
+ msgid "Matomo default date"
271
  msgstr ""
272
 
273
  #: classes/WP_Piwik/Admin/Settings.php:156
339
  msgstr ""
340
 
341
  #: classes/WP_Piwik/Admin/Settings.php:172
342
+ msgid "Enable WP-Matomo dashboard widget &quot;Overview&quot;."
343
  msgstr ""
344
 
345
  #: classes/WP_Piwik/Admin/Settings.php:174
347
  msgstr ""
348
 
349
  #: classes/WP_Piwik/Admin/Settings.php:174
350
+ msgid "Enable WP-Matomo dashboard widget &quot;Graph&quot;."
351
  msgstr ""
352
 
353
  #: classes/WP_Piwik/Admin/Settings.php:176
355
  msgstr ""
356
 
357
  #: classes/WP_Piwik/Admin/Settings.php:176
358
+ msgid "Enable WP-Matomo dashboard widget &quot;SEO&quot;."
359
  msgstr ""
360
 
361
  #: classes/WP_Piwik/Admin/Settings.php:178
363
  msgstr ""
364
 
365
  #: classes/WP_Piwik/Admin/Settings.php:178
366
+ msgid "Enable WP-Matomo dashboard widget &quot;E-commerce&quot;."
367
  msgstr ""
368
 
369
  #: classes/WP_Piwik/Admin/Settings.php:180
391
  msgstr ""
392
 
393
  #: classes/WP_Piwik/Admin/Settings.php:193
394
+ msgid "Matomo shortcut"
395
  msgstr ""
396
 
397
  #: classes/WP_Piwik/Admin/Settings.php:193
398
+ msgid "Display a shortcut to Matomo itself."
399
  msgstr ""
400
 
401
  #: classes/WP_Piwik/Admin/Settings.php:195
402
+ msgid "WP-Matomo display name"
403
  msgstr ""
404
 
405
  #: classes/WP_Piwik/Admin/Settings.php:195
420
 
421
  #: classes/WP_Piwik/Admin/Settings.php:208
422
  msgid ""
423
+ "WP-Matomo will not add the tracking code. Use this, if you want to add the "
424
  "tracking code to your template files or you use another plugin to add the "
425
  "tracking code."
426
  msgstr ""
431
  msgstr ""
432
 
433
  #: classes/WP_Piwik/Admin/Settings.php:208
434
+ msgid "WP-Matomo will use Matomo's standard tracking code."
435
  msgstr ""
436
 
437
  #: classes/WP_Piwik/Admin/Settings.php:208
442
  #: classes/WP_Piwik/Admin/Settings.php:208
443
  msgid ""
444
  "You can choose this tracking code, to deliver a minified proxy code and to "
445
+ "avoid using the files called matomo.js or matomo.php."
446
  msgstr ""
447
 
448
  #: classes/WP_Piwik/Admin/Settings.php:208
456
  msgstr ""
457
 
458
  #: classes/WP_Piwik/Admin/Settings.php:208
459
+ msgid "Use this tracking code to not reveal the Matomo server URL."
460
  msgstr ""
461
 
462
  #: classes/WP_Piwik/Admin/Settings.php:208
463
  #: classes/WP_Piwik/Admin/Settings.php:228
464
  #: classes/WP_Piwik/Admin/Settings.php:238
465
  #, php-format
466
+ msgid "See %sMatomo FAQ%s."
467
  msgstr ""
468
 
469
  #: classes/WP_Piwik/Admin/Settings.php:208
479
  msgstr ""
480
 
481
  #: classes/WP_Piwik/Admin/Settings.php:208
482
+ msgid "Use the placeholder {ID} to add the Matomo site ID."
483
  msgstr ""
484
 
485
  #: classes/WP_Piwik/Admin/Settings.php:209
560
  #: classes/WP_Piwik/Admin/Settings.php:278
561
  #: classes/WP_Piwik/Admin/Settings.php:343
562
  #, php-format
563
+ msgid "See %sMatomo documentation%s."
564
  msgstr ""
565
 
566
  #: classes/WP_Piwik/Admin/Settings.php:236
568
  msgstr ""
569
 
570
  #: classes/WP_Piwik/Admin/Settings.php:236
571
+ msgid "Use Matomo's advanced Site Search Analytics feature."
572
  msgstr ""
573
 
574
  #: classes/WP_Piwik/Admin/Settings.php:238
576
  msgstr ""
577
 
578
  #: classes/WP_Piwik/Admin/Settings.php:238
579
+ msgid "WP-Matomo can automatically add a 404-category to track 404-page-visits."
580
  msgstr ""
581
 
582
  #: classes/WP_Piwik/Admin/Settings.php:241
677
  "domain by default. When this feature is enabled, it will append a URL "
678
  "parameter \"pk_vid\" that contains the visitor ID when a user clicks on a "
679
  "URL that belongs to one of your domains. For this feature to work, you also "
680
+ "have to configure which domains should be treated as local in your Matomo "
681
+ "website settings. This feature requires Matomo 3.0.2."
682
  msgstr ""
683
 
684
  #: classes/WP_Piwik/Admin/Settings.php:276
694
  msgstr ""
695
 
696
  #: classes/WP_Piwik/Admin/Settings.php:278
697
+ msgid "This will add Matomo campaign parameters to the RSS feed links. "
698
  msgstr ""
699
 
700
  #: classes/WP_Piwik/Admin/Settings.php:280
713
  msgid ""
714
  "Enable a heartbeat timer to get more accurate visit lengths by sending "
715
  "periodical HTTP ping requests as long as the site is opened. Enter the time "
716
+ "between the pings in seconds (Matomo default: 15) to enable or 0 to disable "
717
  "this feature. <strong>Note:</strong> This will cause a lot of additional "
718
  "HTTP requests on your site."
719
  msgstr ""
775
 
776
  #: classes/WP_Piwik/Admin/Settings.php:303
777
  msgid ""
778
+ "Choose whether WP-Matomo should use cURL or fopen to connect to Matomo in HTTP "
779
  "or Cloud mode."
780
  msgstr ""
781
 
794
  msgstr ""
795
 
796
  #: classes/WP_Piwik/Admin/Settings.php:308
797
+ msgid "Choose whether WP-Matomo should use POST or GET in HTTP or Cloud mode."
798
  msgstr ""
799
 
800
  #: classes/WP_Piwik/Admin/Settings.php:310
848
 
849
  #: classes/WP_Piwik/Admin/Settings.php:323
850
  #, php-format
851
+ msgid "See %sMatomo Blog%s."
852
  msgstr ""
853
 
854
  #: classes/WP_Piwik/Admin/Settings.php:323
879
  msgstr ""
880
 
881
  #: classes/WP_Piwik/Admin/Settings.php:331
882
+ msgid "Force Matomo to use a specific protocol"
883
  msgstr ""
884
 
885
  #: classes/WP_Piwik/Admin/Settings.php:332
896
 
897
  #: classes/WP_Piwik/Admin/Settings.php:335
898
  msgid ""
899
+ "Choose if you want to explicitly force Matomo to use HTTP or HTTPS. Does not "
900
  "work with a CDN URL."
901
  msgstr ""
902
 
905
  msgstr ""
906
 
907
  #: classes/WP_Piwik/Admin/Settings.php:338
908
+ msgid "Show always if WP-Matomo is updated"
909
  msgstr ""
910
 
911
  #: classes/WP_Piwik/Admin/Settings.php:339
912
+ msgid "Show only if WP-Matomo is updated and settings were changed"
913
  msgstr ""
914
 
915
  #: classes/WP_Piwik/Admin/Settings.php:341
916
+ msgid "Choose if you want to get an update notice if WP-Matomo is updated."
917
  msgstr ""
918
 
919
  #: classes/WP_Piwik/Admin/Settings.php:343
922
 
923
  #: classes/WP_Piwik/Admin/Settings.php:343
924
  msgid ""
925
+ "Replace Matomo's default file extensions for download tracking, divided by a "
926
+ "vertical bar (&#124;). Leave blank to keep Matomo's default settings."
927
  msgstr ""
928
 
929
  #: classes/WP_Piwik/Admin/Settings.php:345
932
 
933
  #: classes/WP_Piwik/Admin/Settings.php:345
934
  msgid ""
935
+ "Set classes to be treated as downloads (in addition to matomo_download), "
936
+ "divided by a vertical bar (&#124;). Leave blank to keep Matomo's default "
937
  "settings."
938
  msgstr ""
939
 
940
  #: classes/WP_Piwik/Admin/Settings.php:345
941
  #: classes/WP_Piwik/Admin/Settings.php:347
942
  #, php-format
943
+ msgid "See %sMatomo JavaScript Tracking Client reference%s."
944
  msgstr ""
945
 
946
  #: classes/WP_Piwik/Admin/Settings.php:347
949
 
950
  #: classes/WP_Piwik/Admin/Settings.php:347
951
  msgid ""
952
+ "Set classes to be treated as outlinks (in addition to matomo_link), divided "
953
  "by a vertical bar (&#124;). Leave blank to keep Piwik's default settings."
954
  msgstr ""
955
 
958
  msgstr ""
959
 
960
  #: classes/WP_Piwik/Admin/Settings.php:511
961
+ msgid "If you like WP-Matomo, you can support its development by a donation:"
962
  msgstr ""
963
 
964
  #: classes/WP_Piwik/Admin/Settings.php:530
975
  msgstr ""
976
 
977
  #: classes/WP_Piwik/Admin/Settings.php:561
978
+ msgid "the Matomo team itself"
979
  msgstr ""
980
 
981
  #: classes/WP_Piwik/Admin/Settings.php:561
1001
  #: classes/WP_Piwik/Admin/Settings.php:564
1002
  msgid ""
1003
  "Thank you very much, all users who send me mails containing criticism, "
1004
+ "commendation, feature requests and bug reports! You help me to make WP-Matomo "
1005
  "much better."
1006
  msgstr ""
1007
 
1016
  msgstr ""
1017
 
1018
  #: classes/WP_Piwik/Admin/Settings.php:574
1019
+ msgid "WP-Matomo support forum"
1020
  msgstr ""
1021
 
1022
  #: classes/WP_Piwik/Admin/Settings.php:577
1055
  msgstr ""
1056
 
1057
  #: classes/WP_Piwik/Admin/Settings.php:592
1058
+ msgid "Determined Matomo base URL is"
1059
  msgstr ""
1060
 
1061
  #: classes/WP_Piwik/Admin/Settings.php:596
1079
  msgstr ""
1080
 
1081
  #: classes/WP_Piwik/Admin/Settings.php:601
1082
+ msgid "Reset WP-Matomo"
1083
  msgstr ""
1084
 
1085
  #: classes/WP_Piwik/Admin/Settings.php:603
1119
  msgstr ""
1120
 
1121
  #: classes/WP_Piwik/Admin/Sitebrowser.php:37
1122
+ msgid "Site ID (Matomo)"
1123
  msgstr ""
1124
 
1125
  #: classes/WP_Piwik/Admin/Sitebrowser.php:84
1143
  msgstr ""
1144
 
1145
  #: classes/WP_Piwik/Request/Php.php:39
1146
+ msgid "Class Matomo\\FrontController does not exists."
1147
  msgstr ""
1148
 
1149
  #: classes/WP_Piwik/Request/Php.php:42
1150
+ msgid "Class Matomo\\API\\Request does not exists."
1151
  msgstr ""
1152
 
1153
  #: classes/WP_Piwik/Template/MetaBoxCustomVars.php:10
1154
+ msgid "Matomo Custom Variables"
1155
  msgstr ""
1156
 
1157
  #: classes/WP_Piwik/Template/MetaBoxCustomVars.php:21
1180
  #: classes/WP_Piwik/Widget/SystemDetails.php:33
1181
  #: classes/WP_Piwik/Widget/Systems.php:33
1182
  #: classes/WP_Piwik/Widget/Visitors.php:35
1183
+ msgid "Matomo error"
1184
  msgstr ""
1185
 
1186
  #: classes/WP_Piwik/Widget.php:100
1513
  #: wp-piwik.php:60
1514
  #, php-format
1515
  msgid ""
1516
+ "WP-Matomo requires at least PHP 5.3. You are using the deprecated version %s. "
1517
+ "Please update PHP to use WP-Matomo."
1518
  msgstr ""
1519
+
1520
+ msgid "City"
1521
+ msgstr ""
1522
+
1523
+ msgid "Models"
1524
+ msgstr ""
1525
+
1526
+ msgid "Model"
1527
+ msgstr ""
1528
+
1529
+ msgid "Types"
1530
+ msgstr ""
1531
+
1532
+ msgid "Type"
1533
+ msgstr ""
logs/.htaccess CHANGED
File without changes
proxy/config.php CHANGED
@@ -1,36 +1,39 @@
1
- <?php
2
- $wpRootDir = isset($wpRootDir)?$wpRootDir:'../../../../';
3
- require ($wpRootDir.'wp-load.php');
4
-
5
- require_once ('../classes/WP_Piwik/Settings.php');
6
- require_once ('../classes/WP_Piwik/Logger.php');
7
- require_once ('../classes/WP_Piwik/Logger/Dummy.php');
8
-
9
- $logger = new WP_Piwik\Logger\Dummy ( __CLASS__ );
10
- $settings = new WP_Piwik\Settings ( $logger );
11
-
12
- $protocol = (isset ( $_SERVER ['HTTPS'] ) && $_SERVER ['HTTPS'] != 'off') ? 'https' : 'http';
13
-
14
- switch ($settings->getGlobalOption ( 'piwik_mode' )) {
15
- case 'php' :
16
- $PIWIK_URL = $protocol . ':' . $settings->getGlobalOption ( 'proxy_url' );
17
- break;
18
- case 'cloud' :
19
- $PIWIK_URL = 'https://' . $settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud/';
20
- break;
21
- default :
22
- $PIWIK_URL = $settings->getGlobalOption ( 'piwik_url' );
23
- }
24
-
25
- if (substr ( $PIWIK_URL, 0, 2 ) == '//')
26
- $PIWIK_URL = (isset ( $_SERVER ['HTTPS'] ) ? 'https:' : 'http:') . $PIWIK_URL;
27
-
28
- $TOKEN_AUTH = $settings->getGlobalOption ( 'piwik_token' );
29
- $timeout = $settings->getGlobalOption ( 'connection_timeout' );
30
- $useCurl = (
31
- (function_exists('curl_init') && ini_get('allow_url_fopen') && $settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen'))
32
- );
33
-
34
- $settings->getGlobalOption ( 'http_connection' );
35
-
 
 
 
36
  ini_set ( 'display_errors', 0 );
1
+ <?php
2
+ $wpRootDir = isset($wpRootDir)?$wpRootDir:'../../../../';
3
+ require ($wpRootDir.'wp-load.php');
4
+
5
+ require_once ('../classes/WP_Piwik/Settings.php');
6
+ require_once ('../classes/WP_Piwik/Logger.php');
7
+ require_once ('../classes/WP_Piwik/Logger/Dummy.php');
8
+
9
+ $logger = new WP_Piwik\Logger\Dummy ( __CLASS__ );
10
+ $settings = new WP_Piwik\Settings ( $logger );
11
+
12
+ $protocol = (isset ( $_SERVER ['HTTPS'] ) && $_SERVER ['HTTPS'] != 'off') ? 'https' : 'http';
13
+
14
+ switch ($settings->getGlobalOption ( 'piwik_mode' )) {
15
+ case 'php' :
16
+ $PIWIK_URL = $protocol . ':' . $settings->getGlobalOption ( 'proxy_url' );
17
+ break;
18
+ case 'cloud' :
19
+ $PIWIK_URL = 'https://' . $settings->getGlobalOption ( 'piwik_user' ) . '.innocraft.cloud/';
20
+ break;
21
+ case 'cloud-matomo' :
22
+ $PIWIK_URL = 'https://' . $settings->getGlobalOption ( 'matomo_user' ) . '.matomo.cloud/';
23
+ break;
24
+ default :
25
+ $PIWIK_URL = $settings->getGlobalOption ( 'piwik_url' );
26
+ }
27
+
28
+ if (substr ( $PIWIK_URL, 0, 2 ) == '//')
29
+ $PIWIK_URL = (isset ( $_SERVER ['HTTPS'] ) ? 'https:' : 'http:') . $PIWIK_URL;
30
+
31
+ $TOKEN_AUTH = $settings->getGlobalOption ( 'piwik_token' );
32
+ $timeout = $settings->getGlobalOption ( 'connection_timeout' );
33
+ $useCurl = (
34
+ (function_exists('curl_init') && ini_get('allow_url_fopen') && $settings->getGlobalOption('http_connection') == 'curl') || (function_exists('curl_init') && !ini_get('allow_url_fopen'))
35
+ );
36
+
37
+ $settings->getGlobalOption ( 'http_connection' );
38
+
39
  ini_set ( 'display_errors', 0 );
proxy/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
  // Nothing to see...
1
+ <?php
2
  // Nothing to see...
proxy/piwik.php CHANGED
File without changes
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
 
3
  Contributors: Braekling
4
  Requires at least: 4.0
5
- Tested up to: 4.8.2
6
- Stable tag: 1.0.19
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
8
  Tags: matomo, tracking, statistics, stats, analytics
9
 
@@ -15,7 +15,7 @@ This plugin uses the Matomo API to show your Matomo statistics in your WordPress
15
 
16
  To use this plugin the Matomo web analytics application is required. If you do not already have a Matomo setup (e.g., provided by your web hosting service), you have two simple options: use either a [self-hosted Matomo](http://matomo.org/) or a [cloud-hosted Matomo by InnoCraft](https://www.innocraft.cloud/?pk_campaign=WP-Piwik).
17
 
18
- **Requirements:** PHP 7.0 (or higher), WordPress 4.0 (or higher), Matomo 3.0 (or higher)
19
 
20
  **Languages:** English, Albanian, Chinese, Dutch, French, German, Greek, Hungarian, Italian, Polish, Portuguese (Brazil). Partially supported: Azerbaijani, Belarusian, Hindi, Lithuanian, Luxembourgish, Norwegian, Persian, Romanian, Russian, Spanish, Swedish, Turkish, Ukrainian
21
 
@@ -47,8 +47,8 @@ is equal to *[wp-piwik module="overview" title="" period="day" date="yesterday"]
47
  = Credits =
48
 
49
  * Graphs powered by [jqPlot](http://www.jqplot.com/) (GPL 2.0 and MIT) and and [jQuery Sparklines](http://omnipotent.net/jquery.sparkline/) (New BSD License).
50
- * All translators at the [Transifex translation community](https://www.transifex.com/projects/p/wp-piwik/).
51
- * Donations: Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., the Matomo team itself, and all people flattering this.
52
  * All users who send me mails containing criticism, commendation, feature requests and bug reports - you help me to make WP-Matomo much better!
53
 
54
  Thank you all!
@@ -78,7 +78,7 @@ The Compatibility Checker shows two false positives. WP-Matomo is 100% PHP7 comp
78
 
79
  = Overview shortcode shows no unique visitors using a yearly range. =
80
 
81
- See [Matomo FAQ](http://matomo.org/faq/how-to/#faq_113).
82
 
83
  = WP-Matomo only shows the first 100 sites of my multisite network. How can I get all other sites? =
84
 
@@ -141,6 +141,12 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
141
 
142
  == Changelog ==
143
 
 
 
 
 
 
 
144
  = 1.0.19 =
145
  * Security fix: Escape request var
146
  * Language updates
@@ -236,7 +242,7 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
236
  = 1.0.3 =
237
  * Several language updates.
238
  * Switch to JSON renderer (Matomo 3 compatibility preparation)
239
- * Workaround: PHP API will work with Matomo 2.14+, see https://github.com/matomo-org/piwik/issues/8311 for further information.
240
  * Feature: Heartbeat timer support
241
  * Feature: Expanded token & URL/path input fields
242
  * Bugfix: Site duplication fix.
@@ -399,7 +405,7 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
399
 
400
  = 0.9.9.4 =
401
  * Use Transients API (one week caching)
402
- * Option: Track visitors without JavaScript, see http://matomo.org/faq/how-to/#faq_176
403
 
404
  = 0.9.9.3 =
405
  * Sparkline script update (IE 10 compatibility)
@@ -429,7 +435,7 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
429
 
430
  = 0.9.8 =
431
  * WordPress 3.5 compatibility fix: http://wordpress.org/support/topic/v35-errors-fix?replies=5 (Thanks Christian Foellmann!)
432
- * Advanced Search Result Analytics, see http://matomo.org/docs/javascript-tracking/#toc-tracking-internal-search-keywords-categories-and-no-result-search-keywords
433
  * Site Search stats added
434
  * Use js/index.php: Replaces piwik.js and piwik.php by js/ (instead of piwik.js only)
435
  * Connection timeout setting added
@@ -437,7 +443,7 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
437
  * Uninstall script added
438
  * Stats metaboxes: Date formatted
439
  * Use proxy settings defined in wp-config.php
440
- * Matomo.php proxy script added (see http://matomo.org/faq/how-to/#faq_132)
441
  * Bugfix: After upgrade, Matomo automatically places cookies again (http://wordpress.org/support/topic/after-upgrade-piwik-automatically-places-cookies-again)
442
 
443
  = 0.9.7 =
@@ -463,7 +469,7 @@ Add WP-Matomo to your /wp-content/plugins folder and enable it as [Network Plugi
463
  * Bugfix: Sparkline script only loaded if required
464
  * Stats site supports up to 3 columns
465
  * Network admin stats: Choose site using a paged table (instead of a select box).
466
- * Feature: [Custom variables](http://matomo.org/docs/javascript-tracking/#toc-custom-variables), using [custom post meta boxes](http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/).
467
  * Some minor bugfixes
468
 
469
  = 0.9.5 =
2
 
3
  Contributors: Braekling
4
  Requires at least: 4.0
5
+ Tested up to: 5.1.1
6
+ Stable tag: 1.0.21
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
8
  Tags: matomo, tracking, statistics, stats, analytics
9
 
15
 
16
  To use this plugin the Matomo web analytics application is required. If you do not already have a Matomo setup (e.g., provided by your web hosting service), you have two simple options: use either a [self-hosted Matomo](http://matomo.org/) or a [cloud-hosted Matomo by InnoCraft](https://www.innocraft.cloud/?pk_campaign=WP-Piwik).
17
 
18
+ **Requirements:** PHP 7.0 (or higher), WordPress 5.0 (or higher), Matomo 3.0 (or higher)
19
 
20
  **Languages:** English, Albanian, Chinese, Dutch, French, German, Greek, Hungarian, Italian, Polish, Portuguese (Brazil). Partially supported: Azerbaijani, Belarusian, Hindi, Lithuanian, Luxembourgish, Norwegian, Persian, Romanian, Russian, Spanish, Swedish, Turkish, Ukrainian
21
 
47
  = Credits =
48
 
49
  * Graphs powered by [jqPlot](http://www.jqplot.com/) (GPL 2.0 and MIT) and and [jQuery Sparklines](http://omnipotent.net/jquery.sparkline/) (New BSD License).
50
+ * All translators at Transifex and WordPress.
51
+ * Donations: Marco L., Rolf W., Tobias U., Lars K., Donna F., Kevin D., Ramos S., Thomas M., John C., Andreas G., Ben M., Myra R. I., Carlos U. R.-S., Oleg I., M. N., Daniel K., James L., Jochen K., Cyril P., Thomas K., Patrik K., Zach, Sebastian W., Peakkom, Patrik K., Kati K., Helmut O., Valerie S., Jochen D., Atlas R., Harald W., Jan M., Addy K., Hans-Georg E.-B., Yvonne K., Andrew D., Nicolas, J., Andre M., Steve J., Jakub P., ditho.berlin, Robert R., Simon B., Grzegorz O., the Matomo team itself, and all people flattering this.
52
  * All users who send me mails containing criticism, commendation, feature requests and bug reports - you help me to make WP-Matomo much better!
53
 
54
  Thank you all!
78
 
79
  = Overview shortcode shows no unique visitors using a yearly range. =
80
 
81
+ See [Matomo FAQ](http://piwik.org/faq/how-to/#faq_113).
82
 
83
  = WP-Matomo only shows the first 100 sites of my multisite network. How can I get all other sites? =
84
 
141
 
142
  == Changelog ==
143
 
144
+ = 1.0.20 =
145
+ * Support for new Innocraft cloud URL (*.matomo.cloud)
146
+ * Changed naming from Piwik to Matomo
147
+ * Added City, Type and Model views
148
+ * Bugfix: Avoid warnings on empty results
149
+
150
  = 1.0.19 =
151
  * Security fix: Escape request var
152
  * Language updates
242
  = 1.0.3 =
243
  * Several language updates.
244
  * Switch to JSON renderer (Matomo 3 compatibility preparation)
245
+ * Workaround: PHP API will work with Matomo 2.14+, see https://github.com/piwik/piwik/issues/8311 for further information.
246
  * Feature: Heartbeat timer support
247
  * Feature: Expanded token & URL/path input fields
248
  * Bugfix: Site duplication fix.
405
 
406
  = 0.9.9.4 =
407
  * Use Transients API (one week caching)
408
+ * Option: Track visitors without JavaScript, see http://piwik.org/faq/how-to/#faq_176
409
 
410
  = 0.9.9.3 =
411
  * Sparkline script update (IE 10 compatibility)
435
 
436
  = 0.9.8 =
437
  * WordPress 3.5 compatibility fix: http://wordpress.org/support/topic/v35-errors-fix?replies=5 (Thanks Christian Foellmann!)
438
+ * Advanced Search Result Analytics, see http://piwik.org/docs/javascript-tracking/#toc-tracking-internal-search-keywords-categories-and-no-result-search-keywords
439
  * Site Search stats added
440
  * Use js/index.php: Replaces piwik.js and piwik.php by js/ (instead of piwik.js only)
441
  * Connection timeout setting added
443
  * Uninstall script added
444
  * Stats metaboxes: Date formatted
445
  * Use proxy settings defined in wp-config.php
446
+ * Matomo.php proxy script added (see http://piwik.org/faq/how-to/#faq_132)
447
  * Bugfix: After upgrade, Matomo automatically places cookies again (http://wordpress.org/support/topic/after-upgrade-piwik-automatically-places-cookies-again)
448
 
449
  = 0.9.7 =
469
  * Bugfix: Sparkline script only loaded if required
470
  * Stats site supports up to 3 columns
471
  * Network admin stats: Choose site using a paged table (instead of a select box).
472
+ * Feature: [Custom variables](http://piwik.org/docs/javascript-tracking/#toc-custom-variables), using [custom post meta boxes](http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/).
473
  * Some minor bugfixes
474
 
475
  = 0.9.5 =
screenshot-1.gif CHANGED
File without changes
screenshot-2.gif CHANGED
File without changes
screenshot-3.gif CHANGED
File without changes
screenshot-4.gif CHANGED
File without changes
screenshot-5.gif CHANGED
File without changes
uninstall.php CHANGED
@@ -11,6 +11,7 @@ $globalSettings = array(
11
  'piwik_url',
12
  'piwik_path',
13
  'piwik_user',
 
14
  'piwik_token',
15
  'auto_site_config',
16
  'default_date',
11
  'piwik_url',
12
  'piwik_path',
13
  'piwik_user',
14
+ 'matomo_user',
15
  'piwik_token',
16
  'auto_site_config',
17
  'default_date',
update/.htaccess CHANGED
File without changes
update/2015051101.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
-
3
- // Get & delete old version's options
4
- if (self::$settings->checkNetworkActivation ()) {
5
- $oldGlobalOptions = get_site_option ( 'wp-piwik_global-settings', array () );
6
- delete_site_option('wp-piwik_global-settings');
7
- } else {
8
- $oldGlobalOptions = get_option ( 'wp-piwik_global-settings', array () );
9
- delete_option('wp-piwik_global-settings');
10
- }
11
-
12
- $oldOptions = get_option ( 'wp-piwik_settings', array () );
13
- delete_option('wp-piwik_settings');
14
-
15
- if (self::$settings->checkNetworkActivation ()) {
16
- global $wpdb;
17
- $aryBlogs = \WP_Piwik\Settings::getBlogList();
18
- if (is_array($aryBlogs))
19
- foreach ($aryBlogs as $aryBlog) {
20
- $oldOptions = get_blog_option ( $aryBlog['blog_id'], 'wp-piwik_settings', array () );
21
- if (!$this->isConfigured())
22
- foreach ( $oldOptions as $key => $value )
23
- self::$settings->setOption ( $key, $value, $aryBlog['blog_id'] );
24
- delete_blog_option($aryBlog['blog_id'], 'wp-piwik_settings');
25
- }
26
- }
27
-
28
- if (!$this->isConfigured()) {
29
- if (!$oldGlobalOptions['add_tracking_code']) $oldGlobalOptions['track_mode'] = 'disabled';
30
- elseif (!$oldGlobalOptions['track_mode']) $oldGlobalOptions['track_mode'] = 'default';
31
- elseif ($oldGlobalOptions['track_mode'] == 1) $oldGlobalOptions['track_mode'] = 'js';
32
- elseif ($oldGlobalOptions['track_mode'] == 2) $oldGlobalOptions['track_mode'] = 'proxy';
33
-
34
- // Store old values in new settings
35
- foreach ( $oldGlobalOptions as $key => $value )
36
- self::$settings->setGlobalOption ( $key, $value );
37
- foreach ( $oldOptions as $key => $value )
38
- self::$settings->setOption ( $key, $value );
39
- }
40
-
41
  self::$settings->save ();
1
+ <?php
2
+
3
+ // Get & delete old version's options
4
+ if (self::$settings->checkNetworkActivation ()) {
5
+ $oldGlobalOptions = get_site_option ( 'wp-piwik_global-settings', array () );
6
+ delete_site_option('wp-piwik_global-settings');
7
+ } else {
8
+ $oldGlobalOptions = get_option ( 'wp-piwik_global-settings', array () );
9
+ delete_option('wp-piwik_global-settings');
10
+ }
11
+
12
+ $oldOptions = get_option ( 'wp-piwik_settings', array () );
13
+ delete_option('wp-piwik_settings');
14
+
15
+ if (self::$settings->checkNetworkActivation ()) {
16
+ global $wpdb;
17
+ $aryBlogs = \WP_Piwik\Settings::getBlogList();
18
+ if (is_array($aryBlogs))
19
+ foreach ($aryBlogs as $aryBlog) {
20
+ $oldOptions = get_blog_option ( $aryBlog['blog_id'], 'wp-piwik_settings', array () );
21
+ if (!$this->isConfigured())
22
+ foreach ( $oldOptions as $key => $value )
23
+ self::$settings->setOption ( $key, $value, $aryBlog['blog_id'] );
24
+ delete_blog_option($aryBlog['blog_id'], 'wp-piwik_settings');
25
+ }
26
+ }
27
+
28
+ if (!$this->isConfigured()) {
29
+ if (!$oldGlobalOptions['add_tracking_code']) $oldGlobalOptions['track_mode'] = 'disabled';
30
+ elseif (!$oldGlobalOptions['track_mode']) $oldGlobalOptions['track_mode'] = 'default';
31
+ elseif ($oldGlobalOptions['track_mode'] == 1) $oldGlobalOptions['track_mode'] = 'js';
32
+ elseif ($oldGlobalOptions['track_mode'] == 2) $oldGlobalOptions['track_mode'] = 'proxy';
33
+
34
+ // Store old values in new settings
35
+ foreach ( $oldGlobalOptions as $key => $value )
36
+ self::$settings->setGlobalOption ( $key, $value );
37
+ foreach ( $oldOptions as $key => $value )
38
+ self::$settings->setOption ( $key, $value );
39
+ }
40
+
41
  self::$settings->save ();
update/2017080701.php CHANGED
File without changes
update/90001.php CHANGED
@@ -1,9 +1,9 @@
1
- <?php
2
- $aryWPMUConfig = get_site_option ( 'wpmu-piwik_global-settings', false );
3
- if (self::$settings->checkNetworkActivation () && $aryWPMUConfig) {
4
- foreach ( $aryWPMUConfig as $key => $value )
5
- self::$settings->setGlobalOption ( $key, $value );
6
- delete_site_option ( 'wpmu-piwik_global-settings' );
7
- self::$settings->setGlobalOption ( 'auto_site_config', true );
8
- } else
9
  self::$settings->setGlobalOption ( 'auto_site_config', false );
1
+ <?php
2
+ $aryWPMUConfig = get_site_option ( 'wpmu-piwik_global-settings', false );
3
+ if (self::$settings->checkNetworkActivation () && $aryWPMUConfig) {
4
+ foreach ( $aryWPMUConfig as $key => $value )
5
+ self::$settings->setGlobalOption ( $key, $value );
6
+ delete_site_option ( 'wpmu-piwik_global-settings' );
7
+ self::$settings->setGlobalOption ( 'auto_site_config', true );
8
+ } else
9
  self::$settings->setGlobalOption ( 'auto_site_config', false );
update/90801.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
- if (self::$settings->getGlobalOption ( 'track_compress' ))
3
- self::$settings->setGlobalOption ( 'track_mode', 1 );
4
- else
5
  self::$settings->setGlobalOption ( 'track_mode', 0 );
1
+ <?php
2
+ if (self::$settings->getGlobalOption ( 'track_compress' ))
3
+ self::$settings->setGlobalOption ( 'track_mode', 1 );
4
+ else
5
  self::$settings->setGlobalOption ( 'track_mode', 0 );
update/91006.php CHANGED
@@ -1,10 +1,10 @@
1
- <?php
2
- $aryRemoveOptions = array (
3
- 'wp-piwik_siteid',
4
- 'wp-piwik_404',
5
- 'wp-piwik_scriptupdate',
6
- 'wp-piwik_dashboardid',
7
- 'wp-piwik_jscode'
8
- );
9
- foreach ( $aryRemoveOptions as $strRemoveOption )
10
  delete_option ( $strRemoveOption );
1
+ <?php
2
+ $aryRemoveOptions = array (
3
+ 'wp-piwik_siteid',
4
+ 'wp-piwik_404',
5
+ 'wp-piwik_scriptupdate',
6
+ 'wp-piwik_dashboardid',
7
+ 'wp-piwik_jscode'
8
+ );
9
+ foreach ( $aryRemoveOptions as $strRemoveOption )
10
  delete_option ( $strRemoveOption );
wp-piwik.php CHANGED
@@ -1,83 +1,83 @@
1
- <?php
2
- /*
3
- Plugin Name: WP-Piwik
4
-
5
- Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
6
-
7
- Description: Adds Piwik statistics to your WordPress dashboard and is also able to add the Piwik Tracking Code to your blog.
8
-
9
- Version: 1.0.19
10
- Author: Andr&eacute; Br&auml;kling
11
- Author URI: http://www.braekling.de
12
- Text Domain: wp-piwik
13
- Domain Path: /languages
14
- License: GPL3
15
-
16
- ******************************************************************************************
17
- Copyright (C) 2009-today Andre Braekling (email: webmaster@braekling.de)
18
-
19
- This program is free software: you can redistribute it and/or modify
20
- it under the terms of the GNU General Public License as published by
21
- the Free Software Foundation, either version 3 of the License, or
22
- at your option) any later version.
23
-
24
- This program is distributed in the hope that it will be useful,
25
- but WITHOUT ANY WARRANTY; without even the implied warranty of
26
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
- GNU General Public License for more details.
28
-
29
- You should have received a copy of the GNU General Public License
30
- along with this program. If not, see <http://www.gnu.org/licenses/>.
31
- *******************************************************************************************/
32
-
33
- if (! function_exists ( 'add_action' )) {
34
- header ( 'Status: 403 Forbidden' );
35
- header ( 'HTTP/1.1 403 Forbidden' );
36
- exit ();
37
- }
38
-
39
- if (! defined ( 'NAMESPACE_SEPARATOR' ))
40
- define ( 'NAMESPACE_SEPARATOR', '\\' );
41
-
42
- /**
43
- * Define WP-Piwik autoloader
44
- *
45
- * @param string $class
46
- * class name
47
- */
48
- function wp_piwik_autoloader($class) {
49
- if (substr ( $class, 0, 9 ) == 'WP_Piwik' . NAMESPACE_SEPARATOR) {
50
- $class = str_replace ( '.', '', str_replace ( NAMESPACE_SEPARATOR, DIRECTORY_SEPARATOR, substr ( $class, 9 ) ) );
51
- require_once ('classes' . DIRECTORY_SEPARATOR . 'WP_Piwik' . DIRECTORY_SEPARATOR . $class . '.php');
52
- }
53
- }
54
-
55
- /**
56
- * Show notice about outdated PHP version
57
- */
58
- function wp_piwik_phperror() {
59
- echo '<div class="error"><p>';
60
- printf ( __ ( 'WP-Piwik requires at least PHP 5.3. You are using the deprecated version %s. Please update PHP to use WP-Piwik.', 'wp-piwik' ), PHP_VERSION );
61
- echo '</p></div>';
62
- }
63
-
64
- function wp_piwik_load_textdomain() {
65
- load_plugin_textdomain( 'wp-piwik', false, plugin_basename( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR );
66
- }
67
- add_action( 'plugins_loaded', 'wp_piwik_load_textdomain' );
68
-
69
- if (version_compare ( PHP_VERSION, '5.3.0', '<' ))
70
- add_action ( 'admin_notices', 'wp_piwik_phperror' );
71
- else {
72
- define ( 'WP_PIWIK_PATH', dirname ( __FILE__ ) . DIRECTORY_SEPARATOR );
73
- require_once (WP_PIWIK_PATH . 'config.php');
74
- require_once (WP_PIWIK_PATH . 'classes' . DIRECTORY_SEPARATOR . 'WP_Piwik.php');
75
- spl_autoload_register ( 'wp_piwik_autoloader' );
76
- $GLOBALS ['wp-piwik_debug'] = false;
77
- if (class_exists ( 'WP_Piwik' ))
78
- add_action( 'init', 'wp_piwik_loader' );
79
- }
80
-
81
- function wp_piwik_loader() {
82
- $GLOBALS ['wp-piwik'] = new WP_Piwik ();
83
- }
1
+ <?php
2
+ /*
3
+ Plugin Name: WP-Matomo
4
+
5
+ Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
6
+
7
+ Description: Adds Matomo statistics to your WordPress dashboard and is also able to add the Matomo Tracking Code to your blog.
8
+
9
+ Version: 1.0.20
10
+ Author: Andr&eacute; Br&auml;kling
11
+ Author URI: http://www.braekling.de
12
+ Text Domain: wp-piwik
13
+ Domain Path: /languages
14
+ License: GPL3
15
+
16
+ ******************************************************************************************
17
+ Copyright (C) 2009-today Andre Braekling (email: webmaster@braekling.de)
18
+
19
+ This program is free software: you can redistribute it and/or modify
20
+ it under the terms of the GNU General Public License as published by
21
+ the Free Software Foundation, either version 3 of the License, or
22
+ at your option) any later version.
23
+
24
+ This program is distributed in the hope that it will be useful,
25
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
+ GNU General Public License for more details.
28
+
29
+ You should have received a copy of the GNU General Public License
30
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
31
+ *******************************************************************************************/
32
+
33
+ if (! function_exists ( 'add_action' )) {
34
+ header ( 'Status: 403 Forbidden' );
35
+ header ( 'HTTP/1.1 403 Forbidden' );
36
+ exit ();
37
+ }
38
+
39
+ if (! defined ( 'NAMESPACE_SEPARATOR' ))
40
+ define ( 'NAMESPACE_SEPARATOR', '\\' );
41
+
42
+ /**
43
+ * Define WP-Piwik autoloader
44
+ *
45
+ * @param string $class
46
+ * class name
47
+ */
48
+ function wp_piwik_autoloader($class) {
49
+ if (substr ( $class, 0, 9 ) == 'WP_Piwik' . NAMESPACE_SEPARATOR) {
50
+ $class = str_replace ( '.', '', str_replace ( NAMESPACE_SEPARATOR, DIRECTORY_SEPARATOR, substr ( $class, 9 ) ) );
51
+ require_once ('classes' . DIRECTORY_SEPARATOR . 'WP_Piwik' . DIRECTORY_SEPARATOR . $class . '.php');
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Show notice about outdated PHP version
57
+ */
58
+ function wp_piwik_phperror() {
59
+ echo '<div class="error"><p>';
60
+ printf ( __ ( 'WP-Piwik requires at least PHP 5.3. You are using the deprecated version %s. Please update PHP to use WP-Piwik.', 'wp-piwik' ), PHP_VERSION );
61
+ echo '</p></div>';
62
+ }
63
+
64
+ function wp_piwik_load_textdomain() {
65
+ load_plugin_textdomain( 'wp-piwik', false, plugin_basename( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'languages' . DIRECTORY_SEPARATOR );
66
+ }
67
+ add_action( 'plugins_loaded', 'wp_piwik_load_textdomain' );
68
+
69
+ if (version_compare ( PHP_VERSION, '5.3.0', '<' ))
70
+ add_action ( 'admin_notices', 'wp_piwik_phperror' );
71
+ else {
72
+ define ( 'WP_PIWIK_PATH', dirname ( __FILE__ ) . DIRECTORY_SEPARATOR );
73
+ require_once (WP_PIWIK_PATH . 'config.php');
74
+ require_once (WP_PIWIK_PATH . 'classes' . DIRECTORY_SEPARATOR . 'WP_Piwik.php');
75
+ spl_autoload_register ( 'wp_piwik_autoloader' );
76
+ $GLOBALS ['wp-piwik_debug'] = false;
77
+ if (class_exists ( 'WP_Piwik' ))
78
+ add_action( 'init', 'wp_piwik_loader' );
79
+ }
80
+
81
+ function wp_piwik_loader() {
82
+ $GLOBALS ['wp-piwik'] = new WP_Piwik ();
83
+ }
wpml-config.xml CHANGED
File without changes