Simple History - Version 3.1.0

Version Description

(January 2022) =

  • Fixed: Use user selected language instead of selected site language when loading languages for JavaScript libraries. (#232)
  • Fixed: Theme deletions are now logged again. (#266)
  • Fixed: Theme installs are now logged again. (#265)
  • Fixed: Plugin deletions are now logged again. (#247, #122)
  • Fixed: Images and other attachments are now logged correctly when being inserted in the Block Editor.
  • Fixed: Some PHP notice messages in post logger.
  • Updated: JavaScript library TimeAgo updated to 1.6.7 from 1.6.3.
  • Added: Log when an admin verifies that the site admin adress is valid using the Site Admin Email Verification Screen that was added in WordPress 5.3. (#194, #225)
  • Added: Option "All days" to date range filter dropdown. (#196)
  • Added: Media and other attachments now display the post they were uploaded to, if any. (#274)
  • Added: Add class static variables $dbtable and $dbtable_contexts that contain full db name (existing class constants DBTABLE and DBTABLE_CONTEXTS needed to be prefixed manually).
  • Added: Plugin installs now save required version of PHP and WordPress.
  • Changed: Plugin install source is now assumed to be "web" by default.
  • Changed: Attachment updates are no longer logged from post logger since the media/attachment logger takes care of it.
  • Changed: Function sh_d() now does not escape output when running from CLI.
  • Removed: Plugin source files-listing removed from plugin installs, because the listing was incomplete, plus some more fields that no longer were able to get meaninful values (plugin rating, number or ratings, etc.).
Download this release

Release Info

Developer eskapism
Plugin Icon 128x128 Simple History
Version 3.1.0
Comparing to
See all releases

Code changes from version 3.0.0 to 3.1.0

Files changed (88) hide show
  1. code.md +0 -45
  2. codeception.dist.yml +20 -0
  3. composer.json +0 -46
  4. composer.lock +0 -342
  5. docker-compose.yml +83 -0
  6. dropins/SimpleHistoryFilterDropin.php +12 -5
  7. gruntfile.js +0 -162
  8. inc/SimpleHistory.php +20 -9
  9. inc/SimpleHistoryLogQuery.php +11 -8
  10. inc/helpers.php +3 -1
  11. index.php +2 -2
  12. js/timeago/jquery.timeago.js +143 -126
  13. js/timeago/locales/jquery.timeago.af.js +30 -20
  14. js/timeago/locales/jquery.timeago.am.js +30 -0
  15. js/timeago/locales/jquery.timeago.ar.js +144 -88
  16. js/timeago/locales/jquery.timeago.az-short.js +30 -0
  17. js/timeago/locales/jquery.timeago.az.js +30 -0
  18. js/timeago/locales/jquery.timeago.be.js +53 -0
  19. js/timeago/locales/jquery.timeago.bg.js +28 -18
  20. js/timeago/locales/jquery.timeago.bs.js +19 -14
  21. js/timeago/locales/jquery.timeago.ca.js +30 -18
  22. js/timeago/locales/jquery.timeago.cs.js +55 -23
  23. js/timeago/locales/jquery.timeago.cy.js +30 -20
  24. js/timeago/locales/jquery.timeago.da.js +28 -18
  25. js/timeago/locales/jquery.timeago.de-short.js +30 -0
  26. js/timeago/locales/jquery.timeago.de.js +28 -18
  27. js/timeago/locales/jquery.timeago.dv.js +32 -22
  28. js/timeago/locales/jquery.timeago.el.js +28 -18
  29. js/timeago/locales/jquery.timeago.en-short.js +30 -20
  30. js/timeago/locales/jquery.timeago.en.js +30 -20
  31. js/timeago/locales/jquery.timeago.es-short.js +30 -20
  32. js/timeago/locales/jquery.timeago.es.js +28 -18
  33. js/timeago/locales/jquery.timeago.et.js +48 -18
  34. js/timeago/locales/jquery.timeago.eu.js +27 -17
  35. js/timeago/locales/jquery.timeago.fa-short.js +30 -20
  36. js/timeago/locales/jquery.timeago.fa.js +32 -22
  37. js/timeago/locales/jquery.timeago.fi.js +37 -27
  38. js/timeago/locales/jquery.timeago.fr-short.js +26 -16
  39. js/timeago/locales/jquery.timeago.fr.js +27 -17
  40. js/timeago/locales/jquery.timeago.gl.js +28 -18
  41. js/timeago/locales/jquery.timeago.he.js +34 -16
  42. js/timeago/locales/jquery.timeago.hr.js +53 -48
  43. js/timeago/locales/jquery.timeago.hu.js +28 -18
  44. js/timeago/locales/jquery.timeago.hy.js +28 -18
  45. js/timeago/locales/jquery.timeago.id.js +28 -18
  46. js/timeago/locales/jquery.timeago.is.js +29 -19
  47. js/timeago/locales/jquery.timeago.it-short.js +30 -20
  48. js/timeago/locales/jquery.timeago.it.js +28 -16
  49. js/timeago/locales/jquery.timeago.ja.js +29 -19
  50. js/timeago/locales/jquery.timeago.jv.js +28 -18
  51. js/timeago/locales/jquery.timeago.ko.js +30 -20
  52. js/timeago/locales/jquery.timeago.ky.js +28 -10
  53. js/timeago/locales/jquery.timeago.lt.js +30 -20
  54. js/timeago/locales/jquery.timeago.lv.js +30 -20
  55. js/timeago/locales/jquery.timeago.mk.js +30 -20
  56. js/timeago/locales/jquery.timeago.nl.js +30 -20
  57. js/timeago/locales/jquery.timeago.no.js +28 -18
  58. js/timeago/locales/jquery.timeago.pl.js +24 -8
  59. js/timeago/locales/jquery.timeago.pt-br-short.js +30 -20
  60. js/timeago/locales/jquery.timeago.pt-br.js +28 -18
  61. js/timeago/locales/jquery.timeago.pt-short.js +30 -20
  62. js/timeago/locales/jquery.timeago.pt.js +26 -16
  63. js/timeago/locales/jquery.timeago.ro.js +28 -18
  64. js/timeago/locales/jquery.timeago.rs.js +53 -48
  65. js/timeago/locales/jquery.timeago.ru.js +29 -10
  66. js/timeago/locales/jquery.timeago.rw.js +30 -20
  67. js/timeago/locales/jquery.timeago.si.js +28 -18
  68. js/timeago/locales/jquery.timeago.sk.js +56 -18
  69. js/timeago/locales/jquery.timeago.sl.js +58 -39
  70. js/timeago/locales/jquery.timeago.sq.js +26 -0
  71. js/timeago/locales/jquery.timeago.sr.js +53 -48
  72. js/timeago/locales/jquery.timeago.sv.js +28 -18
  73. js/timeago/locales/jquery.timeago.th.js +30 -20
  74. js/timeago/locales/jquery.timeago.tr-short.js +30 -0
  75. js/timeago/locales/jquery.timeago.tr.js +26 -16
  76. js/timeago/locales/jquery.timeago.uk.js +28 -10
  77. js/timeago/locales/jquery.timeago.ur.js +30 -0
  78. js/timeago/locales/jquery.timeago.uz.js +39 -19
  79. js/timeago/locales/jquery.timeago.vi.js +30 -20
  80. js/timeago/locales/jquery.timeago.zh-CN.js +30 -20
  81. js/timeago/locales/jquery.timeago.zh-TW.js +30 -20
  82. loggers/SimpleMediaLogger.php +66 -34
  83. loggers/SimplePluginLogger.php +72 -164
  84. loggers/SimplePostLogger.php +9 -3
  85. loggers/SimpleThemeLogger.php +77 -93
  86. loggers/SimpleUserLogger.php +119 -31
  87. phpunit.xml +0 -18
  88. readme.txt +21 -2
code.md DELETED
@@ -1,45 +0,0 @@
1
- Since I always forget what standards I use in different projects this file is here to remind me about the standards I use in this project:
2
-
3
- - PHP coding standard: [PSR12()] because that's the standard that I use in other projects.
4
-
5
- - `phpcs.xml.dist` is the config used.
6
-
7
- - Formatting:
8
- phpcbf to fix errors and warning.
9
- Then sometimes Prettier, but befare it's not 100 % stable yet for PHP files.
10
-
11
- - phpcs to lint while editing. Lots of code is old but working but was written
12
- before my editor had nice linting, so much of the code does not lint. This will be fixed.
13
- `$ phpcs` to lint PHP from command line
14
-
15
- - Changelog: try to use format from https://keepachangelog.com.
16
-
17
- ## How to use in Visual Studio Code
18
-
19
- - Run `composer install`
20
- - Install plugin https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab
21
-
22
- ## How to use php codesniffer
23
-
24
- List errors and warnings:
25
-
26
- $ phpcs /path/to/code/myfile.php # lint specific file
27
- $ phpcs # be in plugin root and all files will be linted
28
- $ npm run lint-php # or use npm script
29
-
30
- Fix things:
31
-
32
- $ phpcbf /path/to/code
33
-
34
- ## Git
35
-
36
- - Will try to follow OneFlow:
37
- https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow
38
-
39
- ## Update match 2021
40
-
41
- Code standards is updated to WordPress own.
42
-
43
- Uses composer package `dealerdirect/phpcodesniffer-composer-installer` to find PHP_CodeSniffer rules automagically. Just run `composer install` and then `vendor/bin/phpcs`.
44
-
45
- Use PHP 7 for now, the WordPress rules crashes on PHP 8 so far (bug fixed but no version with fix released).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codeception.dist.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ paths:
2
+ tests: tests
3
+ output: tests/_output
4
+ data: tests/_data
5
+ support: tests/_support
6
+ envs: tests/_envs
7
+ actor_suffix: Tester
8
+ extensions:
9
+ enabled:
10
+ - Codeception\Extension\RunFailed
11
+ commands:
12
+ - Codeception\Command\GenerateWPUnit
13
+ - Codeception\Command\GenerateWPRestApi
14
+ - Codeception\Command\GenerateWPRestController
15
+ - Codeception\Command\GenerateWPRestPostTypeController
16
+ - Codeception\Command\GenerateWPAjax
17
+ - Codeception\Command\GenerateWPCanonical
18
+ - Codeception\Command\GenerateWPXMLRPC
19
+ params:
20
+ - .env.testing
composer.json DELETED
@@ -1,46 +0,0 @@
1
- {
2
- "name": "bonny/wordpress-simple-history",
3
- "type": "wordpress-plugin",
4
- "description": "View recent changes made within WordPress, directly on your dashboard or on a separate page.",
5
- "keywords": [
6
- "WordPress",
7
- "log",
8
- "history"
9
- ],
10
- "homepage": "https://simple-history.com/",
11
- "minimum-stability": "dev",
12
- "require-dev": {
13
- "dealerdirect/phpcodesniffer-composer-installer": "*",
14
- "phpcompatibility/php-compatibility": "*",
15
- "wp-coding-standards/wpcs": "*",
16
- "phpcompatibility/phpcompatibility-wp": "*"
17
- },
18
- "require": {
19
- "php": ">=5.2.0"
20
- },
21
- "authors": [
22
- {
23
- "name": "Pär Thernström",
24
- "homepage": "https://eskapism.se/"
25
- }
26
- ],
27
- "support": {
28
- "issues": "https://github.com/bonny/WordPress-Simple-History/issues",
29
- "forum": "https://wordpress.org/support/plugin/simple-history/",
30
- "source": "https://github.com/bonny/WordPress-Simple-History"
31
- },
32
- "dist": {
33
- "url": "https://downloads.wordpress.org/plugin/simple-history.zip",
34
- "type": "zip"
35
- },
36
- "scripts": {
37
- "lint": "./vendor/bin/phpcs .",
38
- "lint-fix": "./vendor/bin/phpcbf .",
39
- "test": "./vendor/bin/phpunit"
40
- },
41
- "config": {
42
- "allow-plugins": {
43
- "dealerdirect/phpcodesniffer-composer-installer": true
44
- }
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
composer.lock DELETED
@@ -1,342 +0,0 @@
1
- {
2
- "_readme": [
3
- "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
- "This file is @generated automatically"
6
- ],
7
- "content-hash": "9f6bb942a3e83517b7d1712f1e1e49df",
8
- "packages": [],
9
- "packages-dev": [
10
- {
11
- "name": "dealerdirect/phpcodesniffer-composer-installer",
12
- "version": "dev-master",
13
- "source": {
14
- "type": "git",
15
- "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
16
- "reference": "858566c0b7fe3798f91f1918e1b455636cbf57af"
17
- },
18
- "dist": {
19
- "type": "zip",
20
- "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/858566c0b7fe3798f91f1918e1b455636cbf57af",
21
- "reference": "858566c0b7fe3798f91f1918e1b455636cbf57af",
22
- "shasum": ""
23
- },
24
- "require": {
25
- "composer-plugin-api": "^1.0 || ^2.0",
26
- "php": ">=5.3",
27
- "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0"
28
- },
29
- "require-dev": {
30
- "composer/composer": "*",
31
- "php-parallel-lint/php-parallel-lint": "^1.3.1",
32
- "phpcompatibility/php-compatibility": "^9.0"
33
- },
34
- "default-branch": true,
35
- "type": "composer-plugin",
36
- "extra": {
37
- "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin"
38
- },
39
- "autoload": {
40
- "psr-4": {
41
- "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/"
42
- }
43
- },
44
- "notification-url": "https://packagist.org/downloads/",
45
- "license": ["MIT"],
46
- "authors": [
47
- {
48
- "name": "Franck Nijhof",
49
- "email": "franck.nijhof@dealerdirect.com",
50
- "homepage": "http://www.frenck.nl",
51
- "role": "Developer / IT Manager"
52
- }
53
- ],
54
- "description": "PHP_CodeSniffer Standards Composer Installer Plugin",
55
- "homepage": "http://www.dealerdirect.com",
56
- "keywords": [
57
- "PHPCodeSniffer",
58
- "PHP_CodeSniffer",
59
- "code quality",
60
- "codesniffer",
61
- "composer",
62
- "installer",
63
- "phpcs",
64
- "plugin",
65
- "qa",
66
- "quality",
67
- "standard",
68
- "standards",
69
- "style guide",
70
- "stylecheck",
71
- "tests"
72
- ],
73
- "support": {
74
- "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
75
- "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
76
- },
77
- "time": "2021-11-30T15:06:39+00:00"
78
- },
79
- {
80
- "name": "phpcompatibility/php-compatibility",
81
- "version": "9.3.5",
82
- "source": {
83
- "type": "git",
84
- "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
85
- "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
86
- },
87
- "dist": {
88
- "type": "zip",
89
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
90
- "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
91
- "shasum": ""
92
- },
93
- "require": {
94
- "php": ">=5.3",
95
- "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
96
- },
97
- "conflict": {
98
- "squizlabs/php_codesniffer": "2.6.2"
99
- },
100
- "require-dev": {
101
- "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
102
- },
103
- "suggest": {
104
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
105
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
106
- },
107
- "type": "phpcodesniffer-standard",
108
- "notification-url": "https://packagist.org/downloads/",
109
- "license": ["LGPL-3.0-or-later"],
110
- "authors": [
111
- {
112
- "name": "Wim Godden",
113
- "homepage": "https://github.com/wimg",
114
- "role": "lead"
115
- },
116
- {
117
- "name": "Juliette Reinders Folmer",
118
- "homepage": "https://github.com/jrfnl",
119
- "role": "lead"
120
- },
121
- {
122
- "name": "Contributors",
123
- "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
124
- }
125
- ],
126
- "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
127
- "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
128
- "keywords": ["compatibility", "phpcs", "standards"],
129
- "support": {
130
- "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues",
131
- "source": "https://github.com/PHPCompatibility/PHPCompatibility"
132
- },
133
- "time": "2019-12-27T09:44:58+00:00"
134
- },
135
- {
136
- "name": "phpcompatibility/phpcompatibility-paragonie",
137
- "version": "1.3.1",
138
- "source": {
139
- "type": "git",
140
- "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git",
141
- "reference": "ddabec839cc003651f2ce695c938686d1086cf43"
142
- },
143
- "dist": {
144
- "type": "zip",
145
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43",
146
- "reference": "ddabec839cc003651f2ce695c938686d1086cf43",
147
- "shasum": ""
148
- },
149
- "require": {
150
- "phpcompatibility/php-compatibility": "^9.0"
151
- },
152
- "require-dev": {
153
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7",
154
- "paragonie/random_compat": "dev-master",
155
- "paragonie/sodium_compat": "dev-master"
156
- },
157
- "suggest": {
158
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
159
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
160
- },
161
- "type": "phpcodesniffer-standard",
162
- "notification-url": "https://packagist.org/downloads/",
163
- "license": ["LGPL-3.0-or-later"],
164
- "authors": [
165
- {
166
- "name": "Wim Godden",
167
- "role": "lead"
168
- },
169
- {
170
- "name": "Juliette Reinders Folmer",
171
- "role": "lead"
172
- }
173
- ],
174
- "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.",
175
- "homepage": "http://phpcompatibility.com/",
176
- "keywords": [
177
- "compatibility",
178
- "paragonie",
179
- "phpcs",
180
- "polyfill",
181
- "standards"
182
- ],
183
- "support": {
184
- "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues",
185
- "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie"
186
- },
187
- "time": "2021-02-15T10:24:51+00:00"
188
- },
189
- {
190
- "name": "phpcompatibility/phpcompatibility-wp",
191
- "version": "dev-master",
192
- "source": {
193
- "type": "git",
194
- "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git",
195
- "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308"
196
- },
197
- "dist": {
198
- "type": "zip",
199
- "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308",
200
- "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308",
201
- "shasum": ""
202
- },
203
- "require": {
204
- "phpcompatibility/php-compatibility": "^9.0",
205
- "phpcompatibility/phpcompatibility-paragonie": "^1.0"
206
- },
207
- "require-dev": {
208
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7"
209
- },
210
- "suggest": {
211
- "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
212
- "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
213
- },
214
- "default-branch": true,
215
- "type": "phpcodesniffer-standard",
216
- "notification-url": "https://packagist.org/downloads/",
217
- "license": ["LGPL-3.0-or-later"],
218
- "authors": [
219
- {
220
- "name": "Wim Godden",
221
- "role": "lead"
222
- },
223
- {
224
- "name": "Juliette Reinders Folmer",
225
- "role": "lead"
226
- }
227
- ],
228
- "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.",
229
- "homepage": "http://phpcompatibility.com/",
230
- "keywords": ["compatibility", "phpcs", "standards", "wordpress"],
231
- "support": {
232
- "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues",
233
- "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP"
234
- },
235
- "time": "2021-12-30T16:37:40+00:00"
236
- },
237
- {
238
- "name": "squizlabs/php_codesniffer",
239
- "version": "dev-master",
240
- "source": {
241
- "type": "git",
242
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
243
- "reference": "67c82d975fc15b67725c7e4a0312bf8f28354c0d"
244
- },
245
- "dist": {
246
- "type": "zip",
247
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/67c82d975fc15b67725c7e4a0312bf8f28354c0d",
248
- "reference": "67c82d975fc15b67725c7e4a0312bf8f28354c0d",
249
- "shasum": ""
250
- },
251
- "require": {
252
- "ext-simplexml": "*",
253
- "ext-tokenizer": "*",
254
- "ext-xmlwriter": "*",
255
- "php": ">=5.4.0"
256
- },
257
- "require-dev": {
258
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
259
- },
260
- "default-branch": true,
261
- "bin": ["bin/phpcs", "bin/phpcbf"],
262
- "type": "library",
263
- "extra": {
264
- "branch-alias": {
265
- "dev-master": "3.x-dev"
266
- }
267
- },
268
- "notification-url": "https://packagist.org/downloads/",
269
- "license": ["BSD-3-Clause"],
270
- "authors": [
271
- {
272
- "name": "Greg Sherwood",
273
- "role": "lead"
274
- }
275
- ],
276
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
277
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
278
- "keywords": ["phpcs", "standards"],
279
- "support": {
280
- "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
281
- "source": "https://github.com/squizlabs/PHP_CodeSniffer",
282
- "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
283
- },
284
- "time": "2021-12-20T06:20:45+00:00"
285
- },
286
- {
287
- "name": "wp-coding-standards/wpcs",
288
- "version": "2.3.0",
289
- "source": {
290
- "type": "git",
291
- "url": "https://github.com/WordPress/WordPress-Coding-Standards.git",
292
- "reference": "7da1894633f168fe244afc6de00d141f27517b62"
293
- },
294
- "dist": {
295
- "type": "zip",
296
- "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62",
297
- "reference": "7da1894633f168fe244afc6de00d141f27517b62",
298
- "shasum": ""
299
- },
300
- "require": {
301
- "php": ">=5.4",
302
- "squizlabs/php_codesniffer": "^3.3.1"
303
- },
304
- "require-dev": {
305
- "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6",
306
- "phpcompatibility/php-compatibility": "^9.0",
307
- "phpcsstandards/phpcsdevtools": "^1.0",
308
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
309
- },
310
- "suggest": {
311
- "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
312
- },
313
- "type": "phpcodesniffer-standard",
314
- "notification-url": "https://packagist.org/downloads/",
315
- "license": ["MIT"],
316
- "authors": [
317
- {
318
- "name": "Contributors",
319
- "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors"
320
- }
321
- ],
322
- "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions",
323
- "keywords": ["phpcs", "standards", "wordpress"],
324
- "support": {
325
- "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues",
326
- "source": "https://github.com/WordPress/WordPress-Coding-Standards",
327
- "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki"
328
- },
329
- "time": "2020-05-13T23:57:56+00:00"
330
- }
331
- ],
332
- "aliases": [],
333
- "minimum-stability": "dev",
334
- "stability-flags": [],
335
- "prefer-stable": false,
336
- "prefer-lowest": false,
337
- "platform": {
338
- "php": ">=5.2.0"
339
- },
340
- "platform-dev": [],
341
- "plugin-api-version": "2.2.0"
342
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
docker-compose.yml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: "3.9"
2
+
3
+ services:
4
+ wordpress:
5
+ image: wordpress:${WORDPRESS_VERSION:-5.8}-php${PHP_VERSION:-7.4}
6
+ container_name: simple-history-wordpress
7
+ restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
8
+ user: "33:33"
9
+ ports:
10
+ - "${DOCKER_WEB_PORT_FORWARD:-9191}:80"
11
+ environment:
12
+ WORDPRESS_DB_HOST: db
13
+ WORDPRESS_DB_NAME: wp_test_site
14
+ WORDPRESS_DB_USER: dbuser
15
+ WORDPRESS_DB_PASSWORD: examplepass
16
+ volumes:
17
+ - wordpress:/var/www/html
18
+ - ./:/var/www/html/wp-content/plugins/simple-history
19
+ - "${WP_UPLOADS_DIR:-./data/wp-uploads}:/var/www/html/wp-content/uploads"
20
+
21
+ db:
22
+ image: "mariadb:${MARIADB_VERSION:-10.5}"
23
+ container_name: simple-history-database
24
+ restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
25
+ environment:
26
+ MYSQL_DATABASE: wp_test_site
27
+ MYSQL_USER: dbuser
28
+ MYSQL_PASSWORD: examplepass
29
+ MYSQL_ROOT_PASSWORD: rootpass
30
+ ports:
31
+ - "${DB_EXPOSE_PORT:-127.0.0.1:}:3306"
32
+ volumes:
33
+ - "${MARIADB_DATA_DIR:-./data/mysql}:/var/lib/mysql"
34
+
35
+ chrome:
36
+ image: seleniarm/standalone-chromium
37
+ # shm_size: "2gb"
38
+ container_name: simple-history-chrome
39
+ restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
40
+ # ports:
41
+ # - 14444:4444
42
+ extra_hosts:
43
+ - host.docker.internal:host-gateway
44
+
45
+ php-cli:
46
+ image: dockette/ci:php${PHP_CLI_VERSION-74}
47
+ container_name: simple-history-php-cli
48
+ environment:
49
+ WORDPRESS_DB_HOST: db
50
+ WORDPRESS_DB_NAME: wp_test_site
51
+ WORDPRESS_DB_USER: dbuser
52
+ WORDPRESS_DB_PASSWORD: examplepass
53
+ profiles:
54
+ - noautostart
55
+ working_dir: /srv
56
+ volumes:
57
+ - ./:/srv
58
+ - wordpress:/wordpress
59
+ - ./:/wordpress/wp-content/plugins/simple-history
60
+
61
+ wp-cli:
62
+ image: wordpress:cli-php${PHP_VERSION-7.4}
63
+ container_name: simple-history-wpcli
64
+ environment:
65
+ WORDPRESS_DB_HOST: db
66
+ WORDPRESS_DB_NAME: wp_test_site
67
+ WORDPRESS_DB_USER: dbuser
68
+ WORDPRESS_DB_PASSWORD: examplepass
69
+ user: "33:33"
70
+ depends_on:
71
+ - db
72
+ - wordpress
73
+ init: true
74
+ volumes:
75
+ - wordpress:/var/www/html:rw
76
+ # Make tests folder available so we can export/import db.
77
+ - ./tests/_data/:/var/www/html/tests/_data:rw
78
+ - ./:/var/www/html/wp-content/plugins/simple-history
79
+ profiles:
80
+ - noautostart
81
+
82
+ volumes:
83
+ wordpress: null
dropins/SimpleHistoryFilterDropin.php CHANGED
@@ -172,35 +172,35 @@ class SimpleHistoryFilterDropin {
172
  printf(
173
  '<option value="%1$s" %3$s>%2$s</option>',
174
  'lastdays:1', // 1 - value
175
- esc_attr_x( 'Last day', 'Filter dropin: filter week', 'simple-history' ), // 2 text
176
  selected( $daysToShow, 1, 0 )
177
  );
178
 
179
  printf(
180
  '<option value="%1$s" %3$s>%2$s</option>',
181
  'lastdays:7', // 1 - value
182
- esc_attr_x( 'Last 7 days', 'Filter dropin: filter week', 'simple-history' ), // 2 text
183
  selected( $daysToShow, 7, 0 )
184
  );
185
 
186
  printf(
187
  '<option value="%1$s" %3$s>%2$s</option>',
188
  'lastdays:14', // 1 - value
189
- esc_attr_x( 'Last 14 days', 'Filter dropin: filter week', 'simple-history' ), // 2 text
190
  selected( $daysToShow, 14, 0 )
191
  );
192
 
193
  printf(
194
  '<option value="%1$s" %3$s>%2$s</option>',
195
  'lastdays:30', // 1 - value
196
- esc_attr_x( 'Last 30 days', 'Filter dropin: filter week', 'simple-history' ), // 2 text
197
  selected( $daysToShow, 30, 0 )
198
  );
199
 
200
  printf(
201
  '<option value="%1$s" %3$s>%2$s</option>',
202
  'lastdays:60', // 1 - value
203
- esc_attr_x( 'Last 60 days', 'Filter dropin: filter week', 'simple-history' ), // 2 text
204
  selected( $daysToShow, 60, 0 )
205
  );
206
 
@@ -218,6 +218,13 @@ class SimpleHistoryFilterDropin {
218
  );
219
  }
220
 
 
 
 
 
 
 
 
221
  ?>
222
  </select>
223
 
172
  printf(
173
  '<option value="%1$s" %3$s>%2$s</option>',
174
  'lastdays:1', // 1 - value
175
+ esc_attr_x( 'Last day', 'Filter dropin: filter days', 'simple-history' ), // 2 text
176
  selected( $daysToShow, 1, 0 )
177
  );
178
 
179
  printf(
180
  '<option value="%1$s" %3$s>%2$s</option>',
181
  'lastdays:7', // 1 - value
182
+ esc_attr_x( 'Last 7 days', 'Filter dropin: filter days', 'simple-history' ), // 2 text
183
  selected( $daysToShow, 7, 0 )
184
  );
185
 
186
  printf(
187
  '<option value="%1$s" %3$s>%2$s</option>',
188
  'lastdays:14', // 1 - value
189
+ esc_attr_x( 'Last 14 days', 'Filter dropin: filter days', 'simple-history' ), // 2 text
190
  selected( $daysToShow, 14, 0 )
191
  );
192
 
193
  printf(
194
  '<option value="%1$s" %3$s>%2$s</option>',
195
  'lastdays:30', // 1 - value
196
+ esc_attr_x( 'Last 30 days', 'Filter dropin: filter days', 'simple-history' ), // 2 text
197
  selected( $daysToShow, 30, 0 )
198
  );
199
 
200
  printf(
201
  '<option value="%1$s" %3$s>%2$s</option>',
202
  'lastdays:60', // 1 - value
203
+ esc_attr_x( 'Last 60 days', 'Filter dropin: filter days', 'simple-history' ), // 2 text
204
  selected( $daysToShow, 60, 0 )
205
  );
206
 
218
  );
219
  }
220
 
221
+ // All time.
222
+ printf(
223
+ '<option value="%1$s">%2$s</option>',
224
+ 'allDates', // 1 - value
225
+ esc_attr_x( 'All dates', 'Filter dropin: filter all dates', 'simple-history' ) // 2 text
226
+ );
227
+
228
  ?>
229
  </select>
230
 
gruntfile.js DELETED
@@ -1,162 +0,0 @@
1
- module.exports = function (grunt) {
2
- require("time-grunt")(grunt);
3
-
4
- // Require all grunt-tasks instead of manually initialize them.
5
- require("load-grunt-tasks")(grunt);
6
-
7
- var pkg = grunt.file.readJSON("package.json");
8
- var gig = require("gitignore-globs");
9
- var gag = require("gitattributes-globs");
10
- var ignored_gitignore = gig(".gitignore", { negate: true }).map(function (
11
- value
12
- ) {
13
- return value.replace(/^!\//, "!");
14
- });
15
- var ignored_gitattributes = gag(".gitattributes", { negate: true }).map(
16
- function (value) {
17
- return value.replace(/^!\//, "!");
18
- }
19
- );
20
-
21
- let config = {};
22
-
23
- config.pkg = pkg;
24
-
25
- config.version = {
26
- main: {
27
- options: {
28
- prefix: "Version:[\\s]+",
29
- },
30
- src: ["index.php"],
31
- },
32
- main2: {
33
- options: {
34
- prefix: "'SIMPLE_HISTORY_VERSION', '",
35
- },
36
- src: ["index.php"],
37
- },
38
- readme: {
39
- options: {
40
- prefix: "Stable tag:[\\s]+",
41
- },
42
- src: ["readme.txt"],
43
- },
44
- pkg: {
45
- src: ["package.json"],
46
- },
47
- };
48
-
49
- config.makepot = {
50
- target: {
51
- options: {
52
- cwd: "", // Directory of files to internationalize.
53
- domainPath: "languages/", // Where to save the POT file.
54
- exclude: [], // List of files or directories to ignore.
55
- include: [], // List of files or directories to include.
56
- i18nToolsPath: "node_modules/grunt-wp-i18n/vendor/wp-i18n-tools", // Path to the i18n tools directory.
57
- mainFile: "", // Main project file.
58
- potComments: "", // The copyright at the beginning of the POT file.
59
- potFilename: "", // Name of the POT file.
60
- potHeaders: {
61
- poedit: true, // Includes common Poedit headers.
62
- "x-poedit-keywordslist": true, // Include a list of all possible gettext functions.
63
- }, // Headers to add to the generated POT file.
64
- processPot: null, // A callback function for manipulating the POT file.
65
- type: "wp-plugin", // Type of project (wp-plugin or wp-theme).
66
- updateTimestamp: true, // Whether the POT-Creation-Date should be updated without other changes.
67
- },
68
- },
69
- };
70
-
71
- config.wp_deploy = {
72
- deploy: {
73
- options: {
74
- deploy_trunk: true,
75
- deploy_tag: true,
76
- plugin_slug: "<%= pkg.name %>",
77
- plugin_main_file: "index.php",
78
- build_dir: "build",
79
- assets_dir: "assets-wp-repo",
80
- svn_user: "eskapism",
81
- },
82
- },
83
- // Deploy without tagging the release, useful when only changes to the readme,
84
- // for example when changing the "Tested up to" value.
85
- deploy_without_tag: {
86
- options: {
87
- deploy_trunk: true,
88
- deploy_tag: false,
89
- plugin_slug: "<%= pkg.name %>",
90
- plugin_main_file: "index.php",
91
- build_dir: "build",
92
- assets_dir: "assets-wp-repo",
93
- svn_user: "eskapism",
94
- },
95
- },
96
- assets: {
97
- options: {
98
- deploy_trunk: false,
99
- deploy_tag: false,
100
- plugin_slug: "<%= pkg.name %>",
101
- plugin_main_file: "<%= wp_deploy.deploy.options.plugin_main_file %>",
102
- build_dir: "<%= wp_deploy.deploy.options.build_dir %>",
103
- assets_dir: "<%= wp_deploy.deploy.options.assets_dir %>",
104
- svn_user: "<%= wp_deploy.deploy.options.svn_user %>",
105
- },
106
- },
107
- };
108
-
109
- config.clean = {
110
- main: ["<%= wp_deploy.deploy.options.build_dir %>"],
111
- };
112
-
113
- config.copy = {
114
- main: {
115
- src: [
116
- "**",
117
- "!.*",
118
- "!.git/**",
119
- "!<%= wp_deploy.deploy.options.assets_dir %>/**",
120
- "!<%= wp_deploy.deploy.options.build_dir %>/**",
121
- "!README.md",
122
- ignored_gitignore,
123
- ignored_gitattributes,
124
- ],
125
- dest: "<%= wp_deploy.deploy.options.build_dir %>/",
126
- },
127
- };
128
-
129
- grunt.initConfig(config);
130
-
131
- // Task(s) to run. Default is default.
132
- grunt.registerTask("makepot", "Make .POT-files for languages/translation.", [
133
- "makepot",
134
- ]);
135
-
136
- grunt.registerTask("build", "Clean and copy", ["clean", "copy"]);
137
-
138
- grunt.registerTask("deploy", "Deploy plugin to WordPress plugin repository", [
139
- "build",
140
- "wp_deploy:deploy",
141
- ]);
142
-
143
- grunt.registerTask(
144
- "deploy:assets",
145
- "Deploy plugin asssets to WordPress plugin repository",
146
- ["build", "wp_deploy:assets"]
147
- );
148
-
149
- grunt.registerTask(
150
- "bump",
151
- "Bump version in major, minor, patch or custom steps.",
152
- function (version) {
153
- if (!version) {
154
- grunt.fail.fatal(
155
- "No version specified. Usage: bump:major, bump:minor, bump:patch, bump:x.y.z"
156
- );
157
- }
158
-
159
- grunt.task.run(["version::" + version]);
160
- }
161
- );
162
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/SimpleHistory.php CHANGED
@@ -62,6 +62,15 @@ class SimpleHistory {
62
  const DBTABLE = 'simple_history';
63
  const DBTABLE_CONTEXTS = 'simple_history_contexts';
64
 
 
 
 
 
 
 
 
 
 
65
  /** Slug for the settings menu */
66
  const SETTINGS_MENU_SLUG = 'simple_history_settings_menu_slug';
67
 
@@ -599,8 +608,6 @@ class SimpleHistory {
599
  * http://playground-root.ep/wp-admin/admin-ajax.php?action=simple_history_api&posts_per_page=5&paged=1&format=html
600
  */
601
  public function api() {
602
- global $wpdb;
603
-
604
  // Fake slow answers
605
  // sleep(2);
606
  // sleep(rand(0,3));
@@ -725,8 +732,11 @@ class SimpleHistory {
725
  $this->externalDropins = array();
726
  $this->instantiatedLoggers = array();
727
  $this->instantiatedDropins = array();
728
-
729
  $this->plugin_basename = SIMPLE_HISTORY_BASENAME;
 
 
 
 
730
  }
731
 
732
  /**
@@ -1348,14 +1358,15 @@ class SimpleHistory {
1348
  true
1349
  );
1350
 
1351
- // Determine current locale to load timeago locale
1352
- $locale = strtolower( substr( get_locale(), 0, 2 ) );
 
1353
  $locale_url_path = SIMPLE_HISTORY_DIR_URL . 'js/timeago/locales/jquery.timeago.%s.js';
1354
  $locale_dir_path = SIMPLE_HISTORY_PATH . 'js/timeago/locales/jquery.timeago.%s.js';
1355
 
1356
  // Only enqueue if locale-file exists on file system
1357
- if ( file_exists( sprintf( $locale_dir_path, $locale ) ) ) {
1358
- wp_enqueue_script( 'timeago-locale', sprintf( $locale_url_path, $locale ), array( 'jquery' ), '1.5.2', true );
1359
  } else {
1360
  wp_enqueue_script( 'timeago-locale', sprintf( $locale_url_path, 'en' ), array( 'jquery' ), '1.5.2', true );
1361
  }
@@ -1364,8 +1375,8 @@ class SimpleHistory {
1364
  $locale_url_path = SIMPLE_HISTORY_DIR_URL . 'js/select2/i18n/%s.js';
1365
  $locale_dir_path = SIMPLE_HISTORY_PATH . 'js/select2/i18n/%s.js';
1366
 
1367
- if ( file_exists( sprintf( $locale_dir_path, $locale ) ) ) {
1368
- wp_enqueue_script( 'select2-locale', sprintf( $locale_url_path, $locale ), array( 'jquery' ), '3.5.1', true );
1369
  }
1370
 
1371
  /**
62
  const DBTABLE = 'simple_history';
63
  const DBTABLE_CONTEXTS = 'simple_history_contexts';
64
 
65
+ /** @var string $dbtable Full database name, i.e. wp_simple_history */
66
+ public static $dbtable;
67
+
68
+ /** @var string $dbtable Full database name for contexts, i.e. wp_simple_history_contexts */
69
+ public static $dbtable_contexts;
70
+
71
+ /** @var string $plugin_basename */
72
+ public $plugin_basename;
73
+
74
  /** Slug for the settings menu */
75
  const SETTINGS_MENU_SLUG = 'simple_history_settings_menu_slug';
76
 
608
  * http://playground-root.ep/wp-admin/admin-ajax.php?action=simple_history_api&posts_per_page=5&paged=1&format=html
609
  */
610
  public function api() {
 
 
611
  // Fake slow answers
612
  // sleep(2);
613
  // sleep(rand(0,3));
732
  $this->externalDropins = array();
733
  $this->instantiatedLoggers = array();
734
  $this->instantiatedDropins = array();
 
735
  $this->plugin_basename = SIMPLE_HISTORY_BASENAME;
736
+
737
+ global $wpdb;
738
+ $this::$dbtable = $wpdb->prefix . self::DBTABLE;
739
+ $this::$dbtable_contexts = $wpdb->prefix . self::DBTABLE_CONTEXTS;
740
  }
741
 
742
  /**
1358
  true
1359
  );
1360
 
1361
+ // Determine current locale to load timeago and Select 2locale.
1362
+ $user_locale = strtolower( substr( get_user_locale(), 0, 2 ) ); // en_US
1363
+
1364
  $locale_url_path = SIMPLE_HISTORY_DIR_URL . 'js/timeago/locales/jquery.timeago.%s.js';
1365
  $locale_dir_path = SIMPLE_HISTORY_PATH . 'js/timeago/locales/jquery.timeago.%s.js';
1366
 
1367
  // Only enqueue if locale-file exists on file system
1368
+ if ( file_exists( sprintf( $locale_dir_path, $user_locale ) ) ) {
1369
+ wp_enqueue_script( 'timeago-locale', sprintf( $locale_url_path, $user_locale ), array( 'jquery' ), '1.5.2', true );
1370
  } else {
1371
  wp_enqueue_script( 'timeago-locale', sprintf( $locale_url_path, 'en' ), array( 'jquery' ), '1.5.2', true );
1372
  }
1375
  $locale_url_path = SIMPLE_HISTORY_DIR_URL . 'js/select2/i18n/%s.js';
1376
  $locale_dir_path = SIMPLE_HISTORY_PATH . 'js/select2/i18n/%s.js';
1377
 
1378
+ if ( file_exists( sprintf( $locale_dir_path, $user_locale ) ) ) {
1379
+ wp_enqueue_script( 'select2-locale', sprintf( $locale_url_path, $user_locale ), array( 'jquery' ), '3.5.1', true );
1380
  }
1381
 
1382
  /**
inc/SimpleHistoryLogQuery.php CHANGED
@@ -74,7 +74,7 @@ class SimpleHistoryLogQuery {
74
  // occasionsCountMaxReturn
75
  // occasionsID
76
  // If rows should be returned, or the actualy sql query used
77
- 'returnQuery' => false,
78
 
79
  );
80
 
@@ -159,7 +159,6 @@ class SimpleHistoryLogQuery {
159
  ) AS t ON t.id = h.id
160
 
161
  WHERE
162
- # AND DATE >= DATE(NOW()) - INTERVAL 7 DAY
163
  # Outer/Second where
164
  %1$s
165
 
@@ -283,6 +282,12 @@ class SimpleHistoryLogQuery {
283
  (
284
  [0] => lastdays:7
285
  )
 
 
 
 
 
 
286
  */
287
 
288
  $args['months'] = array();
@@ -563,8 +568,6 @@ class SimpleHistoryLogQuery {
563
  );
564
 
565
  $inner_where .= $sql_user;
566
-
567
- // echo $inner_where;exit;
568
  }
569
  }
570
 
@@ -622,10 +625,10 @@ class SimpleHistoryLogQuery {
622
  */
623
  $sql = apply_filters( 'simple_history/log_query_sql', $sql );
624
 
625
- // Only return sql query
626
- if ( $args['returnQuery'] ) {
627
- return $sql;
628
- }
629
 
630
  $log_rows = $wpdb->get_results( $sql, OBJECT_K ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
631
 
74
  // occasionsCountMaxReturn
75
  // occasionsID
76
  // If rows should be returned, or the actualy sql query used
77
+ // 'returnQuery' => false,
78
 
79
  );
80
 
159
  ) AS t ON t.id = h.id
160
 
161
  WHERE
 
162
  # Outer/Second where
163
  %1$s
164
 
282
  (
283
  [0] => lastdays:7
284
  )
285
+
286
+ $arr_dates can be allDates
287
+ Array
288
+ (
289
+ [0] => allDates
290
+ )
291
  */
292
 
293
  $args['months'] = array();
568
  );
569
 
570
  $inner_where .= $sql_user;
 
 
571
  }
572
  }
573
 
625
  */
626
  $sql = apply_filters( 'simple_history/log_query_sql', $sql );
627
 
628
+ // Only return sql query.
629
+ // if ( $args['returnQuery'] ) {
630
+ // return $sql;
631
+ // }
632
 
633
  $log_rows = $wpdb->get_results( $sql, OBJECT_K ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
634
 
inc/helpers.php CHANGED
@@ -205,11 +205,13 @@ function sh_d() {
205
  }
206
 
207
  if ( $loopOutput ) {
 
 
208
  $output = $output . sprintf(
209
  '
210
  <pre>%1$s</pre>
211
  ',
212
- esc_html( $loopOutput )
213
  );
214
  }
215
  }
205
  }
206
 
207
  if ( $loopOutput ) {
208
+ $maybe_escaped_loop_output = 'cli' === php_sapi_name() ? $loopOutput : esc_html( $loopOutput );
209
+
210
  $output = $output . sprintf(
211
  '
212
  <pre>%1$s</pre>
213
  ',
214
+ $maybe_escaped_loop_output
215
  );
216
  }
217
  }
index.php CHANGED
@@ -6,7 +6,7 @@
6
  * Text Domain: simple-history
7
  * Domain Path: /languages
8
  * Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
9
- * Version: 3.0.0
10
  * Author: Pär Thernström
11
  * Author URI: http://simple-history.com/
12
  * License: GPL2
@@ -45,7 +45,7 @@ if ( $ok_php_version && $ok_wp_version ) {
45
  * @TODO: make activation multi site aware, as in https://github.com/scribu/wp-proper-network-activation
46
  * register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
47
  */
48
- define( 'SIMPLE_HISTORY_VERSION', '3.0.0' );
49
  define( 'SIMPLE_HISTORY_PATH', plugin_dir_path( __FILE__ ) );
50
  define( 'SIMPLE_HISTORY_BASENAME', plugin_basename( __FILE__ ) );
51
  define( 'SIMPLE_HISTORY_DIR_URL', plugin_dir_url( __FILE__ ) );
6
  * Text Domain: simple-history
7
  * Domain Path: /languages
8
  * Description: Plugin that logs various things that occur in WordPress and then presents those events in a very nice GUI.
9
+ * Version: 3.1.0
10
  * Author: Pär Thernström
11
  * Author URI: http://simple-history.com/
12
  * License: GPL2
45
  * @TODO: make activation multi site aware, as in https://github.com/scribu/wp-proper-network-activation
46
  * register_activation_hook( trailingslashit(WP_PLUGIN_DIR) . trailingslashit( plugin_basename(__DIR__) ) . "index.php" , array("SimpleHistory", "on_plugin_activate" ) );
47
  */
48
+ define( 'SIMPLE_HISTORY_VERSION', '3.1.0' );
49
  define( 'SIMPLE_HISTORY_PATH', plugin_dir_path( __FILE__ ) );
50
  define( 'SIMPLE_HISTORY_BASENAME', plugin_basename( __FILE__ ) );
51
  define( 'SIMPLE_HISTORY_DIR_URL', plugin_dir_url( __FILE__ ) );
js/timeago/jquery.timeago.js CHANGED
@@ -3,40 +3,40 @@
3
  * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
4
  *
5
  * @name timeago
6
- * @version 1.6.3
7
- * @requires jQuery v1.2.3+
8
  * @author Ryan McGeary
9
  * @license MIT License - http://www.opensource.org/licenses/mit-license.php
10
  *
11
  * For usage and examples, visit:
12
  * http://timeago.yarp.com/
13
  *
14
- * Copyright (c) 2008-2017, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
15
  */
16
 
17
  (function (factory) {
18
- if (typeof define === 'function' && define.amd) {
19
  // AMD. Register as an anonymous module.
20
- define(['jquery'], factory)
21
- } else if (typeof module === 'object' && typeof module.exports === 'object') {
22
- factory(require('jquery'))
23
  } else {
24
  // Browser globals
25
- factory(jQuery)
26
  }
27
- }(function ($) {
28
  $.timeago = function (timestamp) {
29
  if (timestamp instanceof Date) {
30
- return inWords(timestamp)
31
- } else if (typeof timestamp === 'string') {
32
- return inWords($.timeago.parse(timestamp))
33
- } else if (typeof timestamp === 'number') {
34
- return inWords(new Date(timestamp))
35
  } else {
36
- return inWords($.timeago.datetime(timestamp))
37
  }
38
- }
39
- var $t = $.timeago
40
 
41
  $.extend($.timeago, {
42
  settings: {
@@ -49,184 +49,201 @@
49
  strings: {
50
  prefixAgo: null,
51
  prefixFromNow: null,
52
- suffixAgo: 'ago',
53
- suffixFromNow: 'from now',
54
- inPast: 'any moment now',
55
- seconds: 'less than a minute',
56
- minute: 'about a minute',
57
- minutes: '%d minutes',
58
- hour: 'about an hour',
59
- hours: 'about %d hours',
60
- day: 'a day',
61
- days: '%d days',
62
- month: 'about a month',
63
- months: '%d months',
64
- year: 'about a year',
65
- years: '%d years',
66
- wordSeparator: ' ',
67
- numbers: []
68
- }
69
  },
70
 
71
  inWords: function (distanceMillis) {
72
  if (!this.settings.allowPast && !this.settings.allowFuture) {
73
- throw 'timeago allowPast and allowFuture settings can not both be set to false.'
74
  }
75
 
76
- var $l = this.settings.strings
77
- var prefix = $l.prefixAgo
78
- var suffix = $l.suffixAgo
79
  if (this.settings.allowFuture) {
80
  if (distanceMillis < 0) {
81
- prefix = $l.prefixFromNow
82
- suffix = $l.suffixFromNow
83
  }
84
  }
85
 
86
  if (!this.settings.allowPast && distanceMillis >= 0) {
87
- return this.settings.strings.inPast
88
  }
89
 
90
- var seconds = Math.abs(distanceMillis) / 1000
91
- var minutes = seconds / 60
92
- var hours = minutes / 60
93
- var days = hours / 24
94
- var years = days / 365
95
-
96
- function substitute (stringOrFunction, number) {
97
- var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction
98
- var value = ($l.numbers && $l.numbers[number]) || number
99
- return string.replace(/%d/i, value)
 
 
100
  }
101
 
102
- var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
103
- seconds < 90 && substitute($l.minute, 1) ||
104
- minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
105
- minutes < 90 && substitute($l.hour, 1) ||
106
- hours < 24 && substitute($l.hours, Math.round(hours)) ||
107
- hours < 42 && substitute($l.day, 1) ||
108
- days < 30 && substitute($l.days, Math.round(days)) ||
109
- days < 45 && substitute($l.month, 1) ||
110
- days < 365 && substitute($l.months, Math.round(days / 30)) ||
111
- years < 1.5 && substitute($l.year, 1) ||
112
- substitute($l.years, Math.round(years))
113
-
114
- var separator = $l.wordSeparator || ''
115
- if ($l.wordSeparator === undefined) { separator = ' ' }
116
- return $.trim([prefix, words, suffix].join(separator))
 
 
 
117
  },
118
 
119
  parse: function (iso8601) {
120
- var s = $.trim(iso8601)
121
- s = s.replace(/\.\d+/, '') // remove milliseconds
122
- s = s.replace(/-/, '/').replace(/-/, '/')
123
- s = s.replace(/T/, ' ').replace(/Z/, ' UTC')
124
- s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, ' $1$2') // -04:00 -> -0400
125
- s = s.replace(/([\+\-]\d\d)$/, ' $100') // +09 -> +0900
126
- return new Date(s)
127
  },
128
  datetime: function (elem) {
129
- var iso8601 = $t.isTime(elem) ? $(elem).attr('datetime') : $(elem).attr('title')
130
- return $t.parse(iso8601)
 
 
131
  },
132
  isTime: function (elem) {
133
  // jQuery's `is()` doesn't play well with HTML5 in IE
134
- return $(elem).get(0).tagName.toLowerCase() === 'time' // $(elem).is("time");
135
- }
136
- })
137
 
138
  // functions that can be called via $(el).timeago('action')
139
  // init is default when no action is given
140
  // functions are called with context of a single element
141
  var functions = {
142
  init: function () {
143
- functions.dispose.call(this)
144
- var refresh_el = $.proxy(refresh, this)
145
- refresh_el()
146
- var $s = $t.settings
147
  if ($s.refreshMillis > 0) {
148
- this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis)
149
  }
150
  },
151
  update: function (timestamp) {
152
- var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp)
153
- $(this).data('timeago', { datetime: date })
154
  if ($t.settings.localeTitle) {
155
- $(this).attr('title', date.toLocaleString())
156
  }
157
- refresh.apply(this)
158
  },
159
  updateFromDOM: function () {
160
- $(this).data('timeago', { datetime: $t.parse($t.isTime(this) ? $(this).attr('datetime') : $(this).attr('title')) })
161
- refresh.apply(this)
 
 
 
 
162
  },
163
  dispose: function () {
164
  if (this._timeagoInterval) {
165
- window.clearInterval(this._timeagoInterval)
166
- this._timeagoInterval = null
167
  }
168
- }
169
- }
170
 
171
  $.fn.timeago = function (action, options) {
172
- var fn = action ? functions[action] : functions.init
173
  if (!fn) {
174
- throw new Error("Unknown function name '" + action + "' for timeago")
175
  }
176
  // each over objects here and call the requested function
177
  this.each(function () {
178
- fn.call(this, options)
179
- })
180
- return this
181
- }
182
 
183
- function refresh () {
184
- var $s = $t.settings
185
 
186
- // check if it's still visible
187
  if ($s.autoDispose && !$.contains(document.documentElement, this)) {
188
- // stop if it has been removed
189
- $(this).timeago('dispose')
190
- return this
191
  }
192
 
193
- var data = prepareData(this)
194
 
195
  if (!isNaN(data.datetime)) {
196
  if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
197
- $(this).text(inWords(data.datetime))
198
  } else {
199
- if ($(this).attr('title').length > 0) {
200
- $(this).text($(this).attr('title'))
201
  }
202
  }
203
  }
204
- return this
205
  }
206
 
207
- function prepareData (element) {
208
- element = $(element)
209
- if (!element.data('timeago')) {
210
- element.data('timeago', { datetime: $t.datetime(element) })
211
- var text = $.trim(element.text())
212
  if ($t.settings.localeTitle) {
213
- element.attr('title', element.data('timeago').datetime.toLocaleString())
214
- } else if (text.length > 0 && !($t.isTime(element) && element.attr('title'))) {
215
- element.attr('title', text)
 
 
 
 
 
 
216
  }
217
  }
218
- return element.data('timeago')
219
  }
220
 
221
- function inWords (date) {
222
- return $t.inWords(distance(date))
223
  }
224
 
225
- function distance (date) {
226
- return (new Date().getTime() - date.getTime())
227
  }
228
 
229
  // fix for IE6 suckage
230
- document.createElement('abbr')
231
- document.createElement('time')
232
- }))
3
  * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
4
  *
5
  * @name timeago
6
+ * @version 1.6.7
7
+ * @requires jQuery >=1.5.0 <4.0
8
  * @author Ryan McGeary
9
  * @license MIT License - http://www.opensource.org/licenses/mit-license.php
10
  *
11
  * For usage and examples, visit:
12
  * http://timeago.yarp.com/
13
  *
14
+ * Copyright (c) 2008-2019, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org)
15
  */
16
 
17
  (function (factory) {
18
+ if (typeof define === "function" && define.amd) {
19
  // AMD. Register as an anonymous module.
20
+ define(["jquery"], factory);
21
+ } else if (typeof module === "object" && typeof module.exports === "object") {
22
+ factory(require("jquery"));
23
  } else {
24
  // Browser globals
25
+ factory(jQuery);
26
  }
27
+ })(function ($) {
28
  $.timeago = function (timestamp) {
29
  if (timestamp instanceof Date) {
30
+ return inWords(timestamp);
31
+ } else if (typeof timestamp === "string") {
32
+ return inWords($.timeago.parse(timestamp));
33
+ } else if (typeof timestamp === "number") {
34
+ return inWords(new Date(timestamp));
35
  } else {
36
+ return inWords($.timeago.datetime(timestamp));
37
  }
38
+ };
39
+ var $t = $.timeago;
40
 
41
  $.extend($.timeago, {
42
  settings: {
49
  strings: {
50
  prefixAgo: null,
51
  prefixFromNow: null,
52
+ suffixAgo: "ago",
53
+ suffixFromNow: "from now",
54
+ inPast: "any moment now",
55
+ seconds: "less than a minute",
56
+ minute: "about a minute",
57
+ minutes: "%d minutes",
58
+ hour: "about an hour",
59
+ hours: "about %d hours",
60
+ day: "a day",
61
+ days: "%d days",
62
+ month: "about a month",
63
+ months: "%d months",
64
+ year: "about a year",
65
+ years: "%d years",
66
+ wordSeparator: " ",
67
+ numbers: [],
68
+ },
69
  },
70
 
71
  inWords: function (distanceMillis) {
72
  if (!this.settings.allowPast && !this.settings.allowFuture) {
73
+ throw "timeago allowPast and allowFuture settings can not both be set to false.";
74
  }
75
 
76
+ var $l = this.settings.strings;
77
+ var prefix = $l.prefixAgo;
78
+ var suffix = $l.suffixAgo;
79
  if (this.settings.allowFuture) {
80
  if (distanceMillis < 0) {
81
+ prefix = $l.prefixFromNow;
82
+ suffix = $l.suffixFromNow;
83
  }
84
  }
85
 
86
  if (!this.settings.allowPast && distanceMillis >= 0) {
87
+ return this.settings.strings.inPast;
88
  }
89
 
90
+ var seconds = Math.abs(distanceMillis) / 1000;
91
+ var minutes = seconds / 60;
92
+ var hours = minutes / 60;
93
+ var days = hours / 24;
94
+ var years = days / 365;
95
+
96
+ function substitute(stringOrFunction, number) {
97
+ var string = $.isFunction(stringOrFunction)
98
+ ? stringOrFunction(number, distanceMillis)
99
+ : stringOrFunction;
100
+ var value = ($l.numbers && $l.numbers[number]) || number;
101
+ return string.replace(/%d/i, value);
102
  }
103
 
104
+ var words =
105
+ (seconds < 45 && substitute($l.seconds, Math.round(seconds))) ||
106
+ (seconds < 90 && substitute($l.minute, 1)) ||
107
+ (minutes < 45 && substitute($l.minutes, Math.round(minutes))) ||
108
+ (minutes < 90 && substitute($l.hour, 1)) ||
109
+ (hours < 24 && substitute($l.hours, Math.round(hours))) ||
110
+ (hours < 42 && substitute($l.day, 1)) ||
111
+ (days < 30 && substitute($l.days, Math.round(days))) ||
112
+ (days < 45 && substitute($l.month, 1)) ||
113
+ (days < 365 && substitute($l.months, Math.round(days / 30))) ||
114
+ (years < 1.5 && substitute($l.year, 1)) ||
115
+ substitute($l.years, Math.round(years));
116
+
117
+ var separator = $l.wordSeparator || "";
118
+ if ($l.wordSeparator === undefined) {
119
+ separator = " ";
120
+ }
121
+ return $.trim([prefix, words, suffix].join(separator));
122
  },
123
 
124
  parse: function (iso8601) {
125
+ var s = $.trim(iso8601);
126
+ s = s.replace(/\.\d+/, ""); // remove milliseconds
127
+ s = s.replace(/-/, "/").replace(/-/, "/");
128
+ s = s.replace(/T/, " ").replace(/Z/, " UTC");
129
+ s = s.replace(/([\+\-]\d\d)\:?(\d\d)/, " $1$2"); // -04:00 -> -0400
130
+ s = s.replace(/([\+\-]\d\d)$/, " $100"); // +09 -> +0900
131
+ return new Date(s);
132
  },
133
  datetime: function (elem) {
134
+ var iso8601 = $t.isTime(elem)
135
+ ? $(elem).attr("datetime")
136
+ : $(elem).attr("title");
137
+ return $t.parse(iso8601);
138
  },
139
  isTime: function (elem) {
140
  // jQuery's `is()` doesn't play well with HTML5 in IE
141
+ return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
142
+ },
143
+ });
144
 
145
  // functions that can be called via $(el).timeago('action')
146
  // init is default when no action is given
147
  // functions are called with context of a single element
148
  var functions = {
149
  init: function () {
150
+ functions.dispose.call(this);
151
+ var refresh_el = $.proxy(refresh, this);
152
+ refresh_el();
153
+ var $s = $t.settings;
154
  if ($s.refreshMillis > 0) {
155
+ this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
156
  }
157
  },
158
  update: function (timestamp) {
159
+ var date = timestamp instanceof Date ? timestamp : $t.parse(timestamp);
160
+ $(this).data("timeago", { datetime: date });
161
  if ($t.settings.localeTitle) {
162
+ $(this).attr("title", date.toLocaleString());
163
  }
164
+ refresh.apply(this);
165
  },
166
  updateFromDOM: function () {
167
+ $(this).data("timeago", {
168
+ datetime: $t.parse(
169
+ $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title")
170
+ ),
171
+ });
172
+ refresh.apply(this);
173
  },
174
  dispose: function () {
175
  if (this._timeagoInterval) {
176
+ window.clearInterval(this._timeagoInterval);
177
+ this._timeagoInterval = null;
178
  }
179
+ },
180
+ };
181
 
182
  $.fn.timeago = function (action, options) {
183
+ var fn = action ? functions[action] : functions.init;
184
  if (!fn) {
185
+ throw new Error("Unknown function name '" + action + "' for timeago");
186
  }
187
  // each over objects here and call the requested function
188
  this.each(function () {
189
+ fn.call(this, options);
190
+ });
191
+ return this;
192
+ };
193
 
194
+ function refresh() {
195
+ var $s = $t.settings;
196
 
197
+ //check if it's still visible
198
  if ($s.autoDispose && !$.contains(document.documentElement, this)) {
199
+ //stop if it has been removed
200
+ $(this).timeago("dispose");
201
+ return this;
202
  }
203
 
204
+ var data = prepareData(this);
205
 
206
  if (!isNaN(data.datetime)) {
207
  if ($s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
208
+ $(this).text(inWords(data.datetime));
209
  } else {
210
+ if ($(this).attr("title").length > 0) {
211
+ $(this).text($(this).attr("title"));
212
  }
213
  }
214
  }
215
+ return this;
216
  }
217
 
218
+ function prepareData(element) {
219
+ element = $(element);
220
+ if (!element.data("timeago")) {
221
+ element.data("timeago", { datetime: $t.datetime(element) });
222
+ var text = $.trim(element.text());
223
  if ($t.settings.localeTitle) {
224
+ element.attr(
225
+ "title",
226
+ element.data("timeago").datetime.toLocaleString()
227
+ );
228
+ } else if (
229
+ text.length > 0 &&
230
+ !($t.isTime(element) && element.attr("title"))
231
+ ) {
232
+ element.attr("title", text);
233
  }
234
  }
235
+ return element.data("timeago");
236
  }
237
 
238
+ function inWords(date) {
239
+ return $t.inWords(distance(date));
240
  }
241
 
242
+ function distance(date) {
243
+ return new Date().getTime() - date.getTime();
244
  }
245
 
246
  // fix for IE6 suckage
247
+ document.createElement("abbr");
248
+ document.createElement("time");
249
+ });
js/timeago/locales/jquery.timeago.af.js CHANGED
@@ -1,20 +1,30 @@
1
- // Afrikaans
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "gelede",
6
- suffixFromNow: "van nou af",
7
- seconds: "%d sekondes",
8
- minute: "1 minuut",
9
- minutes: "%d minute",
10
- hour: "1 uur",
11
- hours: "%d ure",
12
- day: "1 dag",
13
- days: "%d dae",
14
- month: "1 maand",
15
- months: "%d maande",
16
- year: "1 jaar",
17
- years: "%d jaar",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Afrikaans
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "gelede",
15
+ suffixFromNow: "van nou af",
16
+ seconds: "%d sekondes",
17
+ minute: "1 minuut",
18
+ minutes: "%d minute",
19
+ hour: "1 uur",
20
+ hours: "%d ure",
21
+ day: "1 dag",
22
+ days: "%d dae",
23
+ month: "1 maand",
24
+ months: "%d maande",
25
+ year: "1 jaar",
26
+ years: "%d jaar",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.am.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Amharic
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "በፊት",
15
+ suffixFromNow: "በኋላ",
16
+ seconds: "ከአንድ ደቂቃ በታች",
17
+ minute: "ከአንድ ደቂቃ ገደማ",
18
+ minutes: "ከ%d ደቂቃ",
19
+ hour: "ከአንድ ሰዓት ገደማ",
20
+ hours: "ከ%d ሰዓት ገደማ",
21
+ day: "ከአንድ ቀን",
22
+ days: "ከ%d ቀን",
23
+ month: "ከአንድ ወር ገደማ",
24
+ months: "ከ%d ወር",
25
+ year: "ከአንድ ዓመት ገደማ",
26
+ years: "ከ%d ዓመት",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.ar.js CHANGED
@@ -1,96 +1,152 @@
1
- (function() {
 
 
 
 
 
 
 
 
2
  function numpf(n, a) {
3
- return a[plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5];
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
- jQuery.timeago.settings.strings = {
7
  prefixAgo: "منذ",
8
  prefixFromNow: "بعد",
9
  suffixAgo: null,
10
  suffixFromNow: null, // null OR "من الآن"
11
- second: function(value) { return numpf(value, [
12
- 'أقل من ثانية',
13
- 'ثانية واحدة',
14
- 'ثانيتين',
15
- '%d ثوانٍ',
16
- '%d ثانية',
17
- '%d ثانية']); },
18
- seconds: function(value) { return numpf(value, [
19
- 'أقل من ثانية',
20
- 'ثانية واحدة',
21
- 'ثانيتين',
22
- '%d ثوانٍ',
23
- '%d ثانية',
24
- '%d ثانية']); },
25
- minute: function(value) { return numpf(value, [
26
- 'أقل من دقيقة',
27
- 'دقيقة واحدة',
28
- 'دقيقتين',
29
- '%d دقائق',
30
- '%d دقيقة',
31
- 'دقيقة']); },
32
- minutes: function(value) { return numpf(value, [
33
- 'أقل من دقيقة',
34
- 'دقيقة واحدة',
35
- 'دقيقتين',
36
- '%d دقائق',
37
- '%d دقيقة',
38
- 'دقيقة']); },
39
- hour: function(value) { return numpf(value, [
40
- 'أقل من ساعة',
41
- 'ساعة واحدة',
42
- 'ساعتين',
43
- '%d ساعات',
44
- '%d ساعة',
45
- '%d ساعة']); },
46
- hours: function(value) { return numpf(value, [
47
- 'أقل من ساعة',
48
- 'ساعة واحدة',
49
- 'ساعتين',
50
- '%d ساعات',
51
- '%d ساعة',
52
- '%d ساعة']); },
53
- day: function(value) { return numpf(value, [
54
- 'أقل من يوم',
55
- 'يوم واحد',
56
- 'يومين',
57
- '%d أيام',
58
- '%d يومًا',
59
- '%d يوم']); },
60
- days: function(value) { return numpf(value, [
61
- 'أقل من يوم',
62
- 'يوم واحد',
63
- 'يومين',
64
- '%d أيام',
65
- '%d يومًا',
66
- '%d يوم']); },
67
- month: function(value) { return numpf(value, [
68
- 'أقل من شهر',
69
- 'شهر واحد',
70
- 'شهرين',
71
- '%d أشهر',
72
- '%d شهرًا',
73
- '%d شهر']); },
74
- months: function(value) { return numpf(value, [
75
- 'أقل من شهر',
76
- 'شهر واحد',
77
- 'شهرين',
78
- '%d أشهر',
79
- '%d شهرًا',
80
- '%d شهر']); },
81
- year: function(value) { return numpf(value, [
82
- 'أقل من عام',
83
- 'عام واحد',
84
- '%d عامين',
85
- '%d أعوام',
86
- '%d عامًا']);
87
- },
88
- years: function(value) { return numpf(value, [
89
- 'أقل من عام',
90
- 'عام واحد',
91
- 'عامين',
92
- '%d أعوام',
93
- '%d عامًا',
94
- '%d عام']);}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  };
96
- })();
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
  function numpf(n, a) {
11
+ return a[
12
+ (plural =
13
+ n === 0
14
+ ? 0
15
+ : n === 1
16
+ ? 1
17
+ : n === 2
18
+ ? 2
19
+ : n % 100 >= 3 && n % 100 <= 10
20
+ ? 3
21
+ : n % 100 >= 11
22
+ ? 4
23
+ : 5)
24
+ ];
25
  }
26
 
27
+ jQuery.timeago.settings.strings = {
28
  prefixAgo: "منذ",
29
  prefixFromNow: "بعد",
30
  suffixAgo: null,
31
  suffixFromNow: null, // null OR "من الآن"
32
+ second: function (value) {
33
+ return numpf(value, [
34
+ "أقل من ثانية",
35
+ "ثانية واحدة",
36
+ "ثانيتين",
37
+ "%d ثوانٍ",
38
+ "%d ثانية",
39
+ "%d ثانية",
40
+ ]);
41
+ },
42
+ seconds: function (value) {
43
+ return numpf(value, [
44
+ "أقل من ثانية",
45
+ "ثانية واحدة",
46
+ "ثانيتين",
47
+ "%d ثوانٍ",
48
+ "%d ثانية",
49
+ "%d ثانية",
50
+ ]);
51
+ },
52
+ minute: function (value) {
53
+ return numpf(value, [
54
+ "أقل من دقيقة",
55
+ "دقيقة واحدة",
56
+ "دقيقتين",
57
+ "%d دقائق",
58
+ "%d دقيقة",
59
+ "دقيقة",
60
+ ]);
61
+ },
62
+ minutes: function (value) {
63
+ return numpf(value, [
64
+ "أقل من دقيقة",
65
+ "دقيقة واحدة",
66
+ "دقيقتين",
67
+ "%d دقائق",
68
+ "%d دقيقة",
69
+ "دقيقة",
70
+ ]);
71
+ },
72
+ hour: function (value) {
73
+ return numpf(value, [
74
+ "أقل من ساعة",
75
+ "ساعة واحدة",
76
+ "ساعتين",
77
+ "%d ساعات",
78
+ "%d ساعة",
79
+ "%d ساعة",
80
+ ]);
81
+ },
82
+ hours: function (value) {
83
+ return numpf(value, [
84
+ "أقل من ساعة",
85
+ "ساعة واحدة",
86
+ "ساعتين",
87
+ "%d ساعات",
88
+ "%d ساعة",
89
+ "%d ساعة",
90
+ ]);
91
+ },
92
+ day: function (value) {
93
+ return numpf(value, [
94
+ "أقل من يوم",
95
+ "يوم واحد",
96
+ "يومين",
97
+ "%d أيام",
98
+ "%d يومًا",
99
+ "%d يوم",
100
+ ]);
101
+ },
102
+ days: function (value) {
103
+ return numpf(value, [
104
+ "أقل من يوم",
105
+ "يوم واحد",
106
+ "يومين",
107
+ "%d أيام",
108
+ "%d يومًا",
109
+ "%d يوم",
110
+ ]);
111
+ },
112
+ month: function (value) {
113
+ return numpf(value, [
114
+ "أقل من شهر",
115
+ "شهر واحد",
116
+ "شهرين",
117
+ "%d أشهر",
118
+ "%d شهرًا",
119
+ "%d شهر",
120
+ ]);
121
+ },
122
+ months: function (value) {
123
+ return numpf(value, [
124
+ "أقل من شهر",
125
+ "شهر واحد",
126
+ "شهرين",
127
+ "%d أشهر",
128
+ "%d شهرًا",
129
+ "%d شهر",
130
+ ]);
131
+ },
132
+ year: function (value) {
133
+ return numpf(value, [
134
+ "أقل من عام",
135
+ "عام واحد",
136
+ "%d عامين",
137
+ "%d أعوام",
138
+ "%d عامًا",
139
+ ]);
140
+ },
141
+ years: function (value) {
142
+ return numpf(value, [
143
+ "أقل من عام",
144
+ "عام واحد",
145
+ "عامين",
146
+ "%d أعوام",
147
+ "%d عامًا",
148
+ "%d عام",
149
+ ]);
150
+ },
151
  };
152
+ });
js/timeago/locales/jquery.timeago.az-short.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Azerbaijani shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1 dəq",
17
+ minute: "1 dəq",
18
+ minutes: "%d dəq",
19
+ hour: "1 saat",
20
+ hours: "%d saat",
21
+ day: "1 gün",
22
+ days: "%d gün",
23
+ month: "1 ay",
24
+ months: "%d ay",
25
+ year: "1 il",
26
+ years: "%d il",
27
+ wordSeparator: "",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.az.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Azerbaijani
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "əvvəl",
15
+ suffixFromNow: "sonra",
16
+ seconds: "saniyələr",
17
+ minute: "1 dəqiqə",
18
+ minutes: "%d dəqiqə",
19
+ hour: "1 saat",
20
+ hours: "%d saat",
21
+ day: "1 gün",
22
+ days: "%d gün",
23
+ month: "1 ay",
24
+ months: "%d ay",
25
+ year: "1 il",
26
+ years: "%d il",
27
+ wordSeparator: "",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.be.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Belarusian
11
+ function numpf(n, f, s, t) {
12
+ // f - 1, 21, 31, ...
13
+ // s - 2-4, 22-24, 32-34 ...
14
+ // t - 5-20, 25-30, ...
15
+ n = n % 100;
16
+ var n10 = n % 10;
17
+ if (n10 === 1 && (n === 1 || n > 20)) {
18
+ return f;
19
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
20
+ return s;
21
+ } else {
22
+ return t;
23
+ }
24
+ }
25
+
26
+ jQuery.timeago.settings.strings = {
27
+ prefixAgo: null,
28
+ prefixFromNow: "праз",
29
+ suffixAgo: "таму",
30
+ suffixFromNow: null,
31
+ seconds: "менш хвіліны",
32
+ minute: "хвіліну",
33
+ minutes: function (value) {
34
+ return numpf(value, "%d хвіліна", "%d хвіліны", "%d хвілін");
35
+ },
36
+ hour: "гадзіну",
37
+ hours: function (value) {
38
+ return numpf(value, "%d гадзіна", "%d гадзіны", "%d гадзін");
39
+ },
40
+ day: "дзень",
41
+ days: function (value) {
42
+ return numpf(value, "%d дзень", "%d дні", "%d дзён");
43
+ },
44
+ month: "месяц",
45
+ months: function (value) {
46
+ return numpf(value, "%d месяц", "%d месяцы", "%d месяцаў");
47
+ },
48
+ year: "год",
49
+ years: function (value) {
50
+ return numpf(value, "%d год", "%d гады", "%d гадоў");
51
+ },
52
+ };
53
+ });
js/timeago/locales/jquery.timeago.bg.js CHANGED
@@ -1,18 +1,28 @@
1
- // Bulgarian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "преди",
4
- prefixFromNow: "след",
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "по-малко от минута",
8
- minute: "една минута",
9
- minutes: "%d минути",
10
- hour: "един час",
11
- hours: "%d часа",
12
- day: "един ден",
13
- days: "%d дни",
14
- month: "един месец",
15
- months: "%d месеца",
16
- year: "една година",
17
- years: "%d години"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Bulgarian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "преди",
13
+ prefixFromNow: "след",
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "по-малко от минута",
17
+ minute: "една минута",
18
+ minutes: "%d минути",
19
+ hour: "един час",
20
+ hours: "%d часа",
21
+ day: "един ден",
22
+ days: "%d дни",
23
+ month: "един месец",
24
+ months: "%d месеца",
25
+ year: "една година",
26
+ years: "%d години",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.bs.js CHANGED
@@ -1,8 +1,14 @@
1
- // Bosnian
2
- (function() {
3
- var numpf;
4
-
5
- numpf = function(n, f, s, t) {
 
 
 
 
 
 
6
  var n10;
7
  n10 = n % 10;
8
  if (n10 === 1 && (n === 1 || n > 20)) {
@@ -20,30 +26,29 @@
20
  suffixAgo: null,
21
  suffixFromNow: null,
22
  second: "sekund",
23
- seconds: function(value) {
24
  return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
25
  },
26
  minute: "oko minut",
27
- minutes: function(value) {
28
  return numpf(value, "%d minut", "%d minute", "%d minuta");
29
  },
30
  hour: "oko sat",
31
- hours: function(value) {
32
  return numpf(value, "%d sat", "%d sata", "%d sati");
33
  },
34
  day: "oko jednog dana",
35
- days: function(value) {
36
  return numpf(value, "%d dan", "%d dana", "%d dana");
37
  },
38
  month: "mjesec dana",
39
- months: function(value) {
40
  return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
41
  },
42
  year: "prije godinu dana ",
43
- years: function(value) {
44
  return numpf(value, "%d godinu", "%d godine", "%d godina");
45
  },
46
- wordSeparator: " "
47
  };
48
-
49
- }).call(this);
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Bosnian
11
+ var numpf = function (n, f, s, t) {
12
  var n10;
13
  n10 = n % 10;
14
  if (n10 === 1 && (n === 1 || n > 20)) {
26
  suffixAgo: null,
27
  suffixFromNow: null,
28
  second: "sekund",
29
+ seconds: function (value) {
30
  return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
31
  },
32
  minute: "oko minut",
33
+ minutes: function (value) {
34
  return numpf(value, "%d minut", "%d minute", "%d minuta");
35
  },
36
  hour: "oko sat",
37
+ hours: function (value) {
38
  return numpf(value, "%d sat", "%d sata", "%d sati");
39
  },
40
  day: "oko jednog dana",
41
+ days: function (value) {
42
  return numpf(value, "%d dan", "%d dana", "%d dana");
43
  },
44
  month: "mjesec dana",
45
+ months: function (value) {
46
  return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
47
  },
48
  year: "prije godinu dana ",
49
+ years: function (value) {
50
  return numpf(value, "%d godinu", "%d godine", "%d godina");
51
  },
52
+ wordSeparator: " ",
53
  };
54
+ });
 
js/timeago/locales/jquery.timeago.ca.js CHANGED
@@ -1,18 +1,30 @@
1
- // Catalan
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "fa",
4
- prefixFromNow: "d'aqui a",
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "menys d'1 minut",
8
- minute: "1 minut",
9
- minutes: "uns %d minuts",
10
- hour: "1 hora",
11
- hours: "unes %d hores",
12
- day: "1 dia",
13
- days: "%d dies",
14
- month: "aproximadament un mes",
15
- months: "%d mesos",
16
- year: "aproximadament un any",
17
- years: "%d anys"
18
- };
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Catalan
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "fa",
13
+ prefixFromNow: "d'aquí",
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "menys d'un minut",
17
+ minute: "un minut",
18
+ minutes: "%d minuts",
19
+ hour: "una hora",
20
+ hours: "%d hores",
21
+ day: "un dia",
22
+ days: "%d dies",
23
+ month: "un mes",
24
+ months: "%d mesos",
25
+ year: "un any",
26
+ years: "%d anys",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.cs.js CHANGED
@@ -1,24 +1,56 @@
1
- // Czech
2
- (function() {
3
- function f(n, d, a) {
4
- return a[d>=0 ? 0 : a.length==2 || n<5 ? 1 : 2];
5
- }
 
 
 
 
 
 
 
 
 
6
 
7
- jQuery.timeago.settings.strings = {
8
- prefixAgo: 'před',
9
- prefixFromNow: 'za',
10
- suffixAgo: null,
11
- suffixFromNow: null,
12
- seconds: function(n, d) {return f(n, d, ['méně než minutou', 'méně než minutu']);},
13
- minute: function(n, d) {return f(n, d, ['minutou', 'minutu']);},
14
- minutes: function(n, d) {return f(n, d, ['%d minutami', '%d minuty', '%d minut']);},
15
- hour: function(n, d) {return f(n, d, ['hodinou', 'hodinu']);},
16
- hours: function(n, d) {return f(n, d, ['%d hodinami', '%d hodiny', '%d hodin']);},
17
- day: function(n, d) {return f(n, d, ['%d dnem', '%d den']);},
18
- days: function(n, d) {return f(n, d, ['%d dny', '%d dny', '%d dní']);},
19
- month: function(n, d) {return f(n, d, ['%d měsícem', '%d měsíc']);},
20
- months: function(n, d) {return f(n, d, ['%d měsíci', '%d měsíce', '%d měsíců']);},
21
- year: function(n, d) {return f(n, d, ['%d rokem', '%d rok']);},
22
- years: function(n, d) {return f(n, d, ['%d lety', '%d roky', '%d let']);}
23
- };
24
- })();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Czech
11
+ (function () {
12
+ function f(n, d, a) {
13
+ return a[d >= 0 ? 0 : a.length === 2 || n < 5 ? 1 : 2];
14
+ }
15
 
16
+ jQuery.timeago.settings.strings = {
17
+ prefixAgo: "před",
18
+ prefixFromNow: "za",
19
+ suffixAgo: null,
20
+ suffixFromNow: null,
21
+ seconds: function (n, d) {
22
+ return f(n, d, ["méně než minutou", "méně než minutu"]);
23
+ },
24
+ minute: function (n, d) {
25
+ return f(n, d, ["minutou", "minutu"]);
26
+ },
27
+ minutes: function (n, d) {
28
+ return f(n, d, ["%d minutami", "%d minuty", "%d minut"]);
29
+ },
30
+ hour: function (n, d) {
31
+ return f(n, d, ["hodinou", "hodinu"]);
32
+ },
33
+ hours: function (n, d) {
34
+ return f(n, d, ["%d hodinami", "%d hodiny", "%d hodin"]);
35
+ },
36
+ day: function (n, d) {
37
+ return f(n, d, ["%d dnem", "%d den"]);
38
+ },
39
+ days: function (n, d) {
40
+ return f(n, d, ["%d dny", "%d dny", "%d dní"]);
41
+ },
42
+ month: function (n, d) {
43
+ return f(n, d, ["%d měsícem", "%d měsíc"]);
44
+ },
45
+ months: function (n, d) {
46
+ return f(n, d, ["%d měsíci", "%d měsíce", "%d měsíců"]);
47
+ },
48
+ year: function (n, d) {
49
+ return f(n, d, ["%d rokem", "%d rok"]);
50
+ },
51
+ years: function (n, d) {
52
+ return f(n, d, ["%d lety", "%d roky", "%d let"]);
53
+ },
54
+ };
55
+ })();
56
+ });
js/timeago/locales/jquery.timeago.cy.js CHANGED
@@ -1,20 +1,30 @@
1
- // Welsh
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "yn ôl",
6
- suffixFromNow: "o hyn",
7
- seconds: "llai na munud",
8
- minute: "am funud",
9
- minutes: "%d munud",
10
- hour: "tua awr",
11
- hours: "am %d awr",
12
- day: "y dydd",
13
- days: "%d diwrnod",
14
- month: "tua mis",
15
- months: "%d mis",
16
- year: "am y flwyddyn",
17
- years: "%d blynedd",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Welsh
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "yn ôl",
15
+ suffixFromNow: "o hyn",
16
+ seconds: "llai na munud",
17
+ minute: "am funud",
18
+ minutes: "%d munud",
19
+ hour: "tua awr",
20
+ hours: "am %d awr",
21
+ day: "y dydd",
22
+ days: "%d diwrnod",
23
+ month: "tua mis",
24
+ months: "%d mis",
25
+ year: "am y flwyddyn",
26
+ years: "%d blynedd",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.da.js CHANGED
@@ -1,18 +1,28 @@
1
- // Danish
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "for",
4
- prefixFromNow: "om",
5
- suffixAgo: "siden",
6
- suffixFromNow: "",
7
- seconds: "mindre end et minut",
8
- minute: "ca. et minut",
9
- minutes: "%d minutter",
10
- hour: "ca. en time",
11
- hours: "ca. %d timer",
12
- day: "en dag",
13
- days: "%d dage",
14
- month: "ca. en måned",
15
- months: "%d måneder",
16
- year: "ca. et år",
17
- years: "%d år"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Danish
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "for",
13
+ prefixFromNow: "om",
14
+ suffixAgo: "siden",
15
+ suffixFromNow: "",
16
+ seconds: "mindre end et minut",
17
+ minute: "ca. et minut",
18
+ minutes: "%d minutter",
19
+ hour: "ca. en time",
20
+ hours: "ca. %d timer",
21
+ day: "en dag",
22
+ days: "%d dage",
23
+ month: "ca. en måned",
24
+ months: "%d måneder",
25
+ year: "ca. et år",
26
+ years: "%d år",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.de-short.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // German shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "s",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1T.",
22
+ days: "%dT.",
23
+ month: "1Mt.",
24
+ months: "%dMt.",
25
+ year: "1J.",
26
+ years: "%dJ.",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.de.js CHANGED
@@ -1,18 +1,28 @@
1
- // German
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "vor",
4
- prefixFromNow: "in",
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "wenigen Sekunden",
8
- minute: "etwa einer Minute",
9
- minutes: "%d Minuten",
10
- hour: "etwa einer Stunde",
11
- hours: "%d Stunden",
12
- day: "etwa einem Tag",
13
- days: "%d Tagen",
14
- month: "etwa einem Monat",
15
- months: "%d Monaten",
16
- year: "etwa einem Jahr",
17
- years: "%d Jahren"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // German
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "vor",
13
+ prefixFromNow: "in",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "wenigen Sekunden",
17
+ minute: "etwa einer Minute",
18
+ minutes: "%d Minuten",
19
+ hour: "etwa einer Stunde",
20
+ hours: "%d Stunden",
21
+ day: "etwa einem Tag",
22
+ days: "%d Tagen",
23
+ month: "etwa einem Monat",
24
+ months: "%d Monaten",
25
+ year: "etwa einem Jahr",
26
+ years: "%d Jahren",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.dv.js CHANGED
@@ -1,22 +1,32 @@
1
- /**
2
- * Dhivehi time in Thaana for timeago.js
3
- **/
4
- jQuery.timeago.settings.strings = {
5
- prefixAgo: null,
6
- prefixFromNow: null,
7
- suffixAgo: "ކުރިން",
8
- suffixFromNow: "ފަހުން",
9
- seconds: "ސިކުންތުކޮޅެއް",
10
- minute: "މިނިޓެއްވަރު",
11
- minutes: "%d މިނިޓު",
12
- hour: "ގަޑިއެއްވަރު",
13
- hours: "ގާތްގަނޑަކަށް %d ގަޑިއިރު",
14
- day: "އެއް ދުވަސް",
15
- days: "މީގެ %d ދުވަސް",
16
- month: "މަހެއްވަރު",
17
- months: "މީގެ %d މަސް",
18
- year: "އަހަރެއްވަރު",
19
- years: "މީގެ %d އަހަރު",
20
- wordSeparator: " ",
21
- numbers: []
22
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ /**
11
+ * Dhivehi time in Thaana for timeago.js
12
+ **/
13
+ jQuery.timeago.settings.strings = {
14
+ prefixAgo: null,
15
+ prefixFromNow: null,
16
+ suffixAgo: "ކުރިން",
17
+ suffixFromNow: "ފަހުން",
18
+ seconds: "ސިކުންތުކޮޅެއް",
19
+ minute: "މިނިޓެއްވަރު",
20
+ minutes: "%d މިނިޓު",
21
+ hour: "ގަޑިއެއްވަރު",
22
+ hours: "ގާތްގަނޑަކަށް %d ގަޑިއިރު",
23
+ day: "އެއް ދުވަސް",
24
+ days: "މީގެ %d ދުވަސް",
25
+ month: "މަހެއްވަރު",
26
+ months: "މީގެ %d މަސް",
27
+ year: "އަހަރެއްވަރު",
28
+ years: "މީގެ %d އަހަރު",
29
+ wordSeparator: " ",
30
+ numbers: [],
31
+ };
32
+ });
js/timeago/locales/jquery.timeago.el.js CHANGED
@@ -1,18 +1,28 @@
1
- // Greek
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "πριν",
4
- prefixFromNow: "σε",
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "λιγότερο από ένα λεπτό",
8
- minute: "περίπου ένα λεπτό",
9
- minutes: "%d λεπτά",
10
- hour: "περίπου μία ώρα",
11
- hours: "περίπου %d ώρες",
12
- day: "μία μέρα",
13
- days: "%d μέρες",
14
- month: "περίπου ένα μήνα",
15
- months: "%d μήνες",
16
- year: "περίπου ένα χρόνο",
17
- years: "%d χρόνια"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Greek
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "πριν",
13
+ prefixFromNow: "σε",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "λιγότερο από ένα λεπτό",
17
+ minute: "περίπου ένα λεπτό",
18
+ minutes: "%d λεπτά",
19
+ hour: "περίπου μία ώρα",
20
+ hours: "περίπου %d ώρες",
21
+ day: "μία μέρα",
22
+ days: "%d μέρες",
23
+ month: "περίπου ένα μήνα",
24
+ months: "%d μήνες",
25
+ year: "περίπου ένα χρόνο",
26
+ years: "%d χρόνια",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.en-short.js CHANGED
@@ -1,20 +1,30 @@
1
- // English shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1d",
13
- days: "%dd",
14
- month: "1mo",
15
- months: "%dmo",
16
- year: "1yr",
17
- years: "%dyr",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // English shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1d",
22
+ days: "%dd",
23
+ month: "1mo",
24
+ months: "%dmo",
25
+ year: "1yr",
26
+ years: "%dyr",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.en.js CHANGED
@@ -1,20 +1,30 @@
1
- // English (Template)
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "ago",
6
- suffixFromNow: "from now",
7
- seconds: "less than a minute",
8
- minute: "about a minute",
9
- minutes: "%d minutes",
10
- hour: "about an hour",
11
- hours: "about %d hours",
12
- day: "a day",
13
- days: "%d days",
14
- month: "about a month",
15
- months: "%d months",
16
- year: "about a year",
17
- years: "%d years",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // English (Template)
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "ago",
15
+ suffixFromNow: "from now",
16
+ seconds: "less than a minute",
17
+ minute: "about a minute",
18
+ minutes: "%d minutes",
19
+ hour: "about an hour",
20
+ hours: "about %d hours",
21
+ day: "a day",
22
+ days: "%d days",
23
+ month: "about a month",
24
+ months: "%d months",
25
+ year: "about a year",
26
+ years: "%d years",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.es-short.js CHANGED
@@ -1,20 +1,30 @@
1
- // Spanish shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1d",
13
- days: "%dd",
14
- month: "1me",
15
- months: "%dme",
16
- year: "1a",
17
- years: "%da",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Spanish shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1d",
22
+ days: "%dd",
23
+ month: "1me",
24
+ months: "%dme",
25
+ year: "1a",
26
+ years: "%da",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.es.js CHANGED
@@ -1,18 +1,28 @@
1
- // Spanish
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "hace",
4
- prefixFromNow: "dentro de",
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "menos de un minuto",
8
- minute: "un minuto",
9
- minutes: "unos %d minutos",
10
- hour: "una hora",
11
- hours: "%d horas",
12
- day: "un día",
13
- days: "%d días",
14
- month: "un mes",
15
- months: "%d meses",
16
- year: "un año",
17
- years: "%d años"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Spanish
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "hace",
13
+ prefixFromNow: "dentro de",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "menos de un minuto",
17
+ minute: "un minuto",
18
+ minutes: "unos %d minutos",
19
+ hour: "una hora",
20
+ hours: "%d horas",
21
+ day: "un día",
22
+ days: "%d días",
23
+ month: "un mes",
24
+ months: "%d meses",
25
+ year: "un año",
26
+ years: "%d años",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.et.js CHANGED
@@ -1,18 +1,48 @@
1
- // Estonian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "tagasi",
6
- suffixFromNow: "pärast",
7
- seconds: function(n, d) { return d < 0 ? "vähem kui minuti aja" : "vähem kui minut aega"; },
8
- minute: function(n, d) { return d < 0 ? "umbes minuti aja" : "umbes minut aega"; },
9
- minutes: function(n, d) { return d < 0 ? "%d minuti" : "%d minutit"; },
10
- hour: function(n, d) { return d < 0 ? "umbes tunni aja" : "umbes tund aega"; },
11
- hours: function(n, d) { return d < 0 ? "%d tunni" : "%d tundi"; },
12
- day: function(n, d) { return d < 0 ? "umbes päeva" : "umbes päev"; },
13
- days: function(n, d) { return d < 0 ? "%d päeva" : "%d päeva"; },
14
- month: function(n, d) { return d < 0 ? "umbes kuu aja" : "umbes kuu aega"; },
15
- months: function(n, d) { return d < 0 ? "%d kuu" : "%d kuud"; },
16
- year: function(n, d) { return d < 0 ? "umbes aasta aja" : "umbes aasta aega"; },
17
- years: function(n, d) { return d < 0 ? "%d aasta" : "%d aastat"; }
18
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Estonian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "tagasi",
15
+ suffixFromNow: "pärast",
16
+ seconds: function (n, d) {
17
+ return d < 0 ? "vähem kui minuti aja" : "vähem kui minut aega";
18
+ },
19
+ minute: function (n, d) {
20
+ return d < 0 ? "umbes minuti aja" : "umbes minut aega";
21
+ },
22
+ minutes: function (n, d) {
23
+ return d < 0 ? "%d minuti" : "%d minutit";
24
+ },
25
+ hour: function (n, d) {
26
+ return d < 0 ? "umbes tunni aja" : "umbes tund aega";
27
+ },
28
+ hours: function (n, d) {
29
+ return d < 0 ? "%d tunni" : "%d tundi";
30
+ },
31
+ day: function (n, d) {
32
+ return d < 0 ? "umbes päeva" : "umbes päev";
33
+ },
34
+ days: "%d päeva",
35
+ month: function (n, d) {
36
+ return d < 0 ? "umbes kuu aja" : "umbes kuu aega";
37
+ },
38
+ months: function (n, d) {
39
+ return d < 0 ? "%d kuu" : "%d kuud";
40
+ },
41
+ year: function (n, d) {
42
+ return d < 0 ? "umbes aasta aja" : "umbes aasta aega";
43
+ },
44
+ years: function (n, d) {
45
+ return d < 0 ? "%d aasta" : "%d aastat";
46
+ },
47
+ };
48
+ });
js/timeago/locales/jquery.timeago.eu.js CHANGED
@@ -1,17 +1,27 @@
1
- jQuery.timeago.settings.strings = {
2
- prefixAgo: "duela",
3
- prefixFromNow: "hemendik",
4
- suffixAgo: "",
5
- suffixFromNow: "barru",
6
- seconds: "minutu bat bainu gutxiago",
7
- minute: "minutu bat",
8
- minutes: "%d minutu inguru",
9
- hour: "ordu bat",
10
- hours: "%d ordu",
11
- day: "egun bat",
12
- days: "%d egun",
13
- month: "hilabete bat",
14
- months: "%d hilabete",
15
- year: "urte bat",
16
- years: "%d urte"
17
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ jQuery.timeago.settings.strings = {
11
+ prefixAgo: "duela",
12
+ prefixFromNow: "hemendik",
13
+ suffixAgo: "",
14
+ suffixFromNow: "barru",
15
+ seconds: "minutu bat bainu gutxiago",
16
+ minute: "minutu bat",
17
+ minutes: "%d minutu inguru",
18
+ hour: "ordu bat",
19
+ hours: "%d ordu",
20
+ day: "egun bat",
21
+ days: "%d egun",
22
+ month: "hilabete bat",
23
+ months: "%d hilabete",
24
+ year: "urte bat",
25
+ years: "%d urte",
26
+ };
27
+ });
js/timeago/locales/jquery.timeago.fa-short.js CHANGED
@@ -1,20 +1,30 @@
1
- // persion shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1دقیقه",
8
- minute: "1دقیقه",
9
- minutes: "%dدقیقه",
10
- hour: "1ساعت",
11
- hours: "%dساعت",
12
- day: "1روز",
13
- days: "%dروز",
14
- month: "1ماه",
15
- months: "%dماه",
16
- year: "1سال",
17
- years: "%dسال",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // persion shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1دقیقه",
17
+ minute: "1دقیقه",
18
+ minutes: "%dدقیقه",
19
+ hour: "1ساعت",
20
+ hours: "%dساعت",
21
+ day: "1روز",
22
+ days: "%dروز",
23
+ month: "1ماه",
24
+ months: "%dماه",
25
+ year: "1سال",
26
+ years: "%dسال",
27
+ wordSeparator: " ",
28
+ numbers: ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.fa.js CHANGED
@@ -1,22 +1,32 @@
1
- 
2
- // Persian
3
- // Use DIR attribute for RTL text in Persian Language for ABBR tag .
4
- // By MB.seifollahi@gmail.com
5
- jQuery.timeago.settings.strings = {
6
- prefixAgo: null,
7
- prefixFromNow: null,
8
- suffixAgo: "پیش",
9
- suffixFromNow: "از حال",
10
- seconds: "کمتر از یک دقیقه",
11
- minute: "حدود یک دقیقه",
12
- minutes: "%d دقیقه",
13
- hour: "حدود یک ساعت",
14
- hours: "حدود %d ساعت",
15
- day: "یک روز",
16
- days: "%d روز",
17
- month: "حدود یک ماه",
18
- months: "%d ماه",
19
- year: "حدود یک سال",
20
- years: "%d سال",
21
- wordSeparator: " "
22
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Persian
11
+ // Use DIR attribute for RTL text in Persian Language for ABBR tag .
12
+ // By MB.seifollahi@gmail.com
13
+ jQuery.timeago.settings.strings = {
14
+ prefixAgo: null,
15
+ prefixFromNow: null,
16
+ suffixAgo: "پیش",
17
+ suffixFromNow: "از حال",
18
+ seconds: "کمتر از یک دقیقه",
19
+ minute: "حدود یک دقیقه",
20
+ minutes: "%d دقیقه",
21
+ hour: "حدود یک ساعت",
22
+ hours: "حدود %d ساعت",
23
+ day: "یک روز",
24
+ days: "%d روز",
25
+ month: "حدود یک ماه",
26
+ months: "%d ماه",
27
+ year: "حدود یک سال",
28
+ years: "%d سال",
29
+ wordSeparator: " ",
30
+ numbers: ["۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹"],
31
+ };
32
+ });
js/timeago/locales/jquery.timeago.fi.js CHANGED
@@ -1,28 +1,38 @@
1
- // Finnish
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "sitten",
6
- suffixFromNow: "tulevaisuudessa",
7
- seconds: "alle minuutti",
8
- minute: "minuutti",
9
- minutes: "%d minuuttia",
10
- hour: "tunti",
11
- hours: "%d tuntia",
12
- day: "päivä",
13
- days: "%d päivää",
14
- month: "kuukausi",
15
- months: "%d kuukautta",
16
- year: "vuosi",
17
- years: "%d vuotta"
18
- };
 
 
 
 
 
 
 
 
 
19
 
20
- // The above is not a great localization because one would usually
21
- // write "2 days ago" in Finnish as "2 päivää sitten", however
22
- // one would write "2 days into the future" as "2:n päivän päästä"
23
- // which cannot be achieved with localization support this simple.
24
- // This is because Finnish has word suffixes (attached directly
25
- // to the end of the word). The word "day" is "päivä" in Finnish.
26
- // As workaround, the above localizations will say
27
- // "2 päivää tulevaisuudessa" which is understandable but
28
- // not as fluent.
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Finnish
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "sitten",
15
+ suffixFromNow: "tulevaisuudessa",
16
+ seconds: "alle minuutti",
17
+ minute: "minuutti",
18
+ minutes: "%d minuuttia",
19
+ hour: "tunti",
20
+ hours: "%d tuntia",
21
+ day: "päivä",
22
+ days: "%d päivää",
23
+ month: "kuukausi",
24
+ months: "%d kuukautta",
25
+ year: "vuosi",
26
+ years: "%d vuotta",
27
+ };
28
 
29
+ // The above is not a great localization because one would usually
30
+ // write "2 days ago" in Finnish as "2 päivää sitten", however
31
+ // one would write "2 days into the future" as "2:n päivän päästä"
32
+ // which cannot be achieved with localization support this simple.
33
+ // This is because Finnish has word suffixes (attached directly
34
+ // to the end of the word). The word "day" is "päivä" in Finnish.
35
+ // As workaround, the above localizations will say
36
+ // "2 päivää tulevaisuudessa" which is understandable but
37
+ // not as fluent.
38
+ });
js/timeago/locales/jquery.timeago.fr-short.js CHANGED
@@ -1,16 +1,26 @@
1
- // French shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "il y a",
4
- prefixFromNow: "d'ici",
5
- seconds: "moins d'une minute",
6
- minute: "une minute",
7
- minutes: "%d minutes",
8
- hour: "une heure",
9
- hours: "%d heures",
10
- day: "un jour",
11
- days: "%d jours",
12
- month: "un mois",
13
- months: "%d mois",
14
- year: "un an",
15
- years: "%d ans"
16
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // French shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "il y a",
13
+ prefixFromNow: "d'ici",
14
+ seconds: "moins d'une minute",
15
+ minute: "une minute",
16
+ minutes: "%d minutes",
17
+ hour: "une heure",
18
+ hours: "%d heures",
19
+ day: "un jour",
20
+ days: "%d jours",
21
+ month: "un mois",
22
+ months: "%d mois",
23
+ year: "un an",
24
+ years: "%d ans",
25
+ };
26
+ });
js/timeago/locales/jquery.timeago.fr.js CHANGED
@@ -1,17 +1,27 @@
1
- // French
2
- jQuery.timeago.settings.strings = {
3
- // environ ~= about, it's optional
4
- prefixAgo: "il y a",
5
- prefixFromNow: "d'ici",
6
- seconds: "moins d'une minute",
7
- minute: "environ une minute",
8
- minutes: "environ %d minutes",
9
- hour: "environ une heure",
10
- hours: "environ %d heures",
11
- day: "environ un jour",
12
- days: "environ %d jours",
13
- month: "environ un mois",
14
- months: "environ %d mois",
15
- year: "un an",
16
- years: "%d ans"
17
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // French
11
+ jQuery.timeago.settings.strings = {
12
+ // environ ~= about, it's optional
13
+ prefixAgo: "il y a",
14
+ prefixFromNow: "d'ici",
15
+ seconds: "moins d'une minute",
16
+ minute: "environ une minute",
17
+ minutes: "environ %d minutes",
18
+ hour: "environ une heure",
19
+ hours: "environ %d heures",
20
+ day: "environ un jour",
21
+ days: "environ %d jours",
22
+ month: "environ un mois",
23
+ months: "environ %d mois",
24
+ year: "un an",
25
+ years: "%d ans",
26
+ };
27
+ });
js/timeago/locales/jquery.timeago.gl.js CHANGED
@@ -1,18 +1,28 @@
1
- // Galician
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "hai",
4
- prefixFromNow: "dentro de",
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "menos dun minuto",
8
- minute: "un minuto",
9
- minutes: "uns %d minutos",
10
- hour: "unha hora",
11
- hours: "%d horas",
12
- day: "un día",
13
- days: "%d días",
14
- month: "un mes",
15
- months: "%d meses",
16
- year: "un ano",
17
- years: "%d anos"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Galician
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "hai",
13
+ prefixFromNow: "dentro de",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "menos dun minuto",
17
+ minute: "un minuto",
18
+ minutes: "uns %d minutos",
19
+ hour: "unha hora",
20
+ hours: "%d horas",
21
+ day: "un día",
22
+ days: "%d días",
23
+ month: "un mes",
24
+ months: "%d meses",
25
+ year: "un ano",
26
+ years: "%d anos",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.he.js CHANGED
@@ -1,16 +1,34 @@
1
- // Hebrew
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "לפני",
4
- prefixFromNow: "עוד",
5
- seconds: "פחות מדקה",
6
- minute: "דקה",
7
- minutes: "%d דקות",
8
- hour: "שעה",
9
- hours: function(number){return (number==2) ? "שעתיים" : "%d שעות";},
10
- day: "יום",
11
- days: function(number){return (number==2) ? "יומיים" : "%d ימים";},
12
- month: "חודש",
13
- months: function(number){return (number==2) ? "חודשיים" : "%d חודשים";},
14
- year: "שנה",
15
- years: function(number){return (number==2) ? "שנתיים" : "%d שנים";}
16
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Hebrew
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "לפני",
13
+ prefixFromNow: "עוד",
14
+ seconds: "פחות מדקה",
15
+ minute: "דקה",
16
+ minutes: "%d דקות",
17
+ hour: "שעה",
18
+ hours: function (number) {
19
+ return number === 2 ? "שעתיים" : "%d שעות";
20
+ },
21
+ day: "יום",
22
+ days: function (number) {
23
+ return number === 2 ? "יומיים" : "%d ימים";
24
+ },
25
+ month: "חודש",
26
+ months: function (number) {
27
+ return number === 2 ? "חודשיים" : "%d חודשים";
28
+ },
29
+ year: "שנה",
30
+ years: function (number) {
31
+ return number === 2 ? "שנתיים" : "%d שנים";
32
+ },
33
+ };
34
+ });
js/timeago/locales/jquery.timeago.hr.js CHANGED
@@ -1,49 +1,54 @@
1
- // Croatian
2
- (function () {
3
- var numpf;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- numpf = function (n, f, s, t) {
6
- var n10;
7
- n10 = n % 10;
8
- if (n10 === 1 && (n === 1 || n > 20)) {
9
- return f;
10
- } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
11
- return s;
12
- } else {
13
- return t;
14
- }
15
- };
16
-
17
- jQuery.timeago.settings.strings = {
18
- prefixAgo: "prije",
19
- prefixFromNow: "za",
20
- suffixAgo: null,
21
- suffixFromNow: null,
22
- second: "sekundu",
23
- seconds: function (value) {
24
- return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi");
25
- },
26
- minute: "oko minutu",
27
- minutes: function (value) {
28
- return numpf(value, "%d minutu", "%d minute", "%d minuta");
29
- },
30
- hour: "oko jedan sat",
31
- hours: function (value) {
32
- return numpf(value, "%d sat", "%d sata", "%d sati");
33
- },
34
- day: "jedan dan",
35
- days: function (value) {
36
- return numpf(value, "%d dan", "%d dana", "%d dana");
37
- },
38
- month: "mjesec dana",
39
- months: function (value) {
40
- return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
41
- },
42
- year: "prije godinu dana",
43
- years: function (value) {
44
- return numpf(value, "%d godinu", "%d godine", "%d godina");
45
- },
46
- wordSeparator: " "
47
- };
48
-
49
- }).call(this);
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Croatian
11
+ var numpf = function (n, f, s, t) {
12
+ var n10;
13
+ n10 = n % 10;
14
+ if (n10 === 1 && (n === 1 || n > 20)) {
15
+ return f;
16
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
17
+ return s;
18
+ } else {
19
+ return t;
20
+ }
21
+ };
22
 
23
+ jQuery.timeago.settings.strings = {
24
+ prefixAgo: "prije",
25
+ prefixFromNow: "za",
26
+ suffixAgo: null,
27
+ suffixFromNow: null,
28
+ second: "sekundu",
29
+ seconds: function (value) {
30
+ return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi");
31
+ },
32
+ minute: "oko minutu",
33
+ minutes: function (value) {
34
+ return numpf(value, "%d minutu", "%d minute", "%d minuta");
35
+ },
36
+ hour: "oko jedan sat",
37
+ hours: function (value) {
38
+ return numpf(value, "%d sat", "%d sata", "%d sati");
39
+ },
40
+ day: "jedan dan",
41
+ days: function (value) {
42
+ return numpf(value, "%d dan", "%d dana", "%d dana");
43
+ },
44
+ month: "mjesec dana",
45
+ months: function (value) {
46
+ return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci");
47
+ },
48
+ year: "prije godinu dana",
49
+ years: function (value) {
50
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
51
+ },
52
+ wordSeparator: " ",
53
+ };
54
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
js/timeago/locales/jquery.timeago.hu.js CHANGED
@@ -1,18 +1,28 @@
1
- // Hungarian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "kevesebb mint egy perce",
8
- minute: "körülbelül egy perce",
9
- minutes: "%d perce",
10
- hour: "körülbelül egy órája",
11
- hours: "körülbelül %d órája",
12
- day: "körülbelül egy napja",
13
- days: "%d napja",
14
- month: "körülbelül egy hónapja",
15
- months: "%d hónapja",
16
- year: "körülbelül egy éve",
17
- years: "%d éve"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Hungarian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "kevesebb mint egy perce",
17
+ minute: "körülbelül egy perce",
18
+ minutes: "%d perce",
19
+ hour: "körülbelül egy órája",
20
+ hours: "körülbelül %d órája",
21
+ day: "körülbelül egy napja",
22
+ days: "%d napja",
23
+ month: "körülbelül egy hónapja",
24
+ months: "%d hónapja",
25
+ year: "körülbelül egy éve",
26
+ years: "%d éve",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.hy.js CHANGED
@@ -1,18 +1,28 @@
1
- // Armenian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "առաջ",
6
- suffixFromNow: "հետո",
7
- seconds: "վայրկյաններ",
8
- minute: "մեկ րոպե",
9
- minutes: "%d րոպե",
10
- hour: "մեկ ժամ",
11
- hours: "%d ժամ",
12
- day: "մեկ օր",
13
- days: "%d օր",
14
- month: "մեկ ամիս",
15
- months: "%d ամիս",
16
- year: "մեկ տարի",
17
- years: "%d տարի"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Armenian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "առաջ",
15
+ suffixFromNow: "հետո",
16
+ seconds: "վայրկյաններ",
17
+ minute: "մեկ րոպե",
18
+ minutes: "%d րոպե",
19
+ hour: "մեկ ժամ",
20
+ hours: "%d ժամ",
21
+ day: "մեկ օր",
22
+ days: "%d օր",
23
+ month: "մեկ ամիս",
24
+ months: "%d ամիս",
25
+ year: "մեկ տարի",
26
+ years: "%d տարի",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.id.js CHANGED
@@ -1,18 +1,28 @@
1
- // Indonesian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "yang lalu",
6
- suffixFromNow: "dari sekarang",
7
- seconds: "kurang dari semenit",
8
- minute: "sekitar satu menit",
9
- minutes: "%d menit",
10
- hour: "sekitar sejam",
11
- hours: "sekitar %d jam",
12
- day: "sehari",
13
- days: "%d hari",
14
- month: "sekitar sebulan",
15
- months: "%d bulan",
16
- year: "sekitar setahun",
17
- years: "%d tahun"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Indonesian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "yang lalu",
15
+ suffixFromNow: "dari sekarang",
16
+ seconds: "kurang dari semenit",
17
+ minute: "sekitar satu menit",
18
+ minutes: "%d menit",
19
+ hour: "sekitar sejam",
20
+ hours: "sekitar %d jam",
21
+ day: "sehari",
22
+ days: "%d hari",
23
+ month: "sekitar sebulan",
24
+ months: "%d bulan",
25
+ year: "sekitar setahun",
26
+ years: "%d tahun",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.is.js CHANGED
@@ -1,19 +1,29 @@
1
- jQuery.timeago.settings.strings = {
2
- prefixAgo: "fyrir",
3
- prefixFromNow: "eftir",
4
- suffixAgo: "síðan",
5
- suffixFromNow: null,
6
- seconds: "minna en mínútu",
7
- minute: "mínútu",
8
- minutes: "%d mínútum",
9
- hour: "klukkutíma",
10
- hours: "um %d klukkutímum",
11
- day: "degi",
12
- days: "%d dögum",
13
- month: "mánuði",
14
- months: "%d mánuðum",
15
- year: "ári",
16
- years: "%d árum",
17
- wordSeparator: " ",
18
- numbers: []
19
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ jQuery.timeago.settings.strings = {
11
+ prefixAgo: "fyrir",
12
+ prefixFromNow: "eftir",
13
+ suffixAgo: "síðan",
14
+ suffixFromNow: null,
15
+ seconds: "minna en mínútu",
16
+ minute: "mínútu",
17
+ minutes: "%d mínútum",
18
+ hour: "klukkutíma",
19
+ hours: "um %d klukkutímum",
20
+ day: "degi",
21
+ days: "%d dögum",
22
+ month: "mánuði",
23
+ months: "%d mánuðum",
24
+ year: "ári",
25
+ years: "%d árum",
26
+ wordSeparator: " ",
27
+ numbers: [],
28
+ };
29
+ });
js/timeago/locales/jquery.timeago.it-short.js CHANGED
@@ -1,20 +1,30 @@
1
- // Italian shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1g",
13
- days: "%dg",
14
- month: "1me",
15
- months: "%dme",
16
- year: "1a",
17
- years: "%da",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Italian shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1g",
22
+ days: "%dg",
23
+ month: "1me",
24
+ months: "%dme",
25
+ year: "1a",
26
+ years: "%da",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.it.js CHANGED
@@ -1,16 +1,28 @@
1
- // Italian
2
- jQuery.timeago.settings.strings = {
3
- suffixAgo: "fa",
4
- suffixFromNow: "da ora",
5
- seconds: "meno di un minuto",
6
- minute: "circa un minuto",
7
- minutes: "%d minuti",
8
- hour: "circa un'ora",
9
- hours: "circa %d ore",
10
- day: "un giorno",
11
- days: "%d giorni",
12
- month: "circa un mese",
13
- months: "%d mesi",
14
- year: "circa un anno",
15
- years: "%d anni"
16
- };
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Italian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: "fra",
14
+ suffixAgo: "fa",
15
+ suffixFromNow: null,
16
+ seconds: "meno di un minuto",
17
+ minute: "circa un minuto",
18
+ minutes: "%d minuti",
19
+ hour: "circa un'ora",
20
+ hours: "circa %d ore",
21
+ day: "un giorno",
22
+ days: "%d giorni",
23
+ month: "circa un mese",
24
+ months: "%d mesi",
25
+ year: "circa un anno",
26
+ years: "%d anni",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.ja.js CHANGED
@@ -1,19 +1,29 @@
1
- // Japanese
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "",
4
- prefixFromNow: "今から",
5
- suffixAgo: "",
6
- suffixFromNow: "後",
7
- seconds: "1 分未満",
8
- minute: "約 1 分",
9
- minutes: "%d 分",
10
- hour: "約 1 時間",
11
- hours: "約 %d 時間",
12
- day: "約 1 日",
13
- days: "約 %d 日",
14
- month: "約 1 ヶ月",
15
- months: "約 %d ヶ月",
16
- year: "1 ",
17
- years: "約 %d ",
18
- wordSeparator: ""
19
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Japanese
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "",
13
+ prefixFromNow: "今から",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1 分未満",
17
+ minute: "約 1 ",
18
+ minutes: "%d 分",
19
+ hour: "約 1 時間",
20
+ hours: "約 %d 時間",
21
+ day: "約 1 日",
22
+ days: "約 %d 日",
23
+ month: "約 1 ヶ月",
24
+ months: "約 %d ヶ月",
25
+ year: "約 1 年",
26
+ years: "約 %d 年",
27
+ wordSeparator: "",
28
+ };
29
+ });
js/timeago/locales/jquery.timeago.jv.js CHANGED
@@ -1,18 +1,28 @@
1
- // Javanesse (Boso Jowo)
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "kepungkur",
6
- suffixFromNow: "seko saiki",
7
- seconds: "kurang seko sakmenit",
8
- minute: "kurang luwih sakmenit",
9
- minutes: "%d menit",
10
- hour: "kurang luwih sakjam",
11
- hours: "kurang luwih %d jam",
12
- day: "sedina",
13
- days: "%d dina",
14
- month: "kurang luwih sewulan",
15
- months: "%d wulan",
16
- year: "kurang luwih setahun",
17
- years: "%d tahun"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Javanesse (Boso Jowo)
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "kepungkur",
15
+ suffixFromNow: "seko saiki",
16
+ seconds: "kurang seko sakmenit",
17
+ minute: "kurang luwih sakmenit",
18
+ minutes: "%d menit",
19
+ hour: "kurang luwih sakjam",
20
+ hours: "kurang luwih %d jam",
21
+ day: "sedina",
22
+ days: "%d dina",
23
+ month: "kurang luwih sewulan",
24
+ months: "%d wulan",
25
+ year: "kurang luwih setahun",
26
+ years: "%d tahun",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.ko.js CHANGED
@@ -1,20 +1,30 @@
1
- // Korean
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "후",
7
- seconds: "1분",
8
- minute: "약 1분",
9
- minutes: "%d분",
10
- hour: "약 1시간",
11
- hours: "약 %d시간",
12
- day: "하루",
13
- days: "%d일",
14
- month: "약 1개월",
15
- months: "%d개월",
16
- year: "1",
17
- years: "%d년",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Korean
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1",
17
+ minute: "약 1분",
18
+ minutes: "%d분",
19
+ hour: "약 1시간",
20
+ hours: "약 %d시간",
21
+ day: "하루",
22
+ days: "%d일",
23
+ month: "약 1개월",
24
+ months: "%d개월",
25
+ year: "약 1년",
26
+ years: "%d년",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.ky.js CHANGED
@@ -1,13 +1,21 @@
1
- // Russian
2
- (function() {
 
 
 
 
 
 
 
 
3
  function numpf(n, f, s, t) {
4
  // f - 1, 21, 31, ...
5
  // s - 2-4, 22-24, 32-34 ...
6
  // t - 5-20, 25-30, ...
7
  var n10 = n % 10;
8
- if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) {
9
  return f;
10
- } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
11
  return s;
12
  } else {
13
  return t;
@@ -21,14 +29,24 @@
21
  suffixFromNow: null,
22
  seconds: "1 минуттан аз",
23
  minute: "минута",
24
- minutes: function(value) { return numpf(value, "%d минута", "%d минута", "%d минут"); },
 
 
25
  hour: "саат",
26
- hours: function(value) { return numpf(value, "%d саат", "%d саат", "%d саат"); },
 
 
27
  day: "күн",
28
- days: function(value) { return numpf(value, "%d күн", "%d күн", "%d күн"); },
 
 
29
  month: "ай",
30
- months: function(value) { return numpf(value, "%d ай", "%d ай", "%d ай"); },
 
 
31
  year: "жыл",
32
- years: function(value) { return numpf(value, "%d жыл", "%d жыл", "%d жыл"); }
 
 
33
  };
34
- })();
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Russian
11
  function numpf(n, f, s, t) {
12
  // f - 1, 21, 31, ...
13
  // s - 2-4, 22-24, 32-34 ...
14
  // t - 5-20, 25-30, ...
15
  var n10 = n % 10;
16
+ if (n10 === 1 && (n === 1 || n > 20)) {
17
  return f;
18
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
19
  return s;
20
  } else {
21
  return t;
29
  suffixFromNow: null,
30
  seconds: "1 минуттан аз",
31
  minute: "минута",
32
+ minutes: function (value) {
33
+ return numpf(value, "%d минута", "%d минута", "%d минут");
34
+ },
35
  hour: "саат",
36
+ hours: function (value) {
37
+ return numpf(value, "%d саат", "%d саат", "%d саат");
38
+ },
39
  day: "күн",
40
+ days: function (value) {
41
+ return numpf(value, "%d күн", "%d күн", "%d күн");
42
+ },
43
  month: "ай",
44
+ months: function (value) {
45
+ return numpf(value, "%d ай", "%d ай", "%d ай");
46
+ },
47
  year: "жыл",
48
+ years: function (value) {
49
+ return numpf(value, "%d жыл", "%d жыл", "%d жыл");
50
+ },
51
  };
52
+ });
js/timeago/locales/jquery.timeago.lt.js CHANGED
@@ -1,20 +1,30 @@
1
- //Lithuanian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "prieš",
4
- prefixFromNow: null,
5
- suffixAgo: null,
6
- suffixFromNow: "nuo dabar",
7
- seconds: "%d sek.",
8
- minute: "min.",
9
- minutes: "%d min.",
10
- hour: "val.",
11
- hours: "%d val.",
12
- day: "1 d.",
13
- days: "%d d.",
14
- month: "mėn.",
15
- months: "%d mėn.",
16
- year: "metus",
17
- years: "%d metus",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ //Lithuanian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "prieš",
13
+ prefixFromNow: null,
14
+ suffixAgo: null,
15
+ suffixFromNow: "nuo dabar",
16
+ seconds: "%d sek.",
17
+ minute: "min.",
18
+ minutes: "%d min.",
19
+ hour: "val.",
20
+ hours: "%d val.",
21
+ day: "1 d.",
22
+ days: "%d d.",
23
+ month: "mėn.",
24
+ months: "%d mėn.",
25
+ year: "metus",
26
+ years: "%d metus",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.lv.js CHANGED
@@ -1,20 +1,30 @@
1
- //Latvian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "pirms",
4
- prefixFromNow: null,
5
- suffixAgo: null,
6
- suffixFromNow: "no šī brīža",
7
- seconds: "%d sek.",
8
- minute: "min.",
9
- minutes: "%d min.",
10
- hour: "st.",
11
- hours: "%d st.",
12
- day: "1 d.",
13
- days: "%d d.",
14
- month: "mēnesis.",
15
- months: "%d mēnesis.",
16
- year: "gads",
17
- years: "%d gads",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ //Latvian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "pirms",
13
+ prefixFromNow: null,
14
+ suffixAgo: null,
15
+ suffixFromNow: "no šī brīža",
16
+ seconds: "%d sek.",
17
+ minute: "min.",
18
+ minutes: "%d min.",
19
+ hour: "st.",
20
+ hours: "%d st.",
21
+ day: "1 d.",
22
+ days: "%d d.",
23
+ month: "mēnesis.",
24
+ months: "%d mēnesis.",
25
+ year: "gads",
26
+ years: "%d gads",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.mk.js CHANGED
@@ -1,20 +1,30 @@
1
- // Macedonian
2
- (function() {
3
- jQuery.timeago.settings.strings={
4
- prefixAgo: "пред",
5
- prefixFromNow: "за",
6
- suffixAgo: null,
7
- suffixFromNow: null,
8
- seconds: "%d секунди",
9
- minute: "%d минута",
10
- minutes: "%d минути",
11
- hour: "%d час",
12
- hours: "%d часа",
13
- day: "%d ден",
14
- days: "%d денови" ,
15
- month: "%d месец",
16
- months: "%d месеци",
17
- year: "%d година",
18
- years: "%d години"
19
- };
20
- })();
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Macedonian
11
+ (function () {
12
+ jQuery.timeago.settings.strings = {
13
+ prefixAgo: "пред",
14
+ prefixFromNow: "за",
15
+ suffixAgo: null,
16
+ suffixFromNow: null,
17
+ seconds: "%d секунди",
18
+ minute: "%d минута",
19
+ minutes: "%d минути",
20
+ hour: "%d час",
21
+ hours: "%d часа",
22
+ day: "%d ден",
23
+ days: "%d денови",
24
+ month: "%d месец",
25
+ months: "%d месеци",
26
+ year: "%d година",
27
+ years: "%d години",
28
+ };
29
+ })();
30
+ });
js/timeago/locales/jquery.timeago.nl.js CHANGED
@@ -1,20 +1,30 @@
1
- // Dutch
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: "over",
5
- suffixAgo: "geleden",
6
- suffixFromNow: null,
7
- seconds: "minder dan een minuut",
8
- minute: "ongeveer een minuut",
9
- minutes: "%d minuten",
10
- hour: "ongeveer een uur",
11
- hours: "ongeveer %d uur",
12
- day: "een dag",
13
- days: "%d dagen",
14
- month: "ongeveer een maand",
15
- months: "%d maanden",
16
- year: "ongeveer een jaar",
17
- years: "%d jaar",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Dutch
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: "over",
14
+ suffixAgo: "geleden",
15
+ suffixFromNow: null,
16
+ seconds: "minder dan een minuut",
17
+ minute: "ongeveer een minuut",
18
+ minutes: "%d minuten",
19
+ hour: "ongeveer een uur",
20
+ hours: "ongeveer %d uur",
21
+ day: "een dag",
22
+ days: "%d dagen",
23
+ month: "ongeveer een maand",
24
+ months: "%d maanden",
25
+ year: "ongeveer een jaar",
26
+ years: "%d jaar",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.no.js CHANGED
@@ -1,18 +1,28 @@
1
- // Norwegian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "for",
4
- prefixFromNow: "om",
5
- suffixAgo: "siden",
6
- suffixFromNow: "",
7
- seconds: "mindre enn et minutt",
8
- minute: "ca. et minutt",
9
- minutes: "%d minutter",
10
- hour: "ca. en time",
11
- hours: "ca. %d timer",
12
- day: "en dag",
13
- days: "%d dager",
14
- month: "ca. en måned",
15
- months: "%d måneder",
16
- year: "ca. et år",
17
- years: "%d år"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Norwegian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "for",
13
+ prefixFromNow: "om",
14
+ suffixAgo: "siden",
15
+ suffixFromNow: "",
16
+ seconds: "mindre enn et minutt",
17
+ minute: "ca. et minutt",
18
+ minutes: "%d minutter",
19
+ hour: "ca. en time",
20
+ hours: "ca. %d timer",
21
+ day: "en dag",
22
+ days: "%d dager",
23
+ month: "ca. en måned",
24
+ months: "%d måneder",
25
+ year: "ca. et år",
26
+ years: "%d år",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.pl.js CHANGED
@@ -1,10 +1,18 @@
1
- // Polish
2
- (function() {
 
 
 
 
 
 
 
 
3
  function numpf(n, s, t) {
4
  // s - 2-4, 22-24, 32-34 ...
5
  // t - 5-21, 25-31, ...
6
  var n10 = n % 10;
7
- if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
8
  return s;
9
  } else {
10
  return t;
@@ -18,14 +26,22 @@
18
  suffixFromNow: null,
19
  seconds: "mniej niż minutę",
20
  minute: "minutę",
21
- minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); },
 
 
22
  hour: "godzinę",
23
- hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); },
 
 
24
  day: "dzień",
25
  days: "%d dni",
26
  month: "miesiąc",
27
- months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); },
 
 
28
  year: "rok",
29
- years: function(value) { return numpf(value, "%d lata", "%d lat"); }
 
 
30
  };
31
- })();
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Polish
11
  function numpf(n, s, t) {
12
  // s - 2-4, 22-24, 32-34 ...
13
  // t - 5-21, 25-31, ...
14
  var n10 = n % 10;
15
+ if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
16
  return s;
17
  } else {
18
  return t;
26
  suffixFromNow: null,
27
  seconds: "mniej niż minutę",
28
  minute: "minutę",
29
+ minutes: function (value) {
30
+ return numpf(value, "%d minuty", "%d minut");
31
+ },
32
  hour: "godzinę",
33
+ hours: function (value) {
34
+ return numpf(value, "%d godziny", "%d godzin");
35
+ },
36
  day: "dzień",
37
  days: "%d dni",
38
  month: "miesiąc",
39
+ months: function (value) {
40
+ return numpf(value, "%d miesiące", "%d miesięcy");
41
+ },
42
  year: "rok",
43
+ years: function (value) {
44
+ return numpf(value, "%d lata", "%d lat");
45
+ },
46
  };
47
+ });
js/timeago/locales/jquery.timeago.pt-br-short.js CHANGED
@@ -1,20 +1,30 @@
1
- // Portuguese Brasil shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1d",
13
- days: "%dd",
14
- month: "1M",
15
- months: "%dM",
16
- year: "1a",
17
- years: "%da",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Portuguese Brasil shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1d",
22
+ days: "%dd",
23
+ month: "1M",
24
+ months: "%dM",
25
+ year: "1a",
26
+ years: "%da",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.pt-br.js CHANGED
@@ -1,18 +1,28 @@
1
- // Brazilian Portuguese
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "",
4
- prefixFromNow: "em",
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "alguns segundos",
8
- minute: "um minuto",
9
- minutes: "%d minutos",
10
- hour: "uma hora",
11
- hours: "%d horas",
12
- day: "um dia",
13
- days: "%d dias",
14
- month: "um mês",
15
- months: "%d meses",
16
- year: "um ano",
17
- years: "%d anos"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Brazilian Portuguese
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "",
13
+ prefixFromNow: "em",
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "alguns segundos",
17
+ minute: "um minuto",
18
+ minutes: "%d minutos",
19
+ hour: "uma hora",
20
+ hours: "%d horas",
21
+ day: "um dia",
22
+ days: "%d dias",
23
+ month: "um mês",
24
+ months: "%d meses",
25
+ year: "um ano",
26
+ years: "%d anos",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.pt-short.js CHANGED
@@ -1,20 +1,30 @@
1
- // Portuguese shortened
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "1m",
8
- minute: "1m",
9
- minutes: "%dm",
10
- hour: "1h",
11
- hours: "%dh",
12
- day: "1d",
13
- days: "%dd",
14
- month: "1M",
15
- months: "%dM",
16
- year: "1a",
17
- years: "%da",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Portuguese shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1m",
17
+ minute: "1m",
18
+ minutes: "%dm",
19
+ hour: "1h",
20
+ hours: "%dh",
21
+ day: "1d",
22
+ days: "%dd",
23
+ month: "1M",
24
+ months: "%dM",
25
+ year: "1a",
26
+ years: "%da",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.pt.js CHANGED
@@ -1,16 +1,26 @@
1
- // Portuguese
2
- jQuery.timeago.settings.strings = {
3
- suffixAgo: "atrás",
4
- suffixFromNow: "a partir de agora",
5
- seconds: "menos de um minuto",
6
- minute: "cerca de um minuto",
7
- minutes: "%d minutos",
8
- hour: "cerca de uma hora",
9
- hours: "cerca de %d horas",
10
- day: "um dia",
11
- days: "%d dias",
12
- month: "cerca de um mês",
13
- months: "%d meses",
14
- year: "cerca de um ano",
15
- years: "%d anos"
16
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Portuguese
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "",
13
+ prefixFromNow: "daqui a",
14
+ seconds: "menos de um minuto",
15
+ minute: "cerca de um minuto",
16
+ minutes: "%d minutos",
17
+ hour: "cerca de uma hora",
18
+ hours: "cerca de %d horas",
19
+ day: "um dia",
20
+ days: "%d dias",
21
+ month: "cerca de um mês",
22
+ months: "%d meses",
23
+ year: "cerca de um ano",
24
+ years: "%d anos",
25
+ };
26
+ });
js/timeago/locales/jquery.timeago.ro.js CHANGED
@@ -1,18 +1,28 @@
1
- // Romanian
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "acum",
4
- prefixFromNow: "in timp de",
5
- suffixAgo: "",
6
- suffixFromNow: "",
7
- seconds: "mai putin de un minut",
8
- minute: "un minut",
9
- minutes: "%d minute",
10
- hour: "o ora",
11
- hours: "%d ore",
12
- day: "o zi",
13
- days: "%d zile",
14
- month: "o luna",
15
- months: "%d luni",
16
- year: "un an",
17
- years: "%d ani"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Romanian
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "acum",
13
+ prefixFromNow: "in timp de",
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "mai putin de un minut",
17
+ minute: "un minut",
18
+ minutes: "%d minute",
19
+ hour: "o ora",
20
+ hours: "%d ore",
21
+ day: "o zi",
22
+ days: "%d zile",
23
+ month: "o luna",
24
+ months: "%d luni",
25
+ year: "un an",
26
+ years: "%d ani",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.rs.js CHANGED
@@ -1,49 +1,54 @@
1
- // Serbian
2
- (function () {
3
- var numpf;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- numpf = function (n, f, s, t) {
6
- var n10;
7
- n10 = n % 10;
8
- if (n10 === 1 && (n === 1 || n > 20)) {
9
- return f;
10
- } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
11
- return s;
12
- } else {
13
- return t;
14
- }
15
- };
16
-
17
- jQuery.timeago.settings.strings = {
18
- prefixAgo: "pre",
19
- prefixFromNow: "za",
20
- suffixAgo: null,
21
- suffixFromNow: null,
22
- second: "sekund",
23
- seconds: function (value) {
24
- return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
25
- },
26
- minute: "oko minut",
27
- minutes: function (value) {
28
- return numpf(value, "%d minut", "%d minuta", "%d minuta");
29
- },
30
- hour: "oko jedan sat",
31
- hours: function (value) {
32
- return numpf(value, "%d sat", "%d sata", "%d sati");
33
- },
34
- day: "jedan dan",
35
- days: function (value) {
36
- return numpf(value, "%d dan", "%d dana", "%d dana");
37
- },
38
- month: "mesec dana",
39
- months: function (value) {
40
- return numpf(value, "%d mesec", "%d meseca", "%d meseci");
41
- },
42
- year: "godinu dana",
43
- years: function (value) {
44
- return numpf(value, "%d godinu", "%d godine", "%d godina");
45
- },
46
- wordSeparator: " "
47
- };
48
-
49
- }).call(this);
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Serbian
11
+ var numpf = function (n, f, s, t) {
12
+ var n10;
13
+ n10 = n % 10;
14
+ if (n10 === 1 && (n === 1 || n > 20)) {
15
+ return f;
16
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
17
+ return s;
18
+ } else {
19
+ return t;
20
+ }
21
+ };
22
 
23
+ jQuery.timeago.settings.strings = {
24
+ prefixAgo: "pre",
25
+ prefixFromNow: "za",
26
+ suffixAgo: null,
27
+ suffixFromNow: null,
28
+ second: "sekund",
29
+ seconds: function (value) {
30
+ return numpf(value, "%d sekund", "%d sekunde", "%d sekundi");
31
+ },
32
+ minute: "oko minut",
33
+ minutes: function (value) {
34
+ return numpf(value, "%d minut", "%d minuta", "%d minuta");
35
+ },
36
+ hour: "oko jedan sat",
37
+ hours: function (value) {
38
+ return numpf(value, "%d sat", "%d sata", "%d sati");
39
+ },
40
+ day: "jedan dan",
41
+ days: function (value) {
42
+ return numpf(value, "%d dan", "%d dana", "%d dana");
43
+ },
44
+ month: "mesec dana",
45
+ months: function (value) {
46
+ return numpf(value, "%d mesec", "%d meseca", "%d meseci");
47
+ },
48
+ year: "godinu dana",
49
+ years: function (value) {
50
+ return numpf(value, "%d godinu", "%d godine", "%d godina");
51
+ },
52
+ wordSeparator: " ",
53
+ };
54
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
js/timeago/locales/jquery.timeago.ru.js CHANGED
@@ -1,13 +1,22 @@
1
- // Russian
2
- (function() {
 
 
 
 
 
 
 
 
3
  function numpf(n, f, s, t) {
4
  // f - 1, 21, 31, ...
5
  // s - 2-4, 22-24, 32-34 ...
6
  // t - 5-20, 25-30, ...
 
7
  var n10 = n % 10;
8
- if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) {
9
  return f;
10
- } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
11
  return s;
12
  } else {
13
  return t;
@@ -21,14 +30,24 @@
21
  suffixFromNow: null,
22
  seconds: "меньше минуты",
23
  minute: "минуту",
24
- minutes: function(value) { return numpf(value, "%d минута", "%d минуты", "%d минут"); },
 
 
25
  hour: "час",
26
- hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); },
 
 
27
  day: "день",
28
- days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); },
 
 
29
  month: "месяц",
30
- months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); },
 
 
31
  year: "год",
32
- years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); }
 
 
33
  };
34
- })();
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Russian
11
  function numpf(n, f, s, t) {
12
  // f - 1, 21, 31, ...
13
  // s - 2-4, 22-24, 32-34 ...
14
  // t - 5-20, 25-30, ...
15
+ n = n % 100;
16
  var n10 = n % 10;
17
+ if (n10 === 1 && (n === 1 || n > 20)) {
18
  return f;
19
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
20
  return s;
21
  } else {
22
  return t;
30
  suffixFromNow: null,
31
  seconds: "меньше минуты",
32
  minute: "минуту",
33
+ minutes: function (value) {
34
+ return numpf(value, "%d минуту", "%d минуты", "%d минут");
35
+ },
36
  hour: "час",
37
+ hours: function (value) {
38
+ return numpf(value, "%d час", "%d часа", "%d часов");
39
+ },
40
  day: "день",
41
+ days: function (value) {
42
+ return numpf(value, "%d день", "%d дня", "%d дней");
43
+ },
44
  month: "месяц",
45
+ months: function (value) {
46
+ return numpf(value, "%d месяц", "%d месяца", "%d месяцев");
47
+ },
48
  year: "год",
49
+ years: function (value) {
50
+ return numpf(value, "%d год", "%d года", "%d лет");
51
+ },
52
  };
53
+ });
js/timeago/locales/jquery.timeago.rw.js CHANGED
@@ -1,20 +1,30 @@
1
- // Kinyarwanda
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "hashize",
4
- prefixFromNow: "mu",
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "amasegonda macye",
8
- minute: "umunota",
9
- minutes: "iminota %d",
10
- hour: "isaha",
11
- hours: "amasaha %d",
12
- day: "umunsi",
13
- days: "iminsi %d",
14
- month: "ukwezi",
15
- months: "amezi %d",
16
- year: "umwaka",
17
- years: "imyaka %d",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Kinyarwanda
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "hashize",
13
+ prefixFromNow: "mu",
14
+ suffixAgo: null,
15
+ suffixFromNow: null,
16
+ seconds: "amasegonda macye",
17
+ minute: "umunota",
18
+ minutes: "iminota %d",
19
+ hour: "isaha",
20
+ hours: "amasaha %d",
21
+ day: "umunsi",
22
+ days: "iminsi %d",
23
+ month: "ukwezi",
24
+ months: "amezi %d",
25
+ year: "umwaka",
26
+ years: "imyaka %d",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.si.js CHANGED
@@ -1,18 +1,28 @@
1
- // Sinhalese (SI)
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "පෙර",
6
- suffixFromNow: "පසුව",
7
- seconds: "තත්පර කිහිපයකට",
8
- minute: "මිනිත්තුවකට පමණ",
9
- minutes: "මිනිත්තු %d කට",
10
- hour: "පැයක් පමණ ",
11
- hours: "පැය %d කට පමණ",
12
- day: "දවසක ට",
13
- days: "දවස් %d කට ",
14
- month: "මාසයක් පමණ",
15
- months: "මාස %d කට",
16
- year: "වසරක් පමණ",
17
- years: "වසරක් %d කට පමණ"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Sinhalese (SI)
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "පෙර",
15
+ suffixFromNow: "පසුව",
16
+ seconds: "තත්පර කිහිපයකට",
17
+ minute: "මිනිත්තුවකට පමණ",
18
+ minutes: "මිනිත්තු %d කට",
19
+ hour: "පැයක් පමණ ",
20
+ hours: "පැය %d කට පමණ",
21
+ day: "දවසක ට",
22
+ days: "දවස් %d කට ",
23
+ month: "මාසයක් පමණ",
24
+ months: "මාස %d කට",
25
+ year: "වසරක් පමණ",
26
+ years: "වසරක් %d කට පමණ",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.sk.js CHANGED
@@ -1,18 +1,56 @@
1
- // Slovak
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "pred",
4
- prefixFromNow: null,
5
- suffixAgo: null,
6
- suffixFromNow: null,
7
- seconds: "menej než minútou",
8
- minute: "minútou",
9
- minutes: "%d minútami",
10
- hour: "hodinou",
11
- hours: "%d hodinami",
12
- day: "1 dňom",
13
- days: "%d dňami",
14
- month: "1 mesiacom",
15
- months: "%d mesiacmi",
16
- year: "1 rokom",
17
- years: "%d rokmi"
18
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Slovak
11
+ (function () {
12
+ function f(n, d, a) {
13
+ return a[d >= 0 ? 0 : a.length === 2 || n < 5 ? 1 : 2];
14
+ }
15
+
16
+ jQuery.timeago.settings.strings = {
17
+ prefixAgo: "pred",
18
+ prefixFromNow: "o",
19
+ suffixAgo: null,
20
+ suffixFromNow: null,
21
+ seconds: function (n, d) {
22
+ return f(n, d, ["menej ako minútou", "menej ako minútu"]);
23
+ },
24
+ minute: function (n, d) {
25
+ return f(n, d, ["minútou", "minútu"]);
26
+ },
27
+ minutes: function (n, d) {
28
+ return f(n, d, ["%d minútami", "%d minúty", "%d minút"]);
29
+ },
30
+ hour: function (n, d) {
31
+ return f(n, d, ["hodinou", "hodinu"]);
32
+ },
33
+ hours: function (n, d) {
34
+ return f(n, d, ["%d hodinami", "%d hodiny", "%d hodín"]);
35
+ },
36
+ day: function (n, d) {
37
+ return f(n, d, ["%d dňom", "%d deň"]);
38
+ },
39
+ days: function (n, d) {
40
+ return f(n, d, ["%d dňami", "%d dni", "%d dní"]);
41
+ },
42
+ month: function (n, d) {
43
+ return f(n, d, ["%d mesiacom", "%d mesiac"]);
44
+ },
45
+ months: function (n, d) {
46
+ return f(n, d, ["%d mesiacmi", "%d mesiace", "%d mesiacov"]);
47
+ },
48
+ year: function (n, d) {
49
+ return f(n, d, ["%d rokom", "%d rok"]);
50
+ },
51
+ years: function (n, d) {
52
+ return f(n, d, ["%d rokmi", "%d roky", "%d rokov"]);
53
+ },
54
+ };
55
+ })();
56
+ });
js/timeago/locales/jquery.timeago.sl.js CHANGED
@@ -1,40 +1,59 @@
1
- // Slovenian with support for dual
2
- (function () {
3
- var numpf;
4
- numpf = function (n, a) {
5
- return a[n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0];
6
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- jQuery.timeago.settings.strings = {
9
- prefixAgo: null,
10
- prefixFromNow: "čez",
11
- suffixAgo: "nazaj",
12
- suffixFromNow: null,
13
- second: "sekundo",
14
- seconds: function (value) {
15
- return numpf(value, ["%d sekund", "%d sekundo", "%d sekundi", "%d sekunde"]);
16
- },
17
- minute: "minuto",
18
- minutes: function (value) {
19
- return numpf(value, ["%d minut", "%d minuto", "%d minuti", "%d minute"]);
20
- },
21
- hour: "eno uro",
22
- hours: function (value) {
23
- return numpf(value, ["%d ur", "%d uro", "%d uri", "%d ure"]);
24
- },
25
- day: "en dan",
26
- days: function (value) {
27
- return numpf(value, ["%d dni", "%d dan", "%d dneva", "%d dni"]);
28
- },
29
- month: "en mesec",
30
- months: function (value) {
31
- return numpf(value, ["%d mescov", "%d mesec", "%d mesca", "%d mesce"]);
32
- },
33
- year: "eno leto",
34
- years: function (value) {
35
- return numpf(value, ["%d let", "%d leto", "%d leti", "%d leta"]);
36
- },
37
- wordSeparator: " "
38
- };
39
-
40
- }).call(this);
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Slovenian with support for dual
11
+ var numpf = function (n, a) {
12
+ return a[
13
+ n % 100 === 1
14
+ ? 1
15
+ : n % 100 === 2
16
+ ? 2
17
+ : n % 100 === 3 || n % 100 === 4
18
+ ? 3
19
+ : 0
20
+ ];
21
+ };
22
 
23
+ jQuery.timeago.settings.strings = {
24
+ prefixAgo: null,
25
+ prefixFromNow: "čez",
26
+ suffixAgo: "nazaj",
27
+ suffixFromNow: null,
28
+ second: "sekundo",
29
+ seconds: function (value) {
30
+ return numpf(value, [
31
+ "%d sekund",
32
+ "%d sekundo",
33
+ "%d sekundi",
34
+ "%d sekunde",
35
+ ]);
36
+ },
37
+ minute: "minuto",
38
+ minutes: function (value) {
39
+ return numpf(value, ["%d minut", "%d minuto", "%d minuti", "%d minute"]);
40
+ },
41
+ hour: "eno uro",
42
+ hours: function (value) {
43
+ return numpf(value, ["%d ur", "%d uro", "%d uri", "%d ure"]);
44
+ },
45
+ day: "en dan",
46
+ days: function (value) {
47
+ return numpf(value, ["%d dni", "%d dan", "%d dneva", "%d dni"]);
48
+ },
49
+ month: "en mesec",
50
+ months: function (value) {
51
+ return numpf(value, ["%d mesecev", "%d mesec", "%d meseca", "%d mesece"]);
52
+ },
53
+ year: "eno leto",
54
+ years: function (value) {
55
+ return numpf(value, ["%d let", "%d leto", "%d leti", "%d leta"]);
56
+ },
57
+ wordSeparator: " ",
58
+ };
59
+ });
js/timeago/locales/jquery.timeago.sq.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Albanian SQ
11
+ jQuery.timeago.settings.strings = {
12
+ suffixAgo: "më parë",
13
+ suffixFromNow: "tani",
14
+ seconds: "më pak se një minutë",
15
+ minute: "rreth një minutë",
16
+ minutes: "%d minuta",
17
+ hour: "rreth një orë",
18
+ hours: "rreth %d orë",
19
+ day: "një ditë",
20
+ days: "%d ditë",
21
+ month: "rreth një muaj",
22
+ months: "%d muaj",
23
+ year: "rreth një vit",
24
+ years: "%d vjet",
25
+ };
26
+ });
js/timeago/locales/jquery.timeago.sr.js CHANGED
@@ -1,49 +1,54 @@
1
- // Serbian
2
- (function () {
3
- var numpf;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- numpf = function (n, f, s, t) {
6
- var n10;
7
- n10 = n % 10;
8
- if (n10 === 1 && (n === 1 || n > 20)) {
9
- return f;
10
- } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
11
- return s;
12
- } else {
13
- return t;
14
- }
15
- };
16
-
17
- jQuery.timeago.settings.strings = {
18
- prefixAgo: "пре",
19
- prefixFromNow: "за",
20
- suffixAgo: null,
21
- suffixFromNow: null,
22
- second: "секунд",
23
- seconds: function (value) {
24
- return numpf(value, "%d секунд", "%d секунде", "%d секунди");
25
- },
26
- minute: "један минут",
27
- minutes: function (value) {
28
- return numpf(value, "%d минут", "%d минута", "%d минута");
29
- },
30
- hour: "један сат",
31
- hours: function (value) {
32
- return numpf(value, "%d сат", "%d сата", "%d сати");
33
- },
34
- day: "један дан",
35
- days: function (value) {
36
- return numpf(value, "%d дан", "%d дана", "%d дана");
37
- },
38
- month: "месец дана",
39
- months: function (value) {
40
- return numpf(value, "%d месец", "%d месеца", "%d месеци");
41
- },
42
- year: "годину дана",
43
- years: function (value) {
44
- return numpf(value, "%d годину", "%d године", "%d година");
45
- },
46
- wordSeparator: " "
47
- };
48
-
49
- }).call(this);
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Serbian
11
+ var numpf = function (n, f, s, t) {
12
+ var n10;
13
+ n10 = n % 10;
14
+ if (n10 === 1 && (n === 1 || n > 20)) {
15
+ return f;
16
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
17
+ return s;
18
+ } else {
19
+ return t;
20
+ }
21
+ };
22
 
23
+ jQuery.timeago.settings.strings = {
24
+ prefixAgo: "пре",
25
+ prefixFromNow: "за",
26
+ suffixAgo: null,
27
+ suffixFromNow: null,
28
+ second: "секунд",
29
+ seconds: function (value) {
30
+ return numpf(value, "%d секунд", "%d секунде", "%d секунди");
31
+ },
32
+ minute: "један минут",
33
+ minutes: function (value) {
34
+ return numpf(value, "%d минут", "%d минута", "%d минута");
35
+ },
36
+ hour: "један сат",
37
+ hours: function (value) {
38
+ return numpf(value, "%d сат", "%d сата", "%d сати");
39
+ },
40
+ day: "један дан",
41
+ days: function (value) {
42
+ return numpf(value, "%d дан", "%d дана", "%d дана");
43
+ },
44
+ month: "месец дана",
45
+ months: function (value) {
46
+ return numpf(value, "%d месец", "%d месеца", "%d месеци");
47
+ },
48
+ year: "годину дана",
49
+ years: function (value) {
50
+ return numpf(value, "%d годину", "%d године", "%d година");
51
+ },
52
+ wordSeparator: " ",
53
+ };
54
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
js/timeago/locales/jquery.timeago.sv.js CHANGED
@@ -1,18 +1,28 @@
1
- // Swedish
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: "för",
4
- prefixFromNow: "om",
5
- suffixAgo: "sedan",
6
- suffixFromNow: "",
7
- seconds: "mindre än en minut",
8
- minute: "ungefär en minut",
9
- minutes: "%d minuter",
10
- hour: "ungefär en timme",
11
- hours: "ungefär %d timmar",
12
- day: "en dag",
13
- days: "%d dagar",
14
- month: "ungefär en månad",
15
- months: "%d månader",
16
- year: "ungefär ett år",
17
- years: "%d år"
18
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Swedish
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "för",
13
+ prefixFromNow: "om",
14
+ suffixAgo: "sedan",
15
+ suffixFromNow: "",
16
+ seconds: "mindre än en minut",
17
+ minute: "ungefär en minut",
18
+ minutes: "%d minuter",
19
+ hour: "ungefär en timme",
20
+ hours: "ungefär %d timmar",
21
+ day: "en dag",
22
+ days: "%d dagar",
23
+ month: "ungefär en månad",
24
+ months: "%d månader",
25
+ year: "ungefär ett år",
26
+ years: "%d år",
27
+ };
28
+ });
js/timeago/locales/jquery.timeago.th.js CHANGED
@@ -1,20 +1,30 @@
1
- // Thai
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: null,
5
- suffixAgo: "ที่แล้ว",
6
- suffixFromNow: "จากตอนนี้",
7
- seconds: "น้อยกว่าหนึ่งนาที",
8
- minute: "ประมาณหนึ่งนาที",
9
- minutes: "%d นาที",
10
- hour: "ประมาณหนึ่งชั่วโมง",
11
- hours: "ประมาณ %d ชั่วโมง",
12
- day: "หนึ่งวัน",
13
- days: "%d วัน",
14
- month: "ประมาณหนึ่งเดือน",
15
- months: "%d เดือน",
16
- year: "ประมาณหนึ่งปี",
17
- years: "%d ปี",
18
- wordSeparator: "",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Thai
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "ที่แล้ว",
15
+ suffixFromNow: "จากตอนนี้",
16
+ seconds: "น้อยกว่าหนึ่งนาที",
17
+ minute: "ประมาณหนึ่งนาที",
18
+ minutes: "%d นาที",
19
+ hour: "ประมาณหนึ่งชั่วโมง",
20
+ hours: "ประมาณ %d ชั่วโมง",
21
+ day: "หนึ่งวัน",
22
+ days: "%d วัน",
23
+ month: "ประมาณหนึ่งเดือน",
24
+ months: "%d เดือน",
25
+ year: "ประมาณหนึ่งปี",
26
+ years: "%d ปี",
27
+ wordSeparator: "",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.tr-short.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Turkish shortened
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "",
15
+ suffixFromNow: "",
16
+ seconds: "1dk",
17
+ minute: "1dk",
18
+ minutes: "%ddk",
19
+ hour: "1s",
20
+ hours: "%ds",
21
+ day: "1g",
22
+ days: "%dg",
23
+ month: "1ay",
24
+ months: "%day",
25
+ year: "1y",
26
+ years: "%dy",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.tr.js CHANGED
@@ -1,16 +1,26 @@
1
- // Turkish
2
- jQuery.timeago.settings.strings = {
3
- suffixAgo: 'önce',
4
- suffixFromNow: null,
5
- seconds: '1 dakikadan',
6
- minute: '1 dakika',
7
- minutes: '%d dakika',
8
- hour: '1 saat',
9
- hours: '%d saat',
10
- day: '1 gün',
11
- days: '%d gün',
12
- month: '1 ay',
13
- months: '%d ay',
14
- year: '1 yıl',
15
- years: '%d yıl'
16
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Turkish
11
+ jQuery.timeago.settings.strings = {
12
+ suffixAgo: "önce",
13
+ suffixFromNow: null,
14
+ seconds: "birkaç saniye",
15
+ minute: "1 dakika",
16
+ minutes: "%d dakika",
17
+ hour: "1 saat",
18
+ hours: "%d saat",
19
+ day: "1 gün",
20
+ days: "%d gün",
21
+ month: "1 ay",
22
+ months: "%d ay",
23
+ year: "1 yıl",
24
+ years: "%d yıl",
25
+ };
26
+ });
js/timeago/locales/jquery.timeago.uk.js CHANGED
@@ -1,13 +1,21 @@
1
- // Ukrainian
2
- (function() {
 
 
 
 
 
 
 
 
3
  function numpf(n, f, s, t) {
4
  // f - 1, 21, 31, ...
5
  // s - 2-4, 22-24, 32-34 ...
6
  // t - 5-20, 25-30, ...
7
  var n10 = n % 10;
8
- if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) {
9
  return f;
10
- } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) {
11
  return s;
12
  } else {
13
  return t;
@@ -21,14 +29,24 @@
21
  suffixFromNow: null,
22
  seconds: "менше хвилини",
23
  minute: "хвилина",
24
- minutes: function(value) { return numpf(value, "%d хвилина", "%d хвилини", "%d хвилин"); },
 
 
25
  hour: "година",
26
- hours: function(value) { return numpf(value, "%d година", "%d години", "%d годин"); },
 
 
27
  day: "день",
28
- days: function(value) { return numpf(value, "%d день", "%d дні", "%d днів"); },
 
 
29
  month: "місяць",
30
- months: function(value) { return numpf(value, "%d місяць", "%d місяці", "%d місяців"); },
 
 
31
  year: "рік",
32
- years: function(value) { return numpf(value, "%d рік", "%d роки", "%d років"); }
 
 
33
  };
34
- })();
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Ukrainian
11
  function numpf(n, f, s, t) {
12
  // f - 1, 21, 31, ...
13
  // s - 2-4, 22-24, 32-34 ...
14
  // t - 5-20, 25-30, ...
15
  var n10 = n % 10;
16
+ if (n10 === 1 && (n === 1 || n > 20)) {
17
  return f;
18
+ } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) {
19
  return s;
20
  } else {
21
  return t;
29
  suffixFromNow: null,
30
  seconds: "менше хвилини",
31
  minute: "хвилина",
32
+ minutes: function (value) {
33
+ return numpf(value, "%d хвилина", "%d хвилини", "%d хвилин");
34
+ },
35
  hour: "година",
36
+ hours: function (value) {
37
+ return numpf(value, "%d година", "%d години", "%d годин");
38
+ },
39
  day: "день",
40
+ days: function (value) {
41
+ return numpf(value, "%d день", "%d дні", "%d днів");
42
+ },
43
  month: "місяць",
44
+ months: function (value) {
45
+ return numpf(value, "%d місяць", "%d місяці", "%d місяців");
46
+ },
47
  year: "рік",
48
+ years: function (value) {
49
+ return numpf(value, "%d рік", "%d роки", "%d років");
50
+ },
51
  };
52
+ });
js/timeago/locales/jquery.timeago.ur.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Urdu
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "پہلے",
15
+ suffixFromNow: "اب سے",
16
+ seconds: "کچھ سیکنڈز",
17
+ minute: "تقریباً ایک منٹ",
18
+ minutes: "%d منٹ",
19
+ hour: "تقریباً ایک گھنٹہ",
20
+ hours: "تقریباً %d گھنٹے",
21
+ day: "ایک دن",
22
+ days: "%d دن",
23
+ month: "تقریباً ایک مہینہ",
24
+ months: "%d مہینے",
25
+ year: "تقریباً ایک سال",
26
+ years: "%d سال",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.uz.js CHANGED
@@ -1,19 +1,39 @@
1
- //Uzbek
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: "keyin",
5
- suffixAgo: "avval",
6
- suffixFromNow: null,
7
- seconds: "bir necha soniya",
8
- minute: "1 daqiqa",
9
- minutes: function(value) { return "%d daqiqa"; },
10
- hour: "1 soat",
11
- hours: function(value) { return "%d soat"; },
12
- day: "1 kun",
13
- days: function(value) { return "%d kun"; },
14
- month: "1 oy",
15
- months: function(value) { return "%d oy"; },
16
- year: "1 yil",
17
- years: function(value) { return "%d yil"; },
18
- wordSeparator: " "
19
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ //Uzbek
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: "keyin",
14
+ suffixAgo: "avval",
15
+ suffixFromNow: null,
16
+ seconds: "bir necha soniya",
17
+ minute: "1 daqiqa",
18
+ minutes: function (value) {
19
+ return "%d daqiqa";
20
+ },
21
+ hour: "1 soat",
22
+ hours: function (value) {
23
+ return "%d soat";
24
+ },
25
+ day: "1 kun",
26
+ days: function (value) {
27
+ return "%d kun";
28
+ },
29
+ month: "1 oy",
30
+ months: function (value) {
31
+ return "%d oy";
32
+ },
33
+ year: "1 yil",
34
+ years: function (value) {
35
+ return "%d yil";
36
+ },
37
+ wordSeparator: " ",
38
+ };
39
+ });
js/timeago/locales/jquery.timeago.vi.js CHANGED
@@ -1,20 +1,30 @@
1
- // Vietnamese
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: 'cách đây',
4
- prefixFromNow: null,
5
- suffixAgo: null,
6
- suffixFromNow: "trước",
7
- seconds: "chưa đến một phút",
8
- minute: "khoảng một phút",
9
- minutes: "%d phút",
10
- hour: "khoảng một tiếng",
11
- hours: "khoảng %d tiếng",
12
- day: "một ngày",
13
- days: "%d ngày",
14
- month: "khoảng một tháng",
15
- months: "%d tháng",
16
- year: "khoảng một năm",
17
- years: "%d năm",
18
- wordSeparator: " ",
19
- numbers: []
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Vietnamese
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: "cách đây",
13
+ prefixFromNow: null,
14
+ suffixAgo: "trước",
15
+ suffixFromNow: "kể từ bây giờ",
16
+ seconds: "chưa đến một phút",
17
+ minute: "khoảng một phút",
18
+ minutes: "%d phút",
19
+ hour: "khoảng một tiếng",
20
+ hours: "khoảng %d tiếng",
21
+ day: "một ngày",
22
+ days: "%d ngày",
23
+ month: "khoảng một tháng",
24
+ months: "%d tháng",
25
+ year: "khoảng một năm",
26
+ years: "%d năm",
27
+ wordSeparator: " ",
28
+ numbers: [],
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.zh-CN.js CHANGED
@@ -1,20 +1,30 @@
1
- // Simplified Chinese
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: "从现在开始",
5
- suffixAgo: "之前",
6
- suffixFromNow: null,
7
- seconds: "不到1分钟",
8
- minute: "大约1分钟",
9
- minutes: "%d分钟",
10
- hour: "大约1小时",
11
- hours: "大约%d小时",
12
- day: "1天",
13
- days: "%d天",
14
- month: "大约1个月",
15
- months: "%d月",
16
- year: "大约1",
17
- years: "%d年",
18
- numbers: [],
19
- wordSeparator: ""
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Simplified Chinese
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "之前",
15
+ suffixFromNow: "之后",
16
+ seconds: "不到1分钟",
17
+ minute: "大约1分钟",
18
+ minutes: "%d分钟",
19
+ hour: "大约1小时",
20
+ hours: "大约%d小时",
21
+ day: "1天",
22
+ days: "%d天",
23
+ month: "大约1个月",
24
+ months: "%d月",
25
+ year: "大约1年",
26
+ years: "%d年",
27
+ numbers: [],
28
+ wordSeparator: "",
29
+ };
30
+ });
js/timeago/locales/jquery.timeago.zh-TW.js CHANGED
@@ -1,20 +1,30 @@
1
- // Traditional Chinese, zh-tw
2
- jQuery.timeago.settings.strings = {
3
- prefixAgo: null,
4
- prefixFromNow: "從現在開始",
5
- suffixAgo: "之前",
6
- suffixFromNow: null,
7
- seconds: "不到1分鐘",
8
- minute: "大約1分鐘",
9
- minutes: "%d分鐘",
10
- hour: "大約1小時",
11
- hours: "%d小時",
12
- day: "大約1天",
13
- days: "%d天",
14
- month: "大約1個月",
15
- months: "%d個月",
16
- year: "大約1",
17
- years: "%d年",
18
- numbers: [],
19
- wordSeparator: ""
20
- };
 
 
 
 
 
 
 
 
 
 
1
+ (function (factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["jquery"], factory);
4
+ } else if (typeof module === "object" && typeof module.exports === "object") {
5
+ factory(require("jquery"));
6
+ } else {
7
+ factory(jQuery);
8
+ }
9
+ })(function (jQuery) {
10
+ // Traditional Chinese, zh-tw
11
+ jQuery.timeago.settings.strings = {
12
+ prefixAgo: null,
13
+ prefixFromNow: null,
14
+ suffixAgo: "之前",
15
+ suffixFromNow: "之後",
16
+ seconds: "不到1分鐘",
17
+ minute: "大約1分鐘",
18
+ minutes: "%d分鐘",
19
+ hour: "大約1小時",
20
+ hours: "%d小時",
21
+ day: "大約1天",
22
+ days: "%d天",
23
+ month: "大約1個月",
24
+ months: "%d個月",
25
+ year: "大約1年",
26
+ years: "%d年",
27
+ numbers: [],
28
+ wordSeparator: "",
29
+ };
30
+ });
loggers/SimpleMediaLogger.php CHANGED
@@ -17,8 +17,8 @@ class SimpleMediaLogger extends SimpleLogger {
17
  public function getInfo() {
18
 
19
  $arr_info = array(
20
- 'name' => 'Media/Attachments Logger',
21
- 'description' => 'Logs media uploads and edits',
22
  'capability' => 'edit_pages',
23
  'messages' => array(
24
  'attachment_created' => __( 'Created {post_type} "{attachment_title}"', 'simple-history' ),
@@ -48,15 +48,11 @@ class SimpleMediaLogger extends SimpleLogger {
48
  }
49
 
50
  public function loaded() {
51
- add_action( 'admin_init', array( $this, 'onAdminInit' ) );
52
- add_action( 'xmlrpc_call_success_mw_newMediaObject', array( $this, 'onMwNewMediaObject' ), 10, 2 );
53
- add_filter( 'simple_history/rss_item_link', array( $this, 'filterRssItemLink' ), 10, 2 );
54
- }
55
-
56
- public function onAdminInit() {
57
- add_action( 'add_attachment', array( $this, 'onAddAttachment' ) );
58
- add_action( 'edit_attachment', array( $this, 'onEditAttachment' ) );
59
- add_action( 'delete_attachment', array( $this, 'onDeleteAttachment' ) );
60
  }
61
 
62
  /**
@@ -67,7 +63,7 @@ class SimpleMediaLogger extends SimpleLogger {
67
  * @param int $id ID of the new attachment.
68
  * @param array $args An array of arguments to add the attachment.
69
  */
70
- public function onMwNewMediaObject( $attachment_id, $args ) {
71
 
72
  $attachment_post = get_post( $attachment_id );
73
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
@@ -103,14 +99,33 @@ class SimpleMediaLogger extends SimpleLogger {
103
 
104
  $attachment_id = $context['attachment_id'];
105
  $attachment_post = get_post( $attachment_id );
106
- $attachment_is_available = is_a( $attachment_post, 'WP_Post' );
107
 
108
- // Only link to attachment if it is still available
109
  if ( $attachment_is_available ) {
110
  if ( 'attachment_updated' == $message_key ) {
111
  $message = __( 'Edited {post_type} <a href="{edit_link}">"{attachment_title}"</a>', 'simple-history' );
112
  } elseif ( 'attachment_created' == $message_key ) {
113
- $message = __( 'Uploaded {post_type} <a href="{edit_link}">"{attachment_title}"</a>', 'simple-history' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
  $context['post_type'] = esc_html( $context['post_type'] );
@@ -154,7 +169,6 @@ class SimpleMediaLogger extends SimpleLogger {
154
  // Is true if attachment is an image. But for example PDFs can have thumbnail images, but they are not considered to be image.
155
  $is_image = wp_attachment_is_image( $attachment_id );
156
 
157
- // $message .= $is_image ? "is images yes" : "is image no";
158
  $is_video = strpos( $filetype['type'], 'video/' ) !== false;
159
  $is_audio = strpos( $filetype['type'], 'audio/' ) !== false;
160
 
@@ -228,45 +242,63 @@ class SimpleMediaLogger extends SimpleLogger {
228
  }
229
 
230
  /**
231
- * Called when an attachment is added
 
 
 
 
232
  */
233
- public function onAddAttachment( $attachment_id ) {
234
 
235
  $attachment_post = get_post( $attachment_id );
236
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
237
  $mime = get_post_mime_type( $attachment_post );
238
  $file = get_attached_file( $attachment_id );
239
- $file_size = false;
 
 
 
 
 
 
 
 
 
240
 
241
- if ( file_exists( $file ) ) {
242
- $file_size = filesize( $file );
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  }
244
 
245
  $this->infoMessage(
246
  'attachment_created',
247
- array(
248
- 'post_type' => get_post_type( $attachment_post ),
249
- 'attachment_id' => $attachment_id,
250
- 'attachment_title' => get_the_title( $attachment_post ),
251
- 'attachment_filename' => $filename,
252
- 'attachment_mime' => $mime,
253
- 'attachment_filesize' => $file_size,
254
- )
255
  );
256
  }
257
 
258
  /**
259
- * An attachmet is changed
260
  * is this only being called if the title of the attachment is changed?!
261
  *
262
  * @param int $attachment_id
263
  */
264
- public function onEditAttachment( $attachment_id ) {
265
 
266
  $attachment_post = get_post( $attachment_id );
267
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
268
  $mime = get_post_mime_type( $attachment_post );
269
- $file = get_attached_file( $attachment_id );
270
 
271
  $this->infoMessage(
272
  'attachment_updated',
@@ -283,7 +315,7 @@ class SimpleMediaLogger extends SimpleLogger {
283
  /*
284
  * Called when an attachment is deleted
285
  */
286
- public function onDeleteAttachment( $attachment_id ) {
287
 
288
  $attachment_post = get_post( $attachment_id );
289
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
@@ -309,7 +341,7 @@ class SimpleMediaLogger extends SimpleLogger {
309
  * @param string $link
310
  * @param object $row
311
  */
312
- public function filterRssItemLink( $link, $row ) {
313
  if ( $row->logger != $this->slug ) {
314
  return $link;
315
  }
17
  public function getInfo() {
18
 
19
  $arr_info = array(
20
+ 'name' => __( 'Media/Attachments Logger', 'simple-history' ),
21
+ 'description' => __( 'Logs media uploads and edits', 'simple-history' ),
22
  'capability' => 'edit_pages',
23
  'messages' => array(
24
  'attachment_created' => __( 'Created {post_type} "{attachment_title}"', 'simple-history' ),
48
  }
49
 
50
  public function loaded() {
51
+ add_action( 'add_attachment', array( $this, 'on_add_attachment' ) );
52
+ add_action( 'edit_attachment', array( $this, 'on_edit_attachment' ) );
53
+ add_action( 'delete_attachment', array( $this, 'on_delete_attachment' ) );
54
+ add_action( 'xmlrpc_call_success_mw_newMediaObject', array( $this, 'on_mw_new_media_object' ), 10, 2 );
55
+ add_filter( 'simple_history/rss_item_link', array( $this, 'filter_rss_item_link' ), 10, 2 );
 
 
 
 
56
  }
57
 
58
  /**
63
  * @param int $id ID of the new attachment.
64
  * @param array $args An array of arguments to add the attachment.
65
  */
66
+ public function on_mw_new_media_object( $attachment_id, $args ) {
67
 
68
  $attachment_post = get_post( $attachment_id );
69
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
99
 
100
  $attachment_id = $context['attachment_id'];
101
  $attachment_post = get_post( $attachment_id );
102
+ $attachment_is_available = $attachment_post instanceof WP_Post;
103
 
104
+ // Only link to attachment if it is still available.
105
  if ( $attachment_is_available ) {
106
  if ( 'attachment_updated' == $message_key ) {
107
  $message = __( 'Edited {post_type} <a href="{edit_link}">"{attachment_title}"</a>', 'simple-history' );
108
  } elseif ( 'attachment_created' == $message_key ) {
109
+
110
+ if ( isset( $context['attachment_parent_id'] ) ) {
111
+ // Attachment was uploaded to a post. Link to it, if still available.
112
+ $attachment_parent_post = get_post( $context['attachment_parent_id'] );
113
+ $attachment_parent_available = $attachment_parent_post instanceof WP_Post;
114
+
115
+ $context['attachment_parent_post_type'] = esc_html( $context['attachment_parent_post_type'] );
116
+ $context['attachment_parent_title'] = esc_html( $context['attachment_parent_title'] );
117
+
118
+ if ( $attachment_parent_available ) {
119
+ // Include link to parent post.
120
+ $context['attachment_parent_edit_link'] = get_edit_post_link( $context['attachment_parent_id'] );
121
+ $message = __( 'Uploaded {post_type} <a href="{edit_link}">"{attachment_title}"</a> to {attachment_parent_post_type} <a href="{attachment_parent_edit_link}">"{attachment_parent_title}"</a>', 'simple-history' );
122
+ } else {
123
+ // Include only title to parent post.
124
+ $message = __( 'Uploaded {post_type} <a href="{edit_link}">"{attachment_title}"</a> to {attachment_parent_post_type} "{attachment_parent_title}"', 'simple-history' );
125
+ }
126
+ } else {
127
+ $message = __( 'Uploaded {post_type} <a href="{edit_link}">"{attachment_title}"</a>', 'simple-history' );
128
+ }
129
  }
130
 
131
  $context['post_type'] = esc_html( $context['post_type'] );
169
  // Is true if attachment is an image. But for example PDFs can have thumbnail images, but they are not considered to be image.
170
  $is_image = wp_attachment_is_image( $attachment_id );
171
 
 
172
  $is_video = strpos( $filetype['type'], 'video/' ) !== false;
173
  $is_audio = strpos( $filetype['type'], 'audio/' ) !== false;
174
 
242
  }
243
 
244
  /**
245
+ * Called when an attachment is added.
246
+ * Fired from filter 'add_attachment'.
247
+ * Is not fired when image is added in Block Editor
248
+ *
249
+ * @param int $attachment_id.
250
  */
251
+ public function on_add_attachment( $attachment_id ) {
252
 
253
  $attachment_post = get_post( $attachment_id );
254
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
255
  $mime = get_post_mime_type( $attachment_post );
256
  $file = get_attached_file( $attachment_id );
257
+ $file_size = file_exists( $file ) ? filesize( $file ) : null;
258
+
259
+ $context = array(
260
+ 'post_type' => get_post_type( $attachment_post ),
261
+ 'attachment_id' => $attachment_id,
262
+ 'attachment_title' => get_the_title( $attachment_post ),
263
+ 'attachment_filename' => $filename,
264
+ 'attachment_mime' => $mime,
265
+ 'attachment_filesize' => $file_size,
266
+ );
267
 
268
+ // Add information about possible parent.
269
+ $attachment_parent = get_post_parent( $attachment_id );
270
+ $attachment_parent_id = $attachment_parent ? $attachment_parent->ID : null;
271
+ $attachment_parent_title = $attachment_parent ? get_the_title( $attachment_parent ) : null;
272
+ $attachment_parent_post_type = $attachment_parent ? get_post_type( $attachment_parent ) : null;
273
+
274
+ if ( $attachment_parent ) {
275
+ $context = array_merge(
276
+ $context,
277
+ array(
278
+ 'attachment_parent_id' => $attachment_parent_id,
279
+ 'attachment_parent_title' => $attachment_parent_title,
280
+ 'attachment_parent_post_type' => $attachment_parent_post_type,
281
+ )
282
+ );
283
  }
284
 
285
  $this->infoMessage(
286
  'attachment_created',
287
+ $context
 
 
 
 
 
 
 
288
  );
289
  }
290
 
291
  /**
292
+ * An attachment is changed
293
  * is this only being called if the title of the attachment is changed?!
294
  *
295
  * @param int $attachment_id
296
  */
297
+ public function on_edit_attachment( $attachment_id ) {
298
 
299
  $attachment_post = get_post( $attachment_id );
300
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
301
  $mime = get_post_mime_type( $attachment_post );
 
302
 
303
  $this->infoMessage(
304
  'attachment_updated',
315
  /*
316
  * Called when an attachment is deleted
317
  */
318
+ public function on_delete_attachment( $attachment_id ) {
319
 
320
  $attachment_post = get_post( $attachment_id );
321
  $filename = esc_html( wp_basename( $attachment_post->guid ) );
341
  * @param string $link
342
  * @param object $row
343
  */
344
+ public function filter_rss_item_link( $link, $row ) {
345
  if ( $row->logger != $this->slug ) {
346
  return $link;
347
  }
loggers/SimplePluginLogger.php CHANGED
@@ -23,6 +23,14 @@ class SimplePluginLogger extends SimpleLogger {
23
  */
24
  public $latest_plugin_deactivation_because_of_error_reason = array();
25
 
 
 
 
 
 
 
 
 
26
  /**
27
  * Get array with information about this logger
28
  *
@@ -166,11 +174,6 @@ class SimplePluginLogger extends SimpleLogger {
166
  // Check hook extra for upgrader initiator.
167
  add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_process_complete' ), 10, 2 );
168
 
169
- // Detect files removed.
170
- add_action( 'setted_transient', array( $this, 'on_setted_transient_for_remove_files' ), 10, 2 );
171
-
172
- add_action( 'admin_action_delete-selected', array( $this, 'on_action_delete_selected' ), 10, 1 );
173
-
174
  // Ajax function to get info from GitHub repo. Used by "View plugin info"-link for plugin installs.
175
  add_action( 'wp_ajax_SimplePluginLogger_GetGitHubPluginInfo', array( $this, 'ajax_GetGitHubPluginInfo' ) );
176
 
@@ -190,8 +193,60 @@ class SimplePluginLogger extends SimpleLogger {
190
  add_filter( 'gettext', array( $this, 'on_gettext' ), 10, 3 );
191
 
192
  // Detect plugin auto update change.
193
- add_action( 'load-plugins.php', array( $this, 'handleAutoUpdateChange' ) );
194
- add_action( 'wp_ajax_toggle-auto-updates', array( $this, 'handleAutoUpdateChange' ), 1, 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  }
196
 
197
  /**
@@ -203,7 +258,7 @@ class SimplePluginLogger extends SimpleLogger {
203
  * site_option 'auto_update_plugins'.
204
  * Check the value of that option after the option is updated.
205
  */
206
- public function handleAutoUpdateChange() {
207
  $option = 'auto_update_plugins';
208
 
209
  add_filter(
@@ -599,35 +654,6 @@ class SimplePluginLogger extends SimpleLogger {
599
  exit;
600
  }
601
 
602
- /*
603
- * When a plugin has been deleted there is no way for us to get
604
- * the real name of the plugin, only the dir and main index file.
605
- * So before a plugin is deleted we save all needed info in a transient
606
- */
607
- public function on_action_delete_selected() {
608
-
609
- // Same as in plugins.php
610
- if ( ! current_user_can( 'delete_plugins' ) ) {
611
- wp_die( esc_html__( 'You do not have sufficient permissions to delete plugins for this site.', 'simple-history' ) );
612
- }
613
-
614
- // Verify delete must be set
615
- // phpcs:ignore WordPress.Security.NonceVerification.Missing
616
- if ( ! isset( $_POST['verify-delete'] ) || ! $_POST['verify-delete'] ) {
617
- return;
618
- }
619
-
620
- // An arr of plugins must be set
621
- // phpcs:ignore WordPress.Security.NonceVerification.Missing
622
- if ( ! isset( $_POST['checked'] ) || ! is_array( $_POST['checked'] ) ) {
623
- return;
624
- }
625
-
626
- // If we get this far it looks like a plugin is begin deleted
627
- // Get and save info about it
628
- $this->save_versions_before_update();
629
- }
630
-
631
  /**
632
  * Saves info about all installed plugins to an option.
633
  * When we are done logging then we remove the option.
@@ -644,110 +670,6 @@ class SimplePluginLogger extends SimpleLogger {
644
  return $bool;
645
  }
646
 
647
- /**
648
- * Detect plugin being deleted
649
- * When WP is done deleting a plugin it sets a transient called plugins_delete_result:
650
- * set_transient('plugins_delete_result_' . $user_ID, $delete_result);
651
- *
652
- * We detect when that transient is set and then we have all info needed to log the plugin delete
653
- */
654
- public function on_setted_transient_for_remove_files( $transient = '', $value = '' ) {
655
-
656
- $user_id = get_current_user_id();
657
- if ( ! $user_id ) {
658
- return;
659
- }
660
-
661
- $transient_name = '_transient_plugins_delete_result_' . $user_id;
662
- if ( $transient_name !== $transient ) {
663
- return;
664
- }
665
-
666
- // We found the transient we were looking for
667
- if (
668
- // phpcs:disable WordPress.Security.NonceVerification.Missing
669
- isset( $_POST['action'] )
670
- && 'delete-selected' == $_POST['action']
671
- && isset( $_POST['checked'] )
672
- && is_array( $_POST['checked'] )
673
- // phpcs:enable WordPress.Security.NonceVerification.Missing
674
- ) {
675
- /*
676
- [checked] => Array
677
- (
678
- [0] => the-events-calendar/the-events-calendar.php
679
- )
680
- */
681
-
682
- // phpcs:ignore WordPress.Security.NonceVerification.Missing
683
- $plugins_deleted = (array) $_POST['checked'];
684
- $plugins_before_update = json_decode( get_option( $this->slug . '_plugin_info_before_update', false ), true );
685
-
686
- foreach ( $plugins_deleted as $plugin ) {
687
- $context = array(
688
- 'plugin' => $plugin, // plugin-name-folder/plugin-main-file.php
689
- );
690
-
691
- if ( is_array( $plugins_before_update ) && isset( $plugins_before_update[ $plugin ] ) ) {
692
- $context['plugin_name'] = $plugins_before_update[ $plugin ]['Name'];
693
- $context['plugin_title'] = $plugins_before_update[ $plugin ]['Title'];
694
- $context['plugin_description'] = $plugins_before_update[ $plugin ]['Description'];
695
- $context['plugin_author'] = $plugins_before_update[ $plugin ]['Author'];
696
- $context['plugin_version'] = $plugins_before_update[ $plugin ]['Version'];
697
- $context['plugin_url'] = $plugins_before_update[ $plugin ]['PluginURI'];
698
- }
699
-
700
- $this->infoMessage(
701
- 'plugin_deleted',
702
- $context
703
- );
704
- }
705
- }
706
-
707
- $this->remove_saved_versions();
708
- }
709
-
710
- /**
711
- * Save all plugin information before a plugin is updated or removed.
712
- * This way we can know both the old (pre updated/removed) and the current version of the plugin
713
- */
714
- /*
715
- public function save_versions_before_update() {
716
-
717
- $current_screen = get_current_screen();
718
- $request_uri = $_SERVER["SCRIPT_NAME"];
719
-
720
- // Only add option on pages where needed
721
- $do_store = false;
722
-
723
- if (
724
- SimpleHistory::ends_with( $request_uri, "/wp-admin/update.php" )
725
- && isset( $current_screen->base )
726
- && "update" == $current_screen->base
727
- ) {
728
-
729
- // Plugin update screen
730
- $do_store = true;
731
-
732
- } else if (
733
- SimpleHistory::ends_with( $request_uri, "/wp-admin/plugins.php" )
734
- && isset( $current_screen->base )
735
- && "plugins" == $current_screen->base
736
- && ( isset( $_POST["action"] ) && "delete-selected" == $_POST["action"] )
737
- ) {
738
-
739
- // Plugin delete screen, during delete
740
- $do_store = true;
741
-
742
- }
743
-
744
- if ( $do_store ) {
745
- update_option( $this->slug . "_plugin_info_before_update", SimpleHistory::json_encode( get_plugins() ) );
746
- }
747
-
748
- }
749
- */
750
-
751
  /**
752
  * when plugin updates are done wp_clean_plugins_cache() is called,
753
  * which in its turn run:
@@ -756,7 +678,6 @@ class SimplePluginLogger extends SimpleLogger {
756
  * delete_site_transient_update_plugins
757
  */
758
  public function remove_saved_versions() {
759
-
760
  delete_option( $this->slug . '_plugin_info_before_update' );
761
  }
762
 
@@ -770,7 +691,6 @@ class SimplePluginLogger extends SimpleLogger {
770
  * Array of bulk item update data.
771
  */
772
  public function on_upgrader_process_complete( $plugin_upgrader_instance, $arr_data ) {
773
-
774
  // Can't use get_plugins() here to get version of plugins updated from
775
  // Tested that, and it will get the new version (and that's the correct answer I guess. but too bad for us..)
776
  /*
@@ -837,28 +757,17 @@ class SimplePluginLogger extends SimpleLogger {
837
  if ( isset( $arr_data['action'] ) && 'install' == $arr_data['action'] && ! $plugin_upgrader_instance->bulk ) {
838
  $upgrader_skin_options = isset( $plugin_upgrader_instance->skin->options ) && is_array( $plugin_upgrader_instance->skin->options ) ? $plugin_upgrader_instance->skin->options : array();
839
  $upgrader_skin_result = isset( $plugin_upgrader_instance->skin->result ) && is_array( $plugin_upgrader_instance->skin->result ) ? $plugin_upgrader_instance->skin->result : array();
840
- $upgrader_skin_api = isset( $plugin_upgrader_instance->skin->api ) ? $plugin_upgrader_instance->skin->api : (object) array();
841
-
842
- $plugin_slug = isset( $upgrader_skin_result['destination_name'] ) ? $upgrader_skin_result['destination_name'] : '';
843
 
844
- // Upgrader contains current info
845
  $context = array(
846
  'plugin_slug' => $plugin_slug,
847
- 'plugin_name' => isset( $upgrader_skin_api->name ) ? $upgrader_skin_api->name : '',
848
- 'plugin_version' => isset( $upgrader_skin_api->version ) ? $upgrader_skin_api->version : '',
849
- 'plugin_author' => isset( $upgrader_skin_api->author ) ? $upgrader_skin_api->author : '',
850
- 'plugin_last_updated' => isset( $upgrader_skin_api->last_updated ) ? $upgrader_skin_api->last_updated : '',
851
- 'plugin_requires' => isset( $upgrader_skin_api->requires ) ? $upgrader_skin_api->requires : '',
852
- 'plugin_tested' => isset( $upgrader_skin_api->tested ) ? $upgrader_skin_api->tested : '',
853
- 'plugin_rating' => isset( $upgrader_skin_api->rating ) ? $upgrader_skin_api->rating : '',
854
- 'plugin_num_ratings' => isset( $upgrader_skin_api->num_ratings ) ? $upgrader_skin_api->num_ratings : '',
855
- 'plugin_downloaded' => isset( $upgrader_skin_api->downloaded ) ? $upgrader_skin_api->downloaded : '',
856
- 'plugin_added' => isset( $upgrader_skin_api->added ) ? $upgrader_skin_api->added : '',
857
- 'plugin_source_files' => $this->simpleHistory->json_encode( $plugin_upgrader_instance->result['source_files'] ),
858
-
859
- // To debug comment out these:
860
- // "debug_skin_options" => $this->simpleHistory->json_encode( $upgrader_skin_options ),
861
- // "debug_skin_result" => $this->simpleHistory->json_encode( $upgrader_skin_result ),
862
  );
863
 
864
  /*
@@ -871,7 +780,7 @@ class SimplePluginLogger extends SimpleLogger {
871
 
872
  Also: plugins hosted at GitHub have a de-facto standard field of "GitHub Plugin URI"
873
  */
874
- $install_source = 'unknown';
875
  if ( isset( $upgrader_skin_options['type'] ) ) {
876
  $install_source = (string) $upgrader_skin_options['type'];
877
  }
@@ -968,7 +877,6 @@ class SimplePluginLogger extends SimpleLogger {
968
  'plugin_author' => $plugin_data['Author'],
969
  'plugin_version' => $plugin_data['Version'],
970
  'plugin_url' => $plugin_data['PluginURI'],
971
- 'plugin_source_files' => $this->simpleHistory->json_encode( $plugin_upgrader_instance->result['source_files'] ),
972
  );
973
 
974
  // update status for plugins are in response
23
  */
24
  public $latest_plugin_deactivation_because_of_error_reason = array();
25
 
26
+ /**
27
+ * Used to collect information about a plugin (using get_plugin_data()) before it is deleted.
28
+ * Plugin info is stored with plugin file as the key.
29
+ *
30
+ * @var array
31
+ */
32
+ protected $plugins_data = array();
33
+
34
  /**
35
  * Get array with information about this logger
36
  *
174
  // Check hook extra for upgrader initiator.
175
  add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_process_complete' ), 10, 2 );
176
 
 
 
 
 
 
177
  // Ajax function to get info from GitHub repo. Used by "View plugin info"-link for plugin installs.
178
  add_action( 'wp_ajax_SimplePluginLogger_GetGitHubPluginInfo', array( $this, 'ajax_GetGitHubPluginInfo' ) );
179
 
193
  add_filter( 'gettext', array( $this, 'on_gettext' ), 10, 3 );
194
 
195
  // Detect plugin auto update change.
196
+ add_action( 'load-plugins.php', array( $this, 'handle_auto_update_change' ) );
197
+ add_action( 'wp_ajax_toggle-auto-updates', array( $this, 'handle_auto_update_change' ), 1, 1 );
198
+
199
+ // Log plugin deletions, i.e. when a user click "Delete" in the plugins listing
200
+ // or choose plugin(s) and select Bulk actions -> Delete.
201
+ // Since WordPress 4.4 filters exists that are fired before and after plugin deletion.
202
+ add_action( 'delete_plugin', array( $this, 'on_action_delete_plugin' ), 10, 1 );
203
+ add_action( 'deleted_plugin', array( $this, 'on_action_deleted_plugin' ), 10, 2 );
204
+ }
205
+
206
+ /**
207
+ * Store information about a plugin before it gets deleted.
208
+ * Called from action `deleted_plugin` that is fired just before the plugin will be deleted.
209
+ *
210
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
211
+ * @return void
212
+ */
213
+ public function on_action_delete_plugin( $plugin_file ) {
214
+ $this->plugins_data[ $plugin_file ] = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_file, true, false );
215
+ }
216
+
217
+ /**
218
+ * Log plugin deletion.
219
+ * Called from action `deleted_plugin` that is fired just after a plugin has been deleted.
220
+ *
221
+ * @param string $plugin_file Path to the plugin file relative to the plugins directory.
222
+ * @param bool $deleted Whether the plugin deletion was successful.
223
+ * @return void
224
+ */
225
+ public function on_action_deleted_plugin( $plugin_file, $deleted ) {
226
+ if ( ! $deleted ) {
227
+ return;
228
+ }
229
+
230
+ if ( empty( $this->plugins_data[ $plugin_file ] ) ) {
231
+ return;
232
+ }
233
+
234
+ $plugin_data = $this->plugins_data[ $plugin_file ];
235
+
236
+ $context = array(
237
+ 'plugin' => $plugin_file,
238
+ 'plugin_name' => $plugin_data['Name'],
239
+ 'plugin_title' => $plugin_data['Title'],
240
+ 'plugin_description' => $plugin_data['Description'],
241
+ 'plugin_author' => $plugin_data['Author'],
242
+ 'plugin_version' => $plugin_data['Version'],
243
+ 'plugin_url' => $plugin_data['PluginURI'],
244
+ );
245
+
246
+ $this->infoMessage(
247
+ 'plugin_deleted',
248
+ $context
249
+ );
250
  }
251
 
252
  /**
258
  * site_option 'auto_update_plugins'.
259
  * Check the value of that option after the option is updated.
260
  */
261
+ public function handle_auto_update_change() {
262
  $option = 'auto_update_plugins';
263
 
264
  add_filter(
654
  exit;
655
  }
656
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  /**
658
  * Saves info about all installed plugins to an option.
659
  * When we are done logging then we remove the option.
670
  return $bool;
671
  }
672
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
673
  /**
674
  * when plugin updates are done wp_clean_plugins_cache() is called,
675
  * which in its turn run:
678
  * delete_site_transient_update_plugins
679
  */
680
  public function remove_saved_versions() {
 
681
  delete_option( $this->slug . '_plugin_info_before_update' );
682
  }
683
 
691
  * Array of bulk item update data.
692
  */
693
  public function on_upgrader_process_complete( $plugin_upgrader_instance, $arr_data ) {
 
694
  // Can't use get_plugins() here to get version of plugins updated from
695
  // Tested that, and it will get the new version (and that's the correct answer I guess. but too bad for us..)
696
  /*
757
  if ( isset( $arr_data['action'] ) && 'install' == $arr_data['action'] && ! $plugin_upgrader_instance->bulk ) {
758
  $upgrader_skin_options = isset( $plugin_upgrader_instance->skin->options ) && is_array( $plugin_upgrader_instance->skin->options ) ? $plugin_upgrader_instance->skin->options : array();
759
  $upgrader_skin_result = isset( $plugin_upgrader_instance->skin->result ) && is_array( $plugin_upgrader_instance->skin->result ) ? $plugin_upgrader_instance->skin->result : array();
760
+ // $upgrader_skin_api = isset( $plugin_upgrader_instance->skin->api ) ? $plugin_upgrader_instance->skin->api : (object) array();
761
+ $new_plugin_data = isset( $plugin_upgrader_instance->new_plugin_data ) ? $plugin_upgrader_instance->new_plugin_data : array();
762
+ $plugin_slug = isset( $upgrader_skin_result['destination_name'] ) ? $upgrader_skin_result['destination_name'] : '';
763
 
 
764
  $context = array(
765
  'plugin_slug' => $plugin_slug,
766
+ 'plugin_name' => isset( $new_plugin_data['Name'] ) ? $new_plugin_data['Name'] : '',
767
+ 'plugin_version' => isset( $new_plugin_data['Version'] ) ? $new_plugin_data['Version'] : '',
768
+ 'plugin_author' => isset( $new_plugin_data['Author'] ) ? $new_plugin_data['Author'] : '',
769
+ 'plugin_requires_wp' => isset( $new_plugin_data['RequiresWP'] ) ? $new_plugin_data['RequiresWP'] : '',
770
+ 'plugin_requires_php' => isset( $new_plugin_data['RequiresPHP'] ) ? $new_plugin_data['RequiresPHP'] : '',
 
 
 
 
 
 
 
 
 
 
771
  );
772
 
773
  /*
780
 
781
  Also: plugins hosted at GitHub have a de-facto standard field of "GitHub Plugin URI"
782
  */
783
+ $install_source = 'web';
784
  if ( isset( $upgrader_skin_options['type'] ) ) {
785
  $install_source = (string) $upgrader_skin_options['type'];
786
  }
877
  'plugin_author' => $plugin_data['Author'],
878
  'plugin_version' => $plugin_data['Version'],
879
  'plugin_url' => $plugin_data['PluginURI'],
 
880
  );
881
 
882
  // update status for plugins are in response
loggers/SimplePostLogger.php CHANGED
@@ -83,6 +83,11 @@ class SimplePostLogger extends SimpleLogger {
83
  // $prepared_post = stdClass Object with new and modified content.
84
  // changes are not saved to post in db yet, so get_post( $prepared_post->ID ) will get old contents.
85
 
 
 
 
 
 
86
  // $old_post = post with old content and old meta
87
  $old_post = get_post( $prepared_post->ID );
88
 
@@ -107,15 +112,15 @@ class SimplePostLogger extends SimpleLogger {
107
  $updatedPost = get_post( $updatedPost->ID );
108
  $post_meta = get_post_custom( $updatedPost->ID );
109
 
110
- $old_post = $this->old_post_data[ $updatedPost->ID ]['post_data'];
111
- $old_post_meta = $this->old_post_data[ $updatedPost->ID ]['post_meta'];
112
 
113
  $args = array(
114
  'new_post' => $updatedPost,
115
  'new_post_meta' => $post_meta,
116
  'old_post' => $old_post,
117
  'old_post_meta' => $old_post_meta,
118
- 'old_status' => $old_post->post_status,
119
  '_debug_caller_method' => __METHOD__,
120
  );
121
 
@@ -426,6 +431,7 @@ class SimplePostLogger extends SimpleLogger {
426
  'jp_sitemap',
427
  'jp_img_sitemap',
428
  'jp_sitemap_master',
 
429
  );
430
 
431
  /**
83
  // $prepared_post = stdClass Object with new and modified content.
84
  // changes are not saved to post in db yet, so get_post( $prepared_post->ID ) will get old contents.
85
 
86
+ // Not all posts have ID, for example attachment uploaded in block editor does not.
87
+ if ( empty( $prepared_post->ID ) ) {
88
+ return $prepared_post;
89
+ }
90
+
91
  // $old_post = post with old content and old meta
92
  $old_post = get_post( $prepared_post->ID );
93
 
112
  $updatedPost = get_post( $updatedPost->ID );
113
  $post_meta = get_post_custom( $updatedPost->ID );
114
 
115
+ $old_post = isset( $this->old_post_data[ $updatedPost->ID ] ) ? $this->old_post_data[ $updatedPost->ID ]['post_data'] : null;
116
+ $old_post_meta = isset( $this->old_post_data[ $updatedPost->ID ] ) ? $this->old_post_data[ $updatedPost->ID ]['post_meta'] : null;
117
 
118
  $args = array(
119
  'new_post' => $updatedPost,
120
  'new_post_meta' => $post_meta,
121
  'old_post' => $old_post,
122
  'old_post_meta' => $old_post_meta,
123
+ 'old_status' => $old_post ? $old_post->post_status : null,
124
  '_debug_caller_method' => __METHOD__,
125
  );
126
 
431
  'jp_sitemap',
432
  'jp_img_sitemap',
433
  'jp_sitemap_master',
434
+ 'attachment',
435
  );
436
 
437
  /**
loggers/SimpleThemeLogger.php CHANGED
@@ -12,6 +12,14 @@ class SimpleThemeLogger extends SimpleLogger {
12
  // When swithing themes, this will contain info about the theme we are switching from
13
  private $prev_theme_data;
14
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Get array with information about this logger
17
  *
@@ -25,8 +33,8 @@ class SimpleThemeLogger extends SimpleLogger {
25
  'capability' => 'edit_theme_options',
26
  'messages' => array(
27
  'theme_switched' => __( 'Switched theme to "{theme_name}" from "{prev_theme_name}"', 'simple-history' ),
28
- 'theme_installed' => __( 'Installed theme "{theme_name}"', 'simple-history' ),
29
- 'theme_deleted' => __( 'Deleted theme with slug "{theme_slug}"', 'simple-history' ),
30
  'theme_updated' => __( 'Updated theme "{theme_name}"', 'simple-history' ),
31
  'appearance_customized' => __( 'Customized theme appearance "{setting_id}"', 'simple-history' ),
32
  'widget_removed' => __( 'Removed widget "{widget_id_base}" from sidebar "{sidebar_id}"', 'simple-history' ),
@@ -103,57 +111,68 @@ class SimpleThemeLogger extends SimpleLogger {
103
  add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_process_complete_theme_install' ), 10, 2 );
104
  add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_process_complete_theme_update' ), 10, 2 );
105
 
106
- // delete_site_transient( 'update_themes' );
107
- // do_action( 'deleted_site_transient', $transient );
108
- add_action( 'deleted_site_transient', array( $this, 'on_deleted_site_transient_theme_deleted' ), 10, 1 );
109
- }
110
-
111
- /*
112
- * Fires after a transient is deleted.
113
- * WP function delete_theme() does not have any actions or filters we can use to detect
114
- * a theme deletion, but the last thing that is done in delete_theme() is that the
115
- * "update_themes" transient is deleted. So use that info to catch theme deletions.
116
- *
117
- * @param string $transient Deleted transient name.
118
- */
119
- public function on_deleted_site_transient_theme_deleted( $transient = null ) {
120
-
121
- if ( 'update_themes' !== $transient ) {
122
- return;
123
- }
124
-
125
  /*
126
- When a theme is deleted we have this info:
127
-
128
- $_GET:
129
- {
130
- "action": "delete",
131
- "stylesheet": "CherryFramework",
132
- "_wpnonce": "1c1571004e"
133
- }
134
-
135
-
136
  */
 
137
 
138
- if ( empty( $_GET['action'] ) || $_GET['action'] !== 'delete' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  return;
140
  }
141
 
142
- if ( empty( $_GET['stylesheet'] ) ) {
143
  return;
144
  }
145
 
146
- $theme_deleted_slug = (string) $_GET['stylesheet'];
147
 
148
  $this->infoMessage(
149
  'theme_deleted',
150
  array(
151
- 'theme_slug' => $theme_deleted_slug,
 
 
 
 
152
  )
153
  );
154
  }
155
 
156
-
157
  public function on_upgrader_process_complete_theme_update( $upgrader_instance = null, $arr_data = null ) {
158
 
159
  /*
@@ -243,81 +262,46 @@ class SimpleThemeLogger extends SimpleLogger {
243
  }
244
  }
245
 
 
 
 
 
 
 
 
246
  public function on_upgrader_process_complete_theme_install( $upgrader_instance = null, $arr_data = null ) {
247
-
248
- /*
249
- For theme installs $arr_data looks like:
250
-
251
- Array
252
- (
253
- [type] => theme
254
- [action] => install
255
- )
256
-
257
- */
258
-
259
- // Both args must be set
260
  if ( empty( $upgrader_instance ) || empty( $arr_data ) ) {
261
  return;
262
  }
263
 
264
- // Must be type theme and action install
265
  if ( $arr_data['type'] !== 'theme' || $arr_data['action'] !== 'install' ) {
266
  return;
267
  }
268
 
269
- // Skin contains the nice info
270
- if ( empty( $upgrader_instance->skin ) ) {
271
  return;
272
  }
273
 
274
- $skin = $upgrader_instance->skin;
 
 
275
 
276
- /*
277
- ob_start();
278
- print_r($skin);
279
- $skin_str = ob_get_clean();
280
- */
281
-
282
- /*
283
- Interesting parts in $skin:
284
-
285
- // type can be "web" or nnn
286
- [type] => web
287
-
288
- // api seems to contains theme info and description
289
- [api] => stdClass Object
290
- (
291
- [name] => Hemingway
292
- [slug] => hemingway
293
- [version] => 1.56
294
- [preview_url] => https://wp-themes.com/hemingway
295
- [author] => anlino
296
- [screenshot_url] => //ts.w.org/wp-content/themes/hemingway/screenshot.png?ver=1.56
297
- [rating] => 94
298
- [num_ratings] => 35
299
- [downloaded] => 282236
300
- [last_updated] => 2016-07-03
301
- [homepage] => https://wordpress.org/themes/hemingway/
302
- [download_link] => https://downloads.wordpress.org/theme/hemingway.1.56.zip
303
- )
304
 
305
- */
306
 
307
- $type = empty( $skin->type ) ? null : $skin->type;
308
- $theme_name = empty( $skin->api->name ) ? null : $skin->api->name;
309
- $theme_slug = empty( $skin->api->slug ) ? null : $skin->api->slug;
310
- $theme_version = empty( $skin->api->version ) ? null : $skin->api->version;
311
- // $theme_screenshot_url = $skin->api->screenshot_url;
312
- // $theme_last_updated = $skin->api->last_updated;
313
- // $theme_last_homepage = $skin->api->last_homepage;
314
- // $theme_download_link = $skin->api->last_download_link;
315
  $this->infoMessage(
316
  'theme_installed',
317
  array(
318
- 'theme_name' => $theme_name,
319
- 'theme_version' => $theme_version,
320
- // "debug_skin" => $skin_str
 
 
321
  )
322
  );
323
  }
12
  // When swithing themes, this will contain info about the theme we are switching from
13
  private $prev_theme_data;
14
 
15
+ /**
16
+ * Used to collect information about a theme before it is deleted.
17
+ * Theme info is stored with css file as the key.
18
+ *
19
+ * @var array
20
+ */
21
+ protected $themes_data = array();
22
+
23
  /**
24
  * Get array with information about this logger
25
  *
33
  'capability' => 'edit_theme_options',
34
  'messages' => array(
35
  'theme_switched' => __( 'Switched theme to "{theme_name}" from "{prev_theme_name}"', 'simple-history' ),
36
+ 'theme_installed' => __( 'Installed theme "{theme_name}" by {theme_author}', 'simple-history' ),
37
+ 'theme_deleted' => __( 'Deleted theme "{theme_name}"', 'simple-history' ),
38
  'theme_updated' => __( 'Updated theme "{theme_name}"', 'simple-history' ),
39
  'appearance_customized' => __( 'Customized theme appearance "{setting_id}"', 'simple-history' ),
40
  'widget_removed' => __( 'Removed widget "{widget_id_base}" from sidebar "{sidebar_id}"', 'simple-history' ),
111
  add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_process_complete_theme_install' ), 10, 2 );
112
  add_action( 'upgrader_process_complete', array( $this, 'on_upgrader_process_complete_theme_update' ), 10, 2 );
113
 
114
+ // Log theme deletion.
115
+ add_action( 'delete_theme', array( $this, 'on_action_delete_theme' ), 10, 1 );
116
+ add_action( 'deleted_theme', array( $this, 'on_action_deleted_theme' ), 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  /*
118
+ $this->infoMessage(
119
+ 'theme_deleted',
120
+ array(
121
+ 'theme_slug' => $theme_deleted_slug,
122
+ )
123
+ );
124
+ wp_get_theme( $one_updated_theme );
 
 
 
125
  */
126
+ }
127
 
128
+ /**
129
+ * Store information about a theme before the theme is deleted.
130
+ *
131
+ * @param string $stylesheet Stylesheet of the theme to delete.
132
+ * @return void
133
+ */
134
+ public function on_action_delete_theme( $stylesheet ) {
135
+ $theme = wp_get_theme( $stylesheet );
136
+
137
+ $this->themes_data[ $stylesheet ] = array(
138
+ 'name' => $theme->get( 'Name' ),
139
+ 'version' => $theme->get( 'Version' ),
140
+ 'author' => $theme->get( 'Author' ),
141
+ 'description' => $theme->get( 'Description' ),
142
+ 'themeuri' => $theme->get( 'ThemeURI' ),
143
+ );
144
+ }
145
+
146
+ /**
147
+ * Log theme deletion.
148
+ *
149
+ * @param string $stylesheet Stylesheet of the theme to delete.
150
+ * @param bool $deleted Whether the theme deletion was successful.
151
+ * @return void
152
+ */
153
+ public function on_action_deleted_theme( $stylesheet, $deleted ) {
154
+ if ( ! $deleted || ! $stylesheet ) {
155
  return;
156
  }
157
 
158
+ if ( empty( $this->themes_data[ $stylesheet ] ) ) {
159
  return;
160
  }
161
 
162
+ $theme_data = $this->themes_data[ $stylesheet ];
163
 
164
  $this->infoMessage(
165
  'theme_deleted',
166
  array(
167
+ 'theme_slug' => $stylesheet,
168
+ 'theme_name' => $theme_data['name'],
169
+ 'theme_version' => $theme_data['version'],
170
+ 'theme_author' => $theme_data['author'],
171
+ 'theme_description' => $theme_data['description'],
172
  )
173
  );
174
  }
175
 
 
176
  public function on_upgrader_process_complete_theme_update( $upgrader_instance = null, $arr_data = null ) {
177
 
178
  /*
262
  }
263
  }
264
 
265
+ /**
266
+ * Log theme installation.
267
+ *
268
+ * @param mixed $upgrader_instance
269
+ * @param mixed $arr_data
270
+ * @return void
271
+ */
272
  public function on_upgrader_process_complete_theme_install( $upgrader_instance = null, $arr_data = null ) {
273
+ // Both args must be set.
 
 
 
 
 
 
 
 
 
 
 
 
274
  if ( empty( $upgrader_instance ) || empty( $arr_data ) ) {
275
  return;
276
  }
277
 
278
+ // Must be type 'theme' and action 'install'.
279
  if ( $arr_data['type'] !== 'theme' || $arr_data['action'] !== 'install' ) {
280
  return;
281
  }
282
 
283
+ if ( empty( $upgrader_instance->new_theme_data ) ) {
 
284
  return;
285
  }
286
 
287
+ // $destination_name is the slug (folder name) of the theme.
288
+ $destination_name = $upgrader_instance->result['destination_name'];
289
+ $theme = wp_get_theme( $destination_name );
290
 
291
+ if ( ! $theme->exists() ) {
292
+ return;
293
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
 
295
+ $new_theme_data = $upgrader_instance->new_theme_data;
296
 
 
 
 
 
 
 
 
 
297
  $this->infoMessage(
298
  'theme_installed',
299
  array(
300
+ 'theme_slug' => $destination_name,
301
+ 'theme_name' => $new_theme_data['Name'],
302
+ 'theme_version' => $new_theme_data['Version'],
303
+ 'theme_author' => $new_theme_data['Author'],
304
+ 'theme_description' => $theme->get( 'Description' ),
305
  )
306
  );
307
  }
loggers/SimpleUserLogger.php CHANGED
@@ -66,6 +66,28 @@ class SimpleUserLogger extends SimpleLogger {
66
  'User destroys all login sessions for a user',
67
  'simple-history'
68
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ),
70
 
71
  'labels' => array(
@@ -121,8 +143,6 @@ class SimpleUserLogger extends SimpleLogger {
121
  // so if we run at 10 we just get null
122
  add_filter( 'authenticate', array( $this, 'onAuthenticate' ), 30, 3 );
123
 
124
- // User is changed
125
- // add_action("profile_update", array($this, "on_profile_update"), 10, 2);
126
  // User is created
127
  add_action( 'user_register', array( $this, 'onUserRegister' ), 10, 2 );
128
 
@@ -137,8 +157,105 @@ class SimpleUserLogger extends SimpleLogger {
137
  add_action( 'retrieve_password_message', array( $this, 'onRetrievePasswordMessage' ), 10, 4 );
138
 
139
  add_filter( 'insert_user_meta', array( $this, 'onInsertUserMeta' ), 10, 3 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  /*
143
  * Called before the user is updated
144
  *
@@ -294,7 +411,6 @@ class SimpleUserLogger extends SimpleLogger {
294
  }
295
  }
296
 
297
- // print_r($context);exit;
298
  $this->infoMessage( 'user_updated_profile', $context );
299
 
300
  return $meta;
@@ -550,34 +666,6 @@ class SimpleUserLogger extends SimpleLogger {
550
  $this->infoMessage( 'user_logged_out', $context );
551
  }
552
 
553
- /**
554
- * User is edited
555
- *
556
- * Called immediately after an existing user is updated.
557
- *
558
- * @param int $user_id User ID.
559
- * @param object $old_user_data Object containing user's data prior to update.
560
- */
561
- // public function on_profile_update($user_id, $old_user_data) {
562
- /*
563
- if (!$user_id || !is_numeric($user_id)) {
564
- return;
565
- }
566
-
567
- $wp_user_edited = get_userdata($user_id);
568
-
569
- $context = array(
570
- "edited_user_id" => $wp_user_edited->ID,
571
- "edited_user_email" => $wp_user_edited->user_email,
572
- "edited_user_login" => $wp_user_edited->user_login,
573
- "server_http_user_agent" => isset($_SERVER["HTTP_USER_AGENT"] ) ? $_SERVER["HTTP_USER_AGENT"] : null,
574
- "old_user_data" => $old_user_data
575
- );
576
-
577
-
578
- $this->infoMessage("user_updated_profile", $context);
579
- */
580
- // }
581
  /**
582
  * User is created
583
  *
66
  'User destroys all login sessions for a user',
67
  'simple-history'
68
  ),
69
+
70
+ 'user_admin_email_confirm_screen_view' => _x(
71
+ 'Viewed admin email confirm screen',
72
+ 'User sees user admin email confirm screen',
73
+ 'simple-history'
74
+ ),
75
+ // 'user_admin_email_confirm_update_clicked' => _x(
76
+ // 'Clicked "Update" button on admin email confirm screen',
77
+ // 'User clicks update admin email on admin email confirm screen',
78
+ // 'simple-history'
79
+ // ),
80
+ 'user_admin_email_confirm_correct_clicked' => _x(
81
+ 'Verified that administration email for website is correct',
82
+ 'User clicks confirm admin email on admin email confirm screen',
83
+ 'simple-history'
84
+ ),
85
+ // 'user_admin_email_confirm_remind_clicked' => _x(
86
+ // 'Clicked "Remind me later" on admin email confirm screen',
87
+ // 'User clicks remind me later on admin email confirm screen',
88
+ // 'simple-history'
89
+ // ),
90
+
91
  ),
92
 
93
  'labels' => array(
143
  // so if we run at 10 we just get null
144
  add_filter( 'authenticate', array( $this, 'onAuthenticate' ), 30, 3 );
145
 
 
 
146
  // User is created
147
  add_action( 'user_register', array( $this, 'onUserRegister' ), 10, 2 );
148
 
157
  add_action( 'retrieve_password_message', array( $this, 'onRetrievePasswordMessage' ), 10, 4 );
158
 
159
  add_filter( 'insert_user_meta', array( $this, 'onInsertUserMeta' ), 10, 3 );
160
+
161
+ // Administration email verification-screen
162
+
163
+ // Run this to force-show the admin email confirm screen.
164
+ // add_filter(
165
+ // 'option_admin_email_lifespan',
166
+ // function( $value, $option ) {
167
+ // return 1;
168
+ // },
169
+ // 10,
170
+ // 2
171
+ // );
172
+
173
+ /* add_action(
174
+ 'admin_email_confirm',
175
+ array( $this, 'on_action_admin_email_confirm' )
176
+ ); */
177
+
178
+ /* add_action(
179
+ 'load-options-general.php',
180
+ array( $this, 'on_action_load_options_general' )
181
+ ); */
182
+
183
+ add_action(
184
+ 'login_form_confirm_admin_email',
185
+ array( $this, 'on_action_login_form_confirm_admin_email' )
186
+ );
187
+
188
+ /* add_action(
189
+ 'login_form_confirm_admin_email',
190
+ array( $this, 'on_action_login_form_confirm_admin_email_remind_later' )
191
+ ); */
192
+ }
193
+
194
+ /* public function on_action_login_form_confirm_admin_email_remind_later() {
195
+ // Bail if button with name "correct-admin-email" was not clicked or if no nonce field exists.
196
+ if ( empty( $_GET['remind_me_later'] ) ) {
197
+ return;
198
+ }
199
+
200
+ // Bail if nonce not valid.
201
+ $nonce_valid = wp_verify_nonce( $_GET['remind_me_later'], 'remind_me_later_nonce' );
202
+ if ( $nonce_valid === false ) {
203
+ return;
204
+ }
205
+
206
+ $this->infoMessage( 'user_admin_email_confirm_remind_clicked' );
207
+ }
208
+ */
209
+
210
+ public function on_action_login_form_confirm_admin_email() {
211
+ // Bail if button with name "correct-admin-email" was not clicked or if no nonce field exists.
212
+ if ( empty( $_POST['confirm_admin_email_nonce'] ) || empty( $_POST['correct-admin-email'] ) ) {
213
+ return;
214
+ }
215
+
216
+ // Bail if nonce not valid.
217
+ $nonce_valid = wp_verify_nonce( $_POST['confirm_admin_email_nonce'], 'confirm_admin_email' );
218
+ if ( $nonce_valid === false ) {
219
+ return;
220
+ }
221
+
222
+ // sh_error_log( 'User clicked "The email is correct"' );
223
+ $this->infoMessage( 'user_admin_email_confirm_correct_clicked' );
224
  }
225
 
226
+ /* public function on_action_load_options_general() {
227
+ $referer = wp_get_referer();
228
+ $referer_parts = wp_parse_url( $referer );
229
+
230
+ $login_url = wp_login_url();
231
+ $login_url_parts = wp_parse_url( $login_url );
232
+
233
+ // Bail if referer is not login page.
234
+ if ( $referer_parts['path'] !== $login_url_parts['path'] ) {
235
+ return;
236
+ }
237
+
238
+ // If page was wp-login.php and action was confirm_admin_email then user came from confirm email screen
239
+ // http://wordpress-stable.test/wordpress/wp-login.php?redirect_to=http%3A%2F%2Fwordpress-stable.test%2Fwordpress%2Fwp-admin%2F&action=confirm_admin_email&wp_lang=sv_SE
240
+ $referer_parts_query_parts = wp_parse_args( $referer_parts['query'] );
241
+
242
+ // Bail if action was not to show confirm_admin_email-page.
243
+ if ( $referer_parts_query_parts['action'] !== 'confirm_admin_email' ) {
244
+ return;
245
+ }
246
+
247
+ // We are at options-general.php and user got here from the confirm admin email page.
248
+ // sh_error_log( 'User clicked on "Update" button' );
249
+ $this->infoMessage( 'user_admin_email_confirm_update_clicked' );
250
+ } */
251
+
252
+ /* public function on_action_admin_email_confirm( $errors ) {
253
+ if ( is_wp_error( $errors ) && $errors->has_errors() ) {
254
+ return;
255
+ }
256
+ $this->infoMessage( 'user_admin_email_confirm_screen_view' );
257
+ } */
258
+
259
  /*
260
  * Called before the user is updated
261
  *
411
  }
412
  }
413
 
 
414
  $this->infoMessage( 'user_updated_profile', $context );
415
 
416
  return $meta;
666
  $this->infoMessage( 'user_logged_out', $context );
667
  }
668
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
669
  /**
670
  * User is created
671
  *
phpunit.xml DELETED
@@ -1,18 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite name="Simple History Test Suite">
11
- <directory prefix="test-" suffix=".php">./tests/</directory>
12
- </testsuite>
13
- </testsuites>
14
- <php>
15
- <ini name="display_errors" value="true"/>
16
- </php>
17
- </phpunit>
18
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: history, log, changes, changelog, audit, audit log, event log, user tracki
5
  Requires at least: 5.2
6
  Tested up to: 5.8.2
7
  Requires PHP: 5.6
8
- Stable tag: 3.0.0
9
 
10
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
11
 
@@ -193,6 +193,25 @@ Events in the log are stored for 60 days by default. Events older than this will
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  = 3.0.0 (January 2022) =
197
 
198
  - Fixed: Used wrong text domain for some strings in Limit Login Attempts logger.
@@ -226,7 +245,7 @@ Events in the log are stored for 60 days by default. Events older than this will
226
 
227
  = 2.41.0 (March 2021) =
228
 
229
- - Fixed: Error when visiting settings screen on PHP 8.
230
  Fixes https://wordpress.org/support/topic/simple-history-fatal-error/.
231
  [#239](https://github.com/bonny/WordPress-Simple-History/issues/239)
232
 
5
  Requires at least: 5.2
6
  Tested up to: 5.8.2
7
  Requires PHP: 5.6
8
+ Stable tag: 3.1.0
9
 
10
  View changes made by users within WordPress. See who created a page, uploaded an attachment or approved an comment, and more.
11
 
193
 
194
  == Changelog ==
195
 
196
+ = 3.1.0 (January 2022) =
197
+
198
+ - Fixed: Use user selected language instead of selected site language when loading languages for JavaScript libraries. ([#232](https://github.com/bonny/WordPress-Simple-History/issues/232))
199
+ - Fixed: Theme deletions are now logged again. ([#266](https://github.com/bonny/WordPress-Simple-History/issues/266))
200
+ - Fixed: Theme installs are now logged again. ([#265](https://github.com/bonny/WordPress-Simple-History/issues/265))
201
+ - Fixed: Plugin deletions are now logged again. ([#247](https://github.com/bonny/WordPress-Simple-History/issues/247), [#122](https://github.com/bonny/WordPress-Simple-History/issues/122))
202
+ - Fixed: Images and other attachments are now logged correctly when being inserted in the Block Editor.
203
+ - Fixed: Some PHP notice messages in post logger.
204
+ - Updated: JavaScript library TimeAgo updated to 1.6.7 from 1.6.3.
205
+ - Added: Log when an admin verifies that the site admin adress is valid using the [Site Admin Email Verification Screen that was added in WordPress 5.3](https://make.wordpress.org/core/2019/10/17/wordpress-5-3-admin-email-verification-screen/). ([#194](https://github.com/bonny/WordPress-Simple-History/issues/194), [#225](https://github.com/bonny/WordPress-Simple-History/issues/225))
206
+ - Added: Option "All days" to date range filter dropdown. ([#196](https://github.com/bonny/WordPress-Simple-History/issues/196))
207
+ - Added: Media and other attachments now display the post they were uploaded to, if any. ([#274](https://github.com/bonny/WordPress-Simple-History/issues/274))
208
+ - Added: Add class static variables $dbtable and $dbtable_contexts that contain full db name (existing class constants DBTABLE and DBTABLE_CONTEXTS needed to be prefixed manually).
209
+ - Added: Plugin installs now save required version of PHP and WordPress.
210
+ - Changed: Plugin install source is now assumed to be "web" by default.
211
+ - Changed: Attachment updates are no longer logged from post logger since the media/attachment logger takes care of it.
212
+ - Changed: Function `sh_d()` now does not escape output when running from CLI.
213
+ - Removed: Plugin source files-listing removed from plugin installs, because the listing was incomplete, plus some more fields that no longer were able to get meaninful values (plugin rating, number or ratings, etc.).
214
+
215
  = 3.0.0 (January 2022) =
216
 
217
  - Fixed: Used wrong text domain for some strings in Limit Login Attempts logger.
245
 
246
  = 2.41.0 (March 2021) =
247
 
248
+ - Fixed: Error when visiting settings screen on PHP 8.
249
  Fixes https://wordpress.org/support/topic/simple-history-fatal-error/.
250
  [#239](https://github.com/bonny/WordPress-Simple-History/issues/239)
251