mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
Compare commits
No commits in common. "master" and "v1.8-beta" have entirely different histories.
135 changed files with 2310 additions and 2490 deletions
|
|
@ -19,7 +19,7 @@ indent_size = 4
|
||||||
indent_style = space
|
indent_style = space
|
||||||
tab_width = 4
|
tab_width = 4
|
||||||
|
|
||||||
[*.{css,yml,html,svg,xml}]
|
[*.{css,yml,html,svg}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
|
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,8 +1,6 @@
|
||||||
.DS_Store
|
|
||||||
src/db/todolist.db*
|
src/db/todolist.db*
|
||||||
src/db/config.php
|
src/db/config.php
|
||||||
src/db/config-*
|
src/db/config-*
|
||||||
src/db/backup.xml*
|
|
||||||
src/config.php
|
src/config.php
|
||||||
src/includes/vendor/
|
src/includes/vendor/
|
||||||
src/content/theme/custom.css
|
src/content/theme/custom.css
|
||||||
|
|
|
||||||
21
README.md
21
README.md
|
|
@ -1,22 +1,3 @@
|
||||||
# myTinyTodo
|
myTinyTodo
|
||||||
|
|
||||||
Your tiny todo list
|
|
||||||
|
|
||||||
Original website - http://www.mytinytodo.net/
|
Original website - http://www.mytinytodo.net/
|
||||||
|
|
||||||
### System requirements
|
|
||||||
- PHP 7.2 or greater
|
|
||||||
- PHP extensions:
|
|
||||||
- mbstring
|
|
||||||
- pdo_sqlite, intl (SQLite version)
|
|
||||||
- pdo_mysql or mysqli (MySQL version)
|
|
||||||
- pdo_pgsql (PostgreSQL version)
|
|
||||||
- One of databases:
|
|
||||||
- MySQL 5.7 or greater / MariaDB 10.2 or greater
|
|
||||||
- PostgreSQL 10 or greater
|
|
||||||
- SQLite (system library)
|
|
||||||
|
|
||||||
Supported browsers: Chrome 49, Safari 10, Firefox 53.
|
|
||||||
|
|
||||||
Internet Explorer and Opera with Presto engine are not supported.
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,7 @@ print "> Version is $ver\n";
|
||||||
|
|
||||||
unlink('./docker-config.php');
|
unlink('./docker-config.php');
|
||||||
unlink('./includes/lang/en-rtl.json');
|
unlink('./includes/lang/en-rtl.json');
|
||||||
unlink('./includes/lang/_percent.php');
|
|
||||||
unlink('./mtt-edit-settings.php');
|
unlink('./mtt-edit-settings.php');
|
||||||
unlink('./mtt-emergency.php');
|
|
||||||
unlink('./content/theme/images/svg2base64.php');
|
unlink('./content/theme/images/svg2base64.php');
|
||||||
|
|
||||||
chdir('..'); # to the root of repo
|
chdir('..'); # to the root of repo
|
||||||
|
|
@ -72,7 +70,7 @@ if (is_dir('src/ext')) {
|
||||||
}
|
}
|
||||||
chdir('../ext2');
|
chdir('../ext2');
|
||||||
if ($extCount > 0) {
|
if ($extCount > 0) {
|
||||||
`tar --no-xattrs -czf ../ext/extensions.tar.gz *`; #OS dep.!!!
|
`tar -czf ../ext/extensions.tar.gz *`; #OS dep.!!!
|
||||||
}
|
}
|
||||||
chdir('../..');
|
chdir('../..');
|
||||||
deleteTreeIfDir('src/ext2');
|
deleteTreeIfDir('src/ext2');
|
||||||
|
|
@ -82,7 +80,7 @@ if (is_dir('src/ext')) {
|
||||||
|
|
||||||
rename('src', 'mytinytodo') or die("Cant rename 'src'\n");
|
rename('src', 'mytinytodo') or die("Cant rename 'src'\n");
|
||||||
|
|
||||||
`tar --no-xattrs -czf mytinytodo.tar.gz mytinytodo`; #OS dep.!!!
|
`tar -czf mytinytodo.tar.gz mytinytodo`; #OS dep.!!!
|
||||||
if (!file_exists('mytinytodo.tar.gz')) {
|
if (!file_exists('mytinytodo.tar.gz')) {
|
||||||
die("Failed to pack files (no output tar.gz file)\n");
|
die("Failed to pack files (no output tar.gz file)\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "maxpozdeev/mytinytodo",
|
|
||||||
"type": "project",
|
|
||||||
"license": "GPL-2.0-or-later",
|
|
||||||
"homepage": "https://mytinytodo.net",
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Max Pozdeev",
|
|
||||||
"role": "Developer"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"config": {
|
"config": {
|
||||||
"vendor-dir": "src/includes/vendor"
|
"vendor-dir": "src/includes/vendor"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2",
|
"erusev/parsedown": "^1.7",
|
||||||
"ext-mbstring": "*",
|
"symfony/polyfill-intl-normalizer": "^1.28"
|
||||||
"erusev/parsedown": "1.7.x-dev#f7285e7",
|
|
||||||
"symfony/polyfill-intl-normalizer": "^1.31"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"league/commonmark": "^2.6"
|
"league/commonmark": "^2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
165
composer.lock
generated
165
composer.lock
generated
|
|
@ -4,20 +4,20 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "c27d4b183be86ec7d95203f1a84b86e2",
|
"content-hash": "ee0f5e5f2fe7aba230dbdcace19801b2",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "erusev/parsedown",
|
"name": "erusev/parsedown",
|
||||||
"version": "1.7.x-dev",
|
"version": "1.7.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/erusev/parsedown.git",
|
"url": "https://github.com/erusev/parsedown.git",
|
||||||
"reference": "f7285e7"
|
"reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/f7285e7",
|
"url": "https://api.github.com/repos/erusev/parsedown/zipball/cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
|
||||||
"reference": "f7285e7",
|
"reference": "cb17b6477dfff935958ba01325f2e8a2bfa6dab3",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
"php": ">=5.3.0"
|
"php": ">=5.3.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^4.8|^5.7|^6.5|^7.5|^8.5|^9.6"
|
"phpunit/phpunit": "^4.8.35"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -54,33 +54,36 @@
|
||||||
"issues": "https://github.com/erusev/parsedown/issues",
|
"issues": "https://github.com/erusev/parsedown/issues",
|
||||||
"source": "https://github.com/erusev/parsedown/tree/1.7.x"
|
"source": "https://github.com/erusev/parsedown/tree/1.7.x"
|
||||||
},
|
},
|
||||||
"time": "2024-07-12T14:59:16+00:00"
|
"time": "2019-12-30T22:54:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-normalizer",
|
"name": "symfony/polyfill-intl-normalizer",
|
||||||
"version": "v1.32.0",
|
"version": "v1.28.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
|
||||||
"reference": "3833d7255cc303546435cb650316bff708a1c75c"
|
"reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c",
|
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
|
||||||
"reference": "3833d7255cc303546435cb650316bff708a1c75c",
|
"reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2"
|
"php": ">=7.1"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-intl": "For best performance"
|
"ext-intl": "For best performance"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.28-dev"
|
||||||
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"url": "https://github.com/symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
"name": "symfony/polyfill"
|
"url": "https://github.com/symfony/polyfill"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -119,7 +122,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0"
|
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|
@ -135,22 +138,22 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-09-09T11:45:10+00:00"
|
"time": "2023-01-26T09:26:14+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
{
|
{
|
||||||
"name": "dflydev/dot-access-data",
|
"name": "dflydev/dot-access-data",
|
||||||
"version": "v3.0.3",
|
"version": "v3.0.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/dflydev/dflydev-dot-access-data.git",
|
"url": "https://github.com/dflydev/dflydev-dot-access-data.git",
|
||||||
"reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f"
|
"reference": "f41715465d65213d644d3141a6a93081be5d3549"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/a23a2bf4f31d3518f3ecb38660c95715dfead60f",
|
"url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/f41715465d65213d644d3141a6a93081be5d3549",
|
||||||
"reference": "a23a2bf4f31d3518f3ecb38660c95715dfead60f",
|
"reference": "f41715465d65213d644d3141a6a93081be5d3549",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -210,22 +213,22 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/dflydev/dflydev-dot-access-data/issues",
|
"issues": "https://github.com/dflydev/dflydev-dot-access-data/issues",
|
||||||
"source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.3"
|
"source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.2"
|
||||||
},
|
},
|
||||||
"time": "2024-07-08T12:26:09+00:00"
|
"time": "2022-10-27T11:44:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/commonmark",
|
"name": "league/commonmark",
|
||||||
"version": "2.7.0",
|
"version": "2.4.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/commonmark.git",
|
"url": "https://github.com/thephpleague/commonmark.git",
|
||||||
"reference": "6fbb36d44824ed4091adbcf4c7d4a3923cdb3405"
|
"reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/6fbb36d44824ed4091adbcf4c7d4a3923cdb3405",
|
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/3669d6d5f7a47a93c08ddff335e6d945481a1dd5",
|
||||||
"reference": "6fbb36d44824ed4091adbcf4c7d4a3923cdb3405",
|
"reference": "3669d6d5f7a47a93c08ddff335e6d945481a1dd5",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -238,8 +241,8 @@
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"cebe/markdown": "^1.0",
|
"cebe/markdown": "^1.0",
|
||||||
"commonmark/cmark": "0.31.1",
|
"commonmark/cmark": "0.30.0",
|
||||||
"commonmark/commonmark.js": "0.31.1",
|
"commonmark/commonmark.js": "0.30.0",
|
||||||
"composer/package-versions-deprecated": "^1.8",
|
"composer/package-versions-deprecated": "^1.8",
|
||||||
"embed/embed": "^4.4",
|
"embed/embed": "^4.4",
|
||||||
"erusev/parsedown": "^1.0",
|
"erusev/parsedown": "^1.0",
|
||||||
|
|
@ -248,11 +251,10 @@
|
||||||
"michelf/php-markdown": "^1.4 || ^2.0",
|
"michelf/php-markdown": "^1.4 || ^2.0",
|
||||||
"nyholm/psr7": "^1.5",
|
"nyholm/psr7": "^1.5",
|
||||||
"phpstan/phpstan": "^1.8.2",
|
"phpstan/phpstan": "^1.8.2",
|
||||||
"phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0",
|
"phpunit/phpunit": "^9.5.21",
|
||||||
"scrutinizer/ocular": "^1.8.1",
|
"scrutinizer/ocular": "^1.8.1",
|
||||||
"symfony/finder": "^5.3 | ^6.0 | ^7.0",
|
"symfony/finder": "^5.3 | ^6.0",
|
||||||
"symfony/process": "^5.4 | ^6.0 | ^7.0",
|
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0",
|
||||||
"symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0",
|
|
||||||
"unleashedtech/php-coding-standard": "^3.1.1",
|
"unleashedtech/php-coding-standard": "^3.1.1",
|
||||||
"vimeo/psalm": "^4.24.0 || ^5.0.0"
|
"vimeo/psalm": "^4.24.0 || ^5.0.0"
|
||||||
},
|
},
|
||||||
|
|
@ -262,7 +264,7 @@
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "2.8-dev"
|
"dev-main": "2.5-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -319,7 +321,7 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-05-05T12:20:28+00:00"
|
"time": "2023-08-30T16:55:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/config",
|
"name": "league/config",
|
||||||
|
|
@ -405,31 +407,31 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nette/schema",
|
"name": "nette/schema",
|
||||||
"version": "v1.3.2",
|
"version": "v1.2.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nette/schema.git",
|
"url": "https://github.com/nette/schema.git",
|
||||||
"reference": "da801d52f0354f70a638673c4a0f04e16529431d"
|
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nette/schema/zipball/da801d52f0354f70a638673c4a0f04e16529431d",
|
"url": "https://api.github.com/repos/nette/schema/zipball/c9ff517a53903b3d4e29ec547fb20feecb05b8ab",
|
||||||
"reference": "da801d52f0354f70a638673c4a0f04e16529431d",
|
"reference": "c9ff517a53903b3d4e29ec547fb20feecb05b8ab",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"nette/utils": "^4.0",
|
"nette/utils": "^2.5.7 || ^3.1.5 || ^4.0",
|
||||||
"php": "8.1 - 8.4"
|
"php": "7.1 - 8.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"nette/tester": "^2.5.2",
|
"nette/tester": "^2.3 || ^2.4",
|
||||||
"phpstan/phpstan-nette": "^1.0",
|
"phpstan/phpstan-nette": "^1.0",
|
||||||
"tracy/tracy": "^2.8"
|
"tracy/tracy": "^2.7"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "1.3-dev"
|
"dev-master": "1.2-dev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -461,26 +463,26 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nette/schema/issues",
|
"issues": "https://github.com/nette/schema/issues",
|
||||||
"source": "https://github.com/nette/schema/tree/v1.3.2"
|
"source": "https://github.com/nette/schema/tree/v1.2.4"
|
||||||
},
|
},
|
||||||
"time": "2024-10-06T23:10:23+00:00"
|
"time": "2023-08-05T18:56:25+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nette/utils",
|
"name": "nette/utils",
|
||||||
"version": "v4.0.6",
|
"version": "v4.0.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/nette/utils.git",
|
"url": "https://github.com/nette/utils.git",
|
||||||
"reference": "ce708655043c7050eb050df361c5e313cf708309"
|
"reference": "9124157137da01b1f5a5a22d6486cb975f26db7e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/nette/utils/zipball/ce708655043c7050eb050df361c5e313cf708309",
|
"url": "https://api.github.com/repos/nette/utils/zipball/9124157137da01b1f5a5a22d6486cb975f26db7e",
|
||||||
"reference": "ce708655043c7050eb050df361c5e313cf708309",
|
"reference": "9124157137da01b1f5a5a22d6486cb975f26db7e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "8.0 - 8.4"
|
"php": ">=8.0 <8.4"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"nette/finder": "<3",
|
"nette/finder": "<3",
|
||||||
|
|
@ -498,7 +500,8 @@
|
||||||
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
|
"ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()",
|
||||||
"ext-json": "to use Nette\\Utils\\Json",
|
"ext-json": "to use Nette\\Utils\\Json",
|
||||||
"ext-mbstring": "to use Strings::lower() etc...",
|
"ext-mbstring": "to use Strings::lower() etc...",
|
||||||
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()"
|
"ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()",
|
||||||
|
"ext-xml": "to use Strings::length() etc. when mbstring is not available"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
|
|
@ -547,9 +550,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/nette/utils/issues",
|
"issues": "https://github.com/nette/utils/issues",
|
||||||
"source": "https://github.com/nette/utils/tree/v4.0.6"
|
"source": "https://github.com/nette/utils/tree/v4.0.1"
|
||||||
},
|
},
|
||||||
"time": "2025-03-30T21:06:30+00:00"
|
"time": "2023-07-30T15:42:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/event-dispatcher",
|
"name": "psr/event-dispatcher",
|
||||||
|
|
@ -603,16 +606,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v3.5.1",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
|
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||||
"reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
|
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -620,12 +623,12 @@
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"thanks": {
|
|
||||||
"url": "https://github.com/symfony/contracts",
|
|
||||||
"name": "symfony/contracts"
|
|
||||||
},
|
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.5-dev"
|
"dev-main": "3.4-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/contracts",
|
||||||
|
"url": "https://github.com/symfony/contracts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -650,7 +653,7 @@
|
||||||
"description": "A generic function and convention to trigger deprecation notices",
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|
@ -666,30 +669,33 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-09-25T14:20:29+00:00"
|
"time": "2023-05-23T14:45:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-php80",
|
"name": "symfony/polyfill-php80",
|
||||||
"version": "v1.32.0",
|
"version": "v1.28.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
|
"reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
|
||||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
"reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2"
|
"php": ">=7.1"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.28-dev"
|
||||||
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"url": "https://github.com/symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
"name": "symfony/polyfill"
|
"url": "https://github.com/symfony/polyfill"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|
@ -730,7 +736,7 @@
|
||||||
"shim"
|
"shim"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
|
"source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|
@ -746,20 +752,15 @@
|
||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2025-01-02T08:10:11+00:00"
|
"time": "2023-01-26T09:26:14+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {
|
"stability-flags": [],
|
||||||
"erusev/parsedown": 20
|
|
||||||
},
|
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": [],
|
||||||
"php": ">=7.2",
|
"platform-dev": [],
|
||||||
"ext-mbstring": "*"
|
"plugin-api-version": "2.3.0"
|
||||||
},
|
|
||||||
"platform-dev": {},
|
|
||||||
"plugin-api-version": "2.6.0"
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,4 @@
|
||||||
#dir="$( dirname -- "$( readlink -f -- "$0"; )"; )"
|
#dir="$( dirname -- "$( readlink -f -- "$0"; )"; )"
|
||||||
dir="$PWD"
|
dir="$PWD"
|
||||||
|
|
||||||
app=$(which podman)
|
docker run -it --rm -v "$dir:/app" composer $@
|
||||||
if [ -z $app ]; then
|
|
||||||
app="docker"
|
|
||||||
fi
|
|
||||||
|
|
||||||
$app run -it --rm -v "$dir:/app" composer $@
|
|
||||||
|
|
|
||||||
1
docker/dev/.gitignore
vendored
Normal file
1
docker/dev/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
*/db_data
|
||||||
4
docker/dev/_mariadb100/my.cnf
Normal file
4
docker/dev/_mariadb100/my.cnf
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
[mysqld]
|
||||||
|
collation-server = utf8mb4_unicode_ci
|
||||||
|
character-set-server = utf8mb4
|
||||||
|
innodb_log_file_size=10M
|
||||||
4
docker/dev/_mariadb105/my.cnf
Normal file
4
docker/dev/_mariadb105/my.cnf
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
[mysqld]
|
||||||
|
collation-server = utf8mb4_unicode_ci
|
||||||
|
character-set-server = utf8mb4
|
||||||
|
innodb_log_file_size=10M
|
||||||
4
docker/dev/_mariadb108/my.cnf
Normal file
4
docker/dev/_mariadb108/my.cnf
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
[mysqld]
|
||||||
|
collation-server = utf8mb4_unicode_ci
|
||||||
|
character-set-server = utf8mb4
|
||||||
|
innodb_log_file_size=10M
|
||||||
23
docker/dev/_nginx/Dockerfile-angie-alpine
Normal file
23
docker/dev/_nginx/Dockerfile-angie-alpine
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
FROM alpine:latest
|
||||||
|
|
||||||
|
RUN set -x \
|
||||||
|
&& apk add --no-cache ca-certificates curl \
|
||||||
|
&& curl -o /etc/apk/keys/angie-signing.rsa https://angie.software/keys/angie-signing.rsa \
|
||||||
|
&& echo "https://download.angie.software/angie/alpine/v$(egrep -o '[0-9]+\.[0-9]+' /etc/alpine-release)/main" >> /etc/apk/repositories \
|
||||||
|
&& apk add --no-cache angie \
|
||||||
|
&& rm /etc/apk/keys/angie-signing.rsa \
|
||||||
|
&& ln -sf /dev/stdout /var/log/angie/access.log \
|
||||||
|
&& ln -sf /dev/stderr /var/log/angie/error.log
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["angie", "-g", "daemon off;"]
|
||||||
|
|
||||||
|
|
||||||
|
RUN mv /etc/angie/http.d/default.conf /etc/angie/http.d/default.conf.bak \
|
||||||
|
&& mkdir /var/log/nginx \
|
||||||
|
&& ln -sf /var/log/angie/access.log /var/log/nginx/access.log
|
||||||
|
|
||||||
|
# config from nginx
|
||||||
|
COPY default.conf /etc/angie/http.d/default.conf
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
5
docker/dev/_nginx/Dockerfile-nginx
Normal file
5
docker/dev/_nginx/Dockerfile-nginx
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
COPY default.conf /etc/nginx/conf.d/
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
5
docker/dev/_nginx/Dockerfile-nginx-alpine
Normal file
5
docker/dev/_nginx/Dockerfile-nginx-alpine
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
COPY default.conf /etc/nginx/conf.d/
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
59
docker/dev/_nginx/default.conf
Normal file
59
docker/dev/_nginx/default.conf
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
# format like 'main' excluding user agent
|
||||||
|
log_format mtt '$time_local "$request" $status $body_bytes_sent "$http_referer"';
|
||||||
|
log_format mtt2 '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer"';
|
||||||
|
access_log off;
|
||||||
|
|
||||||
|
upstream fpm {
|
||||||
|
server fpm:9000;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
root /var/www/html; # same as php-fpm
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log mtt;
|
||||||
|
|
||||||
|
index index.php index.html;
|
||||||
|
autoindex off;
|
||||||
|
|
||||||
|
location = /phpinfo {
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME /var/www/phpinfo/phpinfo.php;
|
||||||
|
fastcgi_pass fpm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
rewrite ^/api/(.*) /api.php/$1 last;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ [^/]\.php(/|$) {
|
||||||
|
|
||||||
|
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||||
|
if (!-f $document_root$fastcgi_script_name) {
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
|
include fastcgi_params;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_pass fpm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /db/ {
|
||||||
|
return 404; #deny all
|
||||||
|
}
|
||||||
|
|
||||||
|
location /includes/ {
|
||||||
|
return 404; #deny all
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
return 404; #deny all
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
1
docker/dev/mtt-php72-angie-postgres10/.env
Normal file
1
docker/dev/mtt-php72-angie-postgres10/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php72-angie-postgres10
|
||||||
17
docker/dev/mtt-php72-angie-postgres10/Dockerfile-fpm
Normal file
17
docker/dev/mtt-php72-angie-postgres10/Dockerfile-fpm
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM php:7.2-fpm-alpine
|
||||||
|
|
||||||
|
RUN apk add --update-cache libpq postgresql-dev && \
|
||||||
|
docker-php-ext-install pdo_mysql pdo_pgsql && \
|
||||||
|
apk del postgresql-dev && rm -rf /var/cache/apk/* && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php phpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-8.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
58
docker/dev/mtt-php72-angie-postgres10/compose.yml
Normal file
58
docker/dev/mtt-php72-angie-postgres10/compose.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../_nginx
|
||||||
|
dockerfile: Dockerfile-angie-alpine
|
||||||
|
image: mtt-dev/angie:alpine
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- fpm
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
fpm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-fpm
|
||||||
|
image: mtt-dev/php:7.2-fpm-alpine
|
||||||
|
container_name: ${PLATFORM_NAME}-fpm
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=postgres
|
||||||
|
- MTT_API_USE_PATH_INFO=YES
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mtt
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
# do not use alpine image due to missing locales
|
||||||
|
image: postgres:10.0
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
userns_mode: keep-id
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mtt
|
||||||
|
POSTGRES_USER: mtt
|
||||||
|
POSTGRES_DB: mtt
|
||||||
|
volumes:
|
||||||
|
- ../_postgres10/db_data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
13
docker/dev/mtt-php72-angie-postgres10/php-fpm-www.conf
Normal file
13
docker/dev/mtt-php72-angie-postgres10/php-fpm-www.conf
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[www]
|
||||||
|
user = www-data
|
||||||
|
group = www-data
|
||||||
|
listen = 127.0.0.1:9000
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 5
|
||||||
|
pm.start_servers = 2
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
pm.max_spare_servers = 3
|
||||||
|
pm.max_requests = 500
|
||||||
|
|
||||||
|
access.format = "%R - %u [%t] \"%m %r\" %s %f"
|
||||||
|
access.log = /dev/null
|
||||||
10
docker/dev/mtt-php72-angie-postgres10/php-mtt.ini
Normal file
10
docker/dev/mtt-php72-angie-postgres10/php-mtt.ini
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
cgi.fix_pathinfo=0
|
||||||
|
session.gc_divisor = 100
|
||||||
42
docker/dev/mtt-php72-angie-postgres10/php-opcache.ini
Normal file
42
docker/dev/mtt-php72-angie-postgres10/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php72-apache-mariadb100/.env
Normal file
1
docker/dev/mtt-php72-apache-mariadb100/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php72-apache-mariadb100
|
||||||
47
docker/dev/mtt-php72-apache-mariadb100/compose.yml
Normal file
47
docker/dev/mtt-php72-apache-mariadb100/compose.yml
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../mtt-php72-apache/
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:7.2-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=mysql
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mytinytodo
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
- MTT_DB_DRIVER=mysqli
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../mtt-php72-apache/php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ../mtt-php72-apache/php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:10.0.15
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
#restart: always
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: JustForDev
|
||||||
|
MYSQL_USER: mtt
|
||||||
|
MYSQL_PASSWORD: mtt
|
||||||
|
MYSQL_DATABASE: mytinytodo
|
||||||
|
volumes:
|
||||||
|
- ../_mariadb100/my.cnf:/etc/mysql/conf.d/my.cnf
|
||||||
|
- ../_mariadb100/db_data:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
1
docker/dev/mtt-php72-apache-mariadb105/.env
Normal file
1
docker/dev/mtt-php72-apache-mariadb105/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php72-apache-mariadb105
|
||||||
47
docker/dev/mtt-php72-apache-mariadb105/compose.yml
Normal file
47
docker/dev/mtt-php72-apache-mariadb105/compose.yml
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../mtt-php72-apache/
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:7.2-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=mysql
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mytinytodo
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
- MTT_DB_DRIVER=mysqli
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../mtt-php72-apache/php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ../mtt-php72-apache/php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:10.5
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
#restart: always
|
||||||
|
environment:
|
||||||
|
MARIADB_ROOT_PASSWORD: JustForDev
|
||||||
|
MARIADB_USER: mtt
|
||||||
|
MARIADB_PASSWORD: mtt
|
||||||
|
MARIADB_DATABASE: mytinytodo
|
||||||
|
volumes:
|
||||||
|
- ../_mariadb105/my.cnf:/etc/mysql/conf.d/my.cnf
|
||||||
|
- ../_mariadb105/db_data:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
1
docker/dev/mtt-php72-apache-postgres10/.env
Normal file
1
docker/dev/mtt-php72-apache-postgres10/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php72-apache-postgres10
|
||||||
45
docker/dev/mtt-php72-apache-postgres10/compose.yml
Normal file
45
docker/dev/mtt-php72-apache-postgres10/compose.yml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../mtt-php72-apache/
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:7.2-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=postgres
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mtt
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../mtt-php72-apache/php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ../mtt-php72-apache/php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
# do not use alpine image due to missing locales
|
||||||
|
image: postgres:10.0
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
userns_mode: keep-id
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mtt
|
||||||
|
POSTGRES_USER: mtt
|
||||||
|
POSTGRES_DB: mtt
|
||||||
|
volumes:
|
||||||
|
- ../_postgres10/db_data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
1
docker/dev/mtt-php72-apache/.env
Normal file
1
docker/dev/mtt-php72-apache/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php72-apache
|
||||||
18
docker/dev/mtt-php72-apache/Dockerfile-web
Normal file
18
docker/dev/mtt-php72-apache/Dockerfile-web
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
FROM php:7.2-apache-buster
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y libpq5 libpq-dev && \
|
||||||
|
docker-php-ext-install mysqli pdo_pgsql && \
|
||||||
|
apt-get remove -y libpq-dev && apt-get -y autoremove && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
echo 'Alias "/phpinfo" "/var/www/phpinfo/phpinfo.php"' > /etc/apache2/conf-enabled/phpinfo.conf && \
|
||||||
|
echo 'LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\"" combined' > /etc/apache2/conf-enabled/logformat.conf && \
|
||||||
|
a2enmod rewrite && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-8.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
17
docker/dev/mtt-php72-apache/compose.yml
Normal file
17
docker/dev/mtt-php72-apache/compose.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:7.2-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
11
docker/dev/mtt-php72-apache/php-mtt.ini
Normal file
11
docker/dev/mtt-php72-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
|
|
||||||
|
allow_url_fopen=1
|
||||||
34
docker/dev/mtt-php72-apache/php-opcache.ini
Normal file
34
docker/dev/mtt-php72-apache/php-opcache.ini
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=0
|
||||||
|
opcache.enable_cli=0
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php74-apache/.env
Normal file
1
docker/dev/mtt-php74-apache/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php74-apache
|
||||||
15
docker/dev/mtt-php74-apache/Dockerfile-web
Normal file
15
docker/dev/mtt-php74-apache/Dockerfile-web
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM php:7.4-apache
|
||||||
|
|
||||||
|
RUN docker-php-ext-install mysqli && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
echo 'Alias "/phpinfo" "/var/www/phpinfo/phpinfo.php"' > /etc/apache2/conf-enabled/phpinfo.conf && \
|
||||||
|
echo 'LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\"" combined' > /etc/apache2/conf-enabled/logformat.conf && \
|
||||||
|
a2enmod rewrite && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-9.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
#COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
#COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
17
docker/dev/mtt-php74-apache/compose.yml
Normal file
17
docker/dev/mtt-php74-apache/compose.yml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:7.4-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
9
docker/dev/mtt-php74-apache/php-mtt.ini
Normal file
9
docker/dev/mtt-php74-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
34
docker/dev/mtt-php74-apache/php-opcache.ini
Normal file
34
docker/dev/mtt-php74-apache/php-opcache.ini
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=0
|
||||||
|
opcache.enable_cli=0
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php74-nginx/.env
Normal file
1
docker/dev/mtt-php74-nginx/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php74-nginx
|
||||||
11
docker/dev/mtt-php74-nginx/Dockerfile-fpm
Normal file
11
docker/dev/mtt-php74-nginx/Dockerfile-fpm
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
FROM php:7.4-fpm
|
||||||
|
|
||||||
|
RUN docker-php-ext-install mysqli && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php
|
||||||
|
|
||||||
|
#COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
#COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
37
docker/dev/mtt-php74-nginx/compose.yml
Normal file
37
docker/dev/mtt-php74-nginx/compose.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../_nginx
|
||||||
|
dockerfile: Dockerfile-nginx
|
||||||
|
image: mtt-dev/nginx
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- fpm
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
fpm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-fpm
|
||||||
|
image: mtt-dev/php:7.4-fpm
|
||||||
|
container_name: ${PLATFORM_NAME}-fpm
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
10
docker/dev/mtt-php74-nginx/php-mtt.ini
Normal file
10
docker/dev/mtt-php74-nginx/php-mtt.ini
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
|
cgi.fix_pathinfo=0
|
||||||
42
docker/dev/mtt-php74-nginx/php-opcache.ini
Normal file
42
docker/dev/mtt-php74-nginx/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php80-apache-mariadb105/.env
Normal file
1
docker/dev/mtt-php80-apache-mariadb105/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php80-apache-mariadb105
|
||||||
45
docker/dev/mtt-php80-apache-mariadb105/compose.yml
Normal file
45
docker/dev/mtt-php80-apache-mariadb105/compose.yml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../mtt-php80-apache/
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:8.0-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=mysql
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mytinytodo
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
- MTT_DB_DRIVER=mysqli
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:10.5
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
#restart: always
|
||||||
|
environment:
|
||||||
|
MARIADB_ROOT_PASSWORD: JustForDev
|
||||||
|
MARIADB_USER: mtt
|
||||||
|
MARIADB_PASSWORD: mtt
|
||||||
|
MARIADB_DATABASE: mytinytodo
|
||||||
|
volumes:
|
||||||
|
- ../_mariadb105/my.cnf:/etc/mysql/conf.d/my.cnf
|
||||||
|
- ../_mariadb105/db_data:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
1
docker/dev/mtt-php80-apache/.env
Normal file
1
docker/dev/mtt-php80-apache/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php80-apache
|
||||||
15
docker/dev/mtt-php80-apache/Dockerfile-web
Normal file
15
docker/dev/mtt-php80-apache/Dockerfile-web
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM php:8.0-apache
|
||||||
|
|
||||||
|
RUN docker-php-ext-install mysqli && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
echo 'Alias "/phpinfo" "/var/www/phpinfo/phpinfo.php"' > /etc/apache2/conf-enabled/phpinfo.conf && \
|
||||||
|
echo 'LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\"" combined' > /etc/apache2/conf-enabled/logformat.conf && \
|
||||||
|
a2enmod rewrite && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-9.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
16
docker/dev/mtt-php80-apache/compose.yml
Normal file
16
docker/dev/mtt-php80-apache/compose.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:8.0-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
9
docker/dev/mtt-php80-apache/php-mtt.ini
Normal file
9
docker/dev/mtt-php80-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
42
docker/dev/mtt-php80-apache/php-opcache.ini
Normal file
42
docker/dev/mtt-php80-apache/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=0
|
||||||
|
opcache.enable_cli=0
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php81-apache-mariadb108/.env
Normal file
1
docker/dev/mtt-php81-apache-mariadb108/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php81-apache-mariadb108
|
||||||
56
docker/dev/mtt-php81-apache-mariadb108/compose.yml
Normal file
56
docker/dev/mtt-php81-apache-mariadb108/compose.yml
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../mtt-php81-apache/
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:8.1-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=mysql
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mytinytodo
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
- MTT_DB_DRIVER=mysqli
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: mariadb:10.8
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
#restart: always
|
||||||
|
environment:
|
||||||
|
MARIADB_ROOT_PASSWORD: JustForDev
|
||||||
|
MARIADB_USER: mtt
|
||||||
|
MARIADB_PASSWORD: mtt
|
||||||
|
MARIADB_DATABASE: mytinytodo
|
||||||
|
volumes:
|
||||||
|
- ../_mariadb108/my.cnf:/etc/mysql/conf.d/my.cnf
|
||||||
|
- ../_mariadb108/db_data:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
image: adminer:latest
|
||||||
|
container_name: ${PLATFORM_NAME}-adminer
|
||||||
|
environment:
|
||||||
|
ADMINER_DEFAULT_SERVER: db
|
||||||
|
ports:
|
||||||
|
- 8079:8080
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
1
docker/dev/mtt-php81-apache/.env
Normal file
1
docker/dev/mtt-php81-apache/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php81-apache
|
||||||
16
docker/dev/mtt-php81-apache/Dockerfile-web
Normal file
16
docker/dev/mtt-php81-apache/Dockerfile-web
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
FROM php:8.1-apache
|
||||||
|
|
||||||
|
RUN docker-php-ext-install mysqli && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
echo 'Alias "/phpinfo" "/var/www/phpinfo/phpinfo.php"' > /etc/apache2/conf-enabled/phpinfo.conf && \
|
||||||
|
a2enmod rewrite && \
|
||||||
|
echo 'LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\"" combined' > /etc/apache2/conf-enabled/logformat.conf && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-9.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
16
docker/dev/mtt-php81-apache/compose.yml
Normal file
16
docker/dev/mtt-php81-apache/compose.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:8.1-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
9
docker/dev/mtt-php81-apache/php-mtt.ini
Normal file
9
docker/dev/mtt-php81-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
42
docker/dev/mtt-php81-apache/php-opcache.ini
Normal file
42
docker/dev/mtt-php81-apache/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=0
|
||||||
|
opcache.enable_cli=0
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php82-angie-postgres10/.env
Normal file
1
docker/dev/mtt-php82-angie-postgres10/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php82-angie-postgres10
|
||||||
58
docker/dev/mtt-php82-angie-postgres10/compose.yml
Normal file
58
docker/dev/mtt-php82-angie-postgres10/compose.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../_nginx
|
||||||
|
dockerfile: Dockerfile-angie-alpine
|
||||||
|
image: mtt-dev/angie:alpine
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- fpm
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
fpm:
|
||||||
|
build:
|
||||||
|
context: ../mtt-php82-angie
|
||||||
|
dockerfile: Dockerfile-fpm
|
||||||
|
image: mtt-dev/php:8.2-fpm-alpine
|
||||||
|
container_name: ${PLATFORM_NAME}-fpm
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=postgres
|
||||||
|
- MTT_API_USE_PATH_INFO=YES
|
||||||
|
- MTT_DB_HOST=db
|
||||||
|
- MTT_DB_NAME=mtt
|
||||||
|
- MTT_DB_USER=mtt
|
||||||
|
- MTT_DB_PASSWORD=mtt
|
||||||
|
- MTT_DB_PREFIX=mtt_
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ../mtt-php82-angie/php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ../mtt-php82-angie/php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
db:
|
||||||
|
# do not use alpine image due to missing locales
|
||||||
|
image: postgres:10.0
|
||||||
|
container_name: ${PLATFORM_NAME}-db
|
||||||
|
userns_mode: keep-id
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mtt
|
||||||
|
POSTGRES_USER: mtt
|
||||||
|
POSTGRES_DB: mtt
|
||||||
|
volumes:
|
||||||
|
- ../_postgres10/db_data:/var/lib/postgresql/data
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
1
docker/dev/mtt-php82-angie/.env
Normal file
1
docker/dev/mtt-php82-angie/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php82-angie-alpine
|
||||||
17
docker/dev/mtt-php82-angie/Dockerfile-fpm
Normal file
17
docker/dev/mtt-php82-angie/Dockerfile-fpm
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM php:8.2-fpm-alpine
|
||||||
|
|
||||||
|
RUN apk add --update-cache libpq postgresql-dev icu icu-dev && \
|
||||||
|
docker-php-ext-install pdo_mysql pdo_pgsql intl && \
|
||||||
|
apk del postgresql-dev icu-dev && rm -rf /var/cache/apk/* && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
echo "<?php phpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-10.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf
|
||||||
|
|
||||||
|
VOLUME /var/www/html
|
||||||
40
docker/dev/mtt-php82-angie/compose.yml
Normal file
40
docker/dev/mtt-php82-angie/compose.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
network:
|
||||||
|
name: "${PLATFORM_NAME}-network"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: ../_nginx
|
||||||
|
dockerfile: Dockerfile-angie-alpine
|
||||||
|
image: mtt-dev/angie:alpine
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- fpm
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
|
|
||||||
|
fpm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-fpm
|
||||||
|
image: mtt-dev/php:8.2-fpm-alpine
|
||||||
|
container_name: ${PLATFORM_NAME}-fpm
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
- MTT_API_USE_PATH_INFO=YES
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- network
|
||||||
13
docker/dev/mtt-php82-angie/php-fpm-www.conf
Normal file
13
docker/dev/mtt-php82-angie/php-fpm-www.conf
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[www]
|
||||||
|
user = www-data
|
||||||
|
group = www-data
|
||||||
|
listen = 127.0.0.1:9000
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 5
|
||||||
|
pm.start_servers = 2
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
pm.max_spare_servers = 3
|
||||||
|
pm.max_requests = 500
|
||||||
|
|
||||||
|
access.format = "%R - %u [%t] \"%m %r\" %s %f"
|
||||||
|
access.log = /dev/null
|
||||||
12
docker/dev/mtt-php82-angie/php-mtt.ini
Normal file
12
docker/dev/mtt-php82-angie/php-mtt.ini
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
cgi.fix_pathinfo=0
|
||||||
|
session.gc_divisor = 100
|
||||||
|
|
||||||
|
allow_url_fopen=1
|
||||||
42
docker/dev/mtt-php82-angie/php-opcache.ini
Normal file
42
docker/dev/mtt-php82-angie/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.enable_cli=1
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php82-apache/.env
Normal file
1
docker/dev/mtt-php82-apache/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php82-apache
|
||||||
17
docker/dev/mtt-php82-apache/Dockerfile-web
Normal file
17
docker/dev/mtt-php82-apache/Dockerfile-web
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
FROM php:8.2-apache-buster
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y libicu-dev && \
|
||||||
|
docker-php-ext-install mysqli intl && \
|
||||||
|
apt-get -y autoremove && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
a2enmod rewrite && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
echo 'Alias "/phpinfo" "/var/www/phpinfo/phpinfo.php"' > /etc/apache2/conf-enabled/phpinfo.conf && \
|
||||||
|
echo 'LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\"" combined' > /etc/apache2/conf-enabled/logformat.conf && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-9.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
19
docker/dev/mtt-php82-apache/compose.yml
Normal file
19
docker/dev/mtt-php82-apache/compose.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:8.2-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
9
docker/dev/mtt-php82-apache/php-mtt.ini
Normal file
9
docker/dev/mtt-php82-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
42
docker/dev/mtt-php82-apache/php-opcache.ini
Normal file
42
docker/dev/mtt-php82-apache/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=0
|
||||||
|
opcache.enable_cli=0
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
1
docker/dev/mtt-php83-apache/.env
Normal file
1
docker/dev/mtt-php83-apache/.env
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
PLATFORM_NAME=mtt-dev-php83-apache
|
||||||
15
docker/dev/mtt-php83-apache/Dockerfile-web
Normal file
15
docker/dev/mtt-php83-apache/Dockerfile-web
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
FROM php:8.3-rc-apache
|
||||||
|
|
||||||
|
RUN docker-php-ext-install mysqli && \
|
||||||
|
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" && \
|
||||||
|
mkdir /var/www/phpinfo && \
|
||||||
|
a2enmod rewrite && \
|
||||||
|
echo "<?php\nphpinfo();" > /var/www/phpinfo/phpinfo.php && \
|
||||||
|
echo 'Alias "/phpinfo" "/var/www/phpinfo/phpinfo.php"' > /etc/apache2/conf-enabled/phpinfo.conf && \
|
||||||
|
echo 'LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\"" combined' > /etc/apache2/conf-enabled/logformat.conf && \
|
||||||
|
curl -o /usr/local/bin/phpunit -fL "https://phar.phpunit.de/phpunit-9.phar" && \
|
||||||
|
chmod +x /usr/local/bin/phpunit && \
|
||||||
|
ln -s html /var/www/src
|
||||||
|
|
||||||
|
COPY php-mtt.ini /usr/local/etc/php/conf.d/
|
||||||
|
COPY php-opcache.ini /usr/local/etc/php/conf.d/
|
||||||
19
docker/dev/mtt-php83-apache/compose.yml
Normal file
19
docker/dev/mtt-php83-apache/compose.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
version: "3.9"
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-web
|
||||||
|
image: mtt-dev/php:8.3-apache
|
||||||
|
container_name: ${PLATFORM_NAME}-web
|
||||||
|
ports:
|
||||||
|
- "8080:80"
|
||||||
|
environment:
|
||||||
|
- MTT_ENABLE_DEBUG=YES
|
||||||
|
- MTT_DB_TYPE=sqlite
|
||||||
|
volumes:
|
||||||
|
- ../../../src:/var/www/html
|
||||||
|
- ../../../tests:/var/www/tests
|
||||||
|
- ./php-mtt.ini:/usr/local/etc/php/conf.d/php-mtt.ini
|
||||||
|
- ./php-opcache.ini:/usr/local/etc/php/conf.d/php-opcache.ini
|
||||||
11
docker/dev/mtt-php83-apache/php-mtt.ini
Normal file
11
docker/dev/mtt-php83-apache/php-mtt.ini
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
; Since PHP 5.4 E_STRICT is included in E_ALL
|
||||||
|
error_reporting = E_ALL
|
||||||
|
|
||||||
|
log_errors = On
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
|
||||||
|
session.gc_divisor = 100
|
||||||
|
|
||||||
|
allow_url_fopen=1
|
||||||
42
docker/dev/mtt-php83-apache/php-opcache.ini
Normal file
42
docker/dev/mtt-php83-apache/php-opcache.ini
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
;; opcache.ini
|
||||||
|
|
||||||
|
;; check /usr/local/etc/php/conf.d if exists docker-php-ext-opcache.ini
|
||||||
|
|
||||||
|
; To disable opcache just comment this line
|
||||||
|
zend_extension=opcache.so
|
||||||
|
|
||||||
|
[opcache]
|
||||||
|
opcache.enable=0
|
||||||
|
opcache.enable_cli=0
|
||||||
|
|
||||||
|
; JIT will work only if opcache is enabled and jit_buffer_size is not zero.
|
||||||
|
; To disable JIT set the buffer size to 0.
|
||||||
|
opcache.jit_buffer_size=64M
|
||||||
|
|
||||||
|
; JIT mode. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.jit
|
||||||
|
; Default is tracing.
|
||||||
|
opcache.jit=tracing
|
||||||
|
|
||||||
|
; The size of the shared memory storage used by OPcache, in megabytes. The minimum permissible value is "8", which is enforced if a smaller value is set.
|
||||||
|
; Default is 128.
|
||||||
|
opcache.memory_consumption=128
|
||||||
|
|
||||||
|
; The maximum number of keys (and therefore scripts) in the OPcache hash table.
|
||||||
|
; The actual value used will be the first number in the set of prime numbers
|
||||||
|
; { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }
|
||||||
|
; that is greater than or equal to the configured value.
|
||||||
|
; The minimum value is 200. The maximum value is 1000000. Values outside of this range are clamped to the permissible range.
|
||||||
|
; Default is 10000.
|
||||||
|
opcache.max_accelerated_files=1000
|
||||||
|
|
||||||
|
; How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.
|
||||||
|
; This configuration directive is ignored if opcache.validate_timestamps is disabled.
|
||||||
|
; Default is 2.
|
||||||
|
opcache.revalidate_freq=2
|
||||||
|
|
||||||
|
; If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds.
|
||||||
|
; When this directive is disabled, you must reset OPcache manually via opcache_reset(), opcache_invalidate()
|
||||||
|
; or by restarting the Web server for changes to the filesystem to take effect.
|
||||||
|
; Default is 1.
|
||||||
|
;; Override in docker-compose
|
||||||
|
opcache.validate_timestamps=1
|
||||||
8
docker/dev/readme.md
Normal file
8
docker/dev/readme.md
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
Docker containers for development and testing purposes.
|
||||||
|
Not recommended for production usage!
|
||||||
|
|
||||||
|
To run docker container:
|
||||||
|
|
||||||
|
cd mtt-php74-apache
|
||||||
|
docker-compose build --pull
|
||||||
|
docker-compose up
|
||||||
|
|
@ -1,29 +1,12 @@
|
||||||
# For REST API in Apache
|
# For Apache
|
||||||
#<IfModule mod_rewrite.c>
|
#<IfModule mod_rewrite.c>
|
||||||
# RewriteEngine On
|
# RewriteEngine On
|
||||||
# RewriteCond %{REQUEST_FILENAME} !-f
|
# RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
# RewriteCond %{REQUEST_FILENAME} !-d
|
# RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
# RewriteRule ^api/(.*)$ api.php/$1 [L,QSA]
|
# RewriteRule ^api/(.*)$ api.php/$1 [L,QSA]
|
||||||
#</IfModule>
|
#</IfModule>
|
||||||
#<Limit GET POST PUT DELETE>
|
|
||||||
# Allow from all
|
|
||||||
#</Limit>
|
|
||||||
|
|
||||||
|
# For Nginx set something like this:
|
||||||
# In Nginx set something like this:
|
|
||||||
|
|
||||||
# Deny access to some files and folders
|
|
||||||
#location ~ ^/(db|includes)/ {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
#location ~ /\.ht {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
#location ~* ^/ext/.*\.(json|md)$ {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Optional
|
|
||||||
# location /api/ {
|
# location /api/ {
|
||||||
# rewrite ^/api/(.*) /api.php/$1 last;
|
# rewrite ^/api/(.*) /api.php/$1 last;
|
||||||
# }
|
# }
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||||
myTinyTodo
|
myTinyTodo
|
||||||
--------------
|
--------------
|
||||||
Url: https://www.mytinytodo.net/
|
Url: https://www.mytinytodo.net/
|
||||||
Copyright: 2009-2011,2019-2025 Max Pozdeev <maxpozdeev@gmail.com>
|
Copyright: 2009-2011,2019-2023 Max Pozdeev <maxpozdeev@gmail.com>
|
||||||
License: GPL version 2 or any later (see LICENSE file)
|
License: GPL version 2 or any later (see LICENSE file)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -48,12 +48,7 @@ Url: https://parsedown.org/
|
||||||
Copyright: (c) 2013-2018 Emanuil Rusev, erusev.com
|
Copyright: (c) 2013-2018 Emanuil Rusev, erusev.com
|
||||||
License: MIT license. Compatible with GNU GPL.
|
License: MIT license. Compatible with GNU GPL.
|
||||||
|
|
||||||
Other libraries (in includes/vendor)
|
|
||||||
----------------------------------------------
|
|
||||||
symfony/polyfill-intl-normalizer
|
|
||||||
league/commonmark
|
|
||||||
|
|
||||||
Images
|
Images
|
||||||
--------------
|
------
|
||||||
This software contains images by 3d-parties.
|
This software contains images by 3d-parties.
|
||||||
See file content/theme/images/COPYRIGHT for details.
|
See files content/themes/images/COPYRIGHT for details.
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ $endpoints = array(
|
||||||
'GET' => [ ListsController::class , 'getId' ],
|
'GET' => [ ListsController::class , 'getId' ],
|
||||||
'PUT' => [ ListsController::class , 'putId' ],
|
'PUT' => [ ListsController::class , 'putId' ],
|
||||||
'DELETE' => [ ListsController::class , 'deleteId' ],
|
'DELETE' => [ ListsController::class , 'deleteId' ],
|
||||||
'POST' => [ ListsController::class , 'putId' ], //compatibility
|
|
||||||
],
|
],
|
||||||
'/tasks' => [
|
'/tasks' => [
|
||||||
'GET' => [ TasksController::class , 'get' ],
|
'GET' => [ TasksController::class , 'get' ],
|
||||||
|
|
@ -42,7 +41,6 @@ $endpoints = array(
|
||||||
'/tasks/(-?\d+)' => [
|
'/tasks/(-?\d+)' => [
|
||||||
'PUT' => [ TasksController::class , 'putId' ],
|
'PUT' => [ TasksController::class , 'putId' ],
|
||||||
'DELETE' => [ TasksController::class , 'deleteId' ],
|
'DELETE' => [ TasksController::class , 'deleteId' ],
|
||||||
'POST' => [ TasksController::class , 'putId' ], //compatibility
|
|
||||||
],
|
],
|
||||||
'/tasks/parseTitle' => [
|
'/tasks/parseTitle' => [
|
||||||
'POST' => [ TasksController::class , 'postTitleParse' ],
|
'POST' => [ TasksController::class , 'postTitleParse' ],
|
||||||
|
|
@ -62,7 +60,6 @@ $endpoints = array(
|
||||||
'/ext-settings/(.+)' => [
|
'/ext-settings/(.+)' => [
|
||||||
'GET' => [ ExtSettingsController::class , 'get' ],
|
'GET' => [ ExtSettingsController::class , 'get' ],
|
||||||
'PUT' => [ ExtSettingsController::class , 'put' ],
|
'PUT' => [ ExtSettingsController::class , 'put' ],
|
||||||
'POST' => [ ExtSettingsController::class , 'put' ], //compatibility
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -151,7 +148,7 @@ function myErrorHandler($errno, $errstr, $errfile, $errline)
|
||||||
if ($errno==E_ERROR || $errno==E_CORE_ERROR || $errno==E_COMPILE_ERROR || $errno==E_USER_ERROR || $errno==E_PARSE) {
|
if ($errno==E_ERROR || $errno==E_CORE_ERROR || $errno==E_COMPILE_ERROR || $errno==E_USER_ERROR || $errno==E_PARSE) {
|
||||||
$error = 'Error';
|
$error = 'Error';
|
||||||
}
|
}
|
||||||
elseif ($errno==E_WARNING || $errno==E_CORE_WARNING || $errno==E_COMPILE_WARNING || $errno==E_USER_WARNING) {
|
elseif ($errno==E_WARNING || $errno==E_CORE_WARNING || $errno==E_COMPILE_WARNING || $errno==E_USER_WARNING || $errno==E_STRICT) {
|
||||||
if (error_reporting() & $errno) $error = 'Warning'; else return;
|
if (error_reporting() & $errno) $error = 'Warning'; else return;
|
||||||
}
|
}
|
||||||
elseif ($errno==E_NOTICE || $errno==E_USER_NOTICE || $errno==E_DEPRECATED || $errno==E_USER_DEPRECATED) {
|
elseif ($errno==E_NOTICE || $errno==E_USER_NOTICE || $errno==E_DEPRECATED || $errno==E_USER_DEPRECATED) {
|
||||||
|
|
@ -200,7 +197,6 @@ function checkReadAccess(?int $listId = null)
|
||||||
$id = $db->sq("SELECT id FROM {$db->prefix}lists WHERE id=? AND published=1", array($listId));
|
$id = $db->sq("SELECT id FROM {$db->prefix}lists WHERE id=? AND published=1", array($listId));
|
||||||
if ($id) return;
|
if ($id) return;
|
||||||
}
|
}
|
||||||
http_response_code(403);
|
|
||||||
jsonExit( array('total'=>0, 'list'=>array(), 'denied'=>1) );
|
jsonExit( array('total'=>0, 'list'=>array(), 'denied'=>1) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
10
src/content/js/jquery-ui.min.js
vendored
10
src/content/js/jquery-ui.min.js
vendored
File diff suppressed because one or more lines are too long
100
src/content/js/jquery.ui.touch-punch.js
vendored
100
src/content/js/jquery.ui.touch-punch.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
/*!
|
/*!
|
||||||
* jQuery UI Touch Punch 1.1.5 as modified by RWAP Software
|
* jQuery UI Touch Punch 1.0.8 as modified by RWAP Software
|
||||||
* based on original touchpunch v0.2.3 which has not been updated since 2014
|
* based on original touchpunch v0.2.3 which has not been updated since 2014
|
||||||
*
|
*
|
||||||
* Updates by RWAP Software to take account of various suggested changes on the original code issues
|
* Updates by RWAP Software to take account of various suggested changes on the original code issues
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
if ( typeof define === "function" && define.amd ) {
|
if ( typeof define === "function" && define.amd ) {
|
||||||
|
|
||||||
// AMD. Register as an anonymous module.
|
// AMD. Register as an anonymous module.
|
||||||
define([ "jquery", "jquery-ui" ], factory );
|
define([ "jquery", "jquery.ui" ], factory );
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Browser globals
|
// Browser globals
|
||||||
|
|
@ -31,8 +31,8 @@
|
||||||
}(function ($) {
|
}(function ($) {
|
||||||
|
|
||||||
// Detect touch support - Windows Surface devices and other touch devices
|
// Detect touch support - Windows Surface devices and other touch devices
|
||||||
$.mspointer = window.navigator.msPointerEnabled;
|
$.support.mspointer = window.navigator.msPointerEnabled;
|
||||||
$.touch = ( 'ontouchstart' in document
|
$.support.touch = ( 'ontouchstart' in document
|
||||||
|| 'ontouchstart' in window
|
|| 'ontouchstart' in window
|
||||||
|| window.TouchEvent
|
|| window.TouchEvent
|
||||||
|| (window.DocumentTouch && document instanceof DocumentTouch)
|
|| (window.DocumentTouch && document instanceof DocumentTouch)
|
||||||
|
|
@ -41,20 +41,21 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
// Ignore browsers without touch or mouse support
|
// Ignore browsers without touch or mouse support
|
||||||
if ((!$.touch && !$.mspointer) || !$.ui.mouse) {
|
if ((!$.support.touch && !$.support.mspointer) || !$.ui.mouse) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mouseProto = $.ui.mouse.prototype,
|
var mouseProto = $.ui.mouse.prototype,
|
||||||
_mouseInit = mouseProto._mouseInit,
|
_mouseInit = mouseProto._mouseInit,
|
||||||
_mouseDestroy = mouseProto._mouseDestroy,
|
_mouseDestroy = mouseProto._mouseDestroy,
|
||||||
touchHandled, lastClickTime = 0;
|
touchHandled;
|
||||||
|
|
||||||
let delay = 300,
|
var delay = 300,
|
||||||
delayTimer,
|
delayTimer,
|
||||||
delayEvent,
|
delayEvent,
|
||||||
delayStarted = false,
|
delayStarted = false,
|
||||||
delayFinished = false,
|
delayFinished = false,
|
||||||
|
lastClickTimeStamp = 0,
|
||||||
lastClickCoord;
|
lastClickCoord;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -81,26 +82,32 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ignore input or textarea elements so user can still enter text
|
|
||||||
if ($(event.target).is("input") || $(event.target).is("textarea")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prevent "Ignored attempt to cancel a touchmove event with cancelable=false" errors
|
// Prevent "Ignored attempt to cancel a touchmove event with cancelable=false" errors
|
||||||
if (event.cancelable) {
|
if (event.cancelable) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
let touch = event.originalEvent.changedTouches[0],
|
var touch = event.originalEvent.changedTouches[0],
|
||||||
simulatedEvent = new MouseEvent(simulatedType, {
|
simulatedEvent = document.createEvent('MouseEvents');
|
||||||
bubbles: true,
|
|
||||||
cancelable: true,
|
// Initialize the simulated mouse event using the touch event's coordinates
|
||||||
view:window,
|
simulatedEvent.initMouseEvent(
|
||||||
screenX:touch.screenX,
|
simulatedType, // type
|
||||||
screenY:touch.screenY,
|
true, // bubbles
|
||||||
clientX:touch.clientX,
|
true, // cancelable
|
||||||
clientY:touch.clientY
|
window, // view
|
||||||
});
|
1, // detail
|
||||||
|
touch.screenX, // screenX
|
||||||
|
touch.screenY, // screenY
|
||||||
|
touch.clientX, // clientX
|
||||||
|
touch.clientY, // clientY
|
||||||
|
false, // ctrlKey
|
||||||
|
false, // altKey
|
||||||
|
false, // shiftKey
|
||||||
|
false, // metaKey
|
||||||
|
0, // button
|
||||||
|
null // relatedTarget
|
||||||
|
);
|
||||||
|
|
||||||
// Dispatch the simulated event to the target element
|
// Dispatch the simulated event to the target element
|
||||||
event.target.dispatchEvent(simulatedEvent);
|
event.target.dispatchEvent(simulatedEvent);
|
||||||
|
|
@ -118,7 +125,7 @@
|
||||||
|
|
||||||
function fireMouseDown () {
|
function fireMouseDown () {
|
||||||
|
|
||||||
const self = this;
|
var self = this;
|
||||||
|
|
||||||
delayFinished = true;
|
delayFinished = true;
|
||||||
|
|
||||||
|
|
@ -145,7 +152,7 @@
|
||||||
*/
|
*/
|
||||||
mouseProto._touchStart = function (event) {
|
mouseProto._touchStart = function (event) {
|
||||||
|
|
||||||
let self = this;
|
var self = this;
|
||||||
|
|
||||||
// Interaction time
|
// Interaction time
|
||||||
this._startedMove = event.timeStamp;
|
this._startedMove = event.timeStamp;
|
||||||
|
|
@ -217,23 +224,22 @@
|
||||||
// If the touch interaction did not move, it should trigger a click
|
// If the touch interaction did not move, it should trigger a click
|
||||||
// Check for this in two ways - length of time of simulation and distance moved
|
// Check for this in two ways - length of time of simulation and distance moved
|
||||||
// Allow for Apple Stylus to be used also
|
// Allow for Apple Stylus to be used also
|
||||||
let timeMoving = event.timeStamp - this._startedMove;
|
var timeMoving = event.timeStamp - this._startedMove;
|
||||||
if (!this._touchMoved || timeMoving < 500) {
|
if (!this._touchMoved || timeMoving < 500) {
|
||||||
|
|
||||||
// Simulate the dblclick event if last click was not far away from the previous one
|
|
||||||
if ( event.timeStamp - lastClickTime < 400 &&
|
|
||||||
Math.abs(lastClickCoord.x - this._startPos.x) < 10 && Math.abs(lastClickCoord.y - this._startPos.y) < 10) {
|
|
||||||
simulateMouseEvent(event, 'dblclick');
|
|
||||||
}
|
|
||||||
// Simulate the click event
|
// Simulate the click event
|
||||||
else
|
|
||||||
simulateMouseEvent(event, 'click');
|
simulateMouseEvent(event, 'click');
|
||||||
|
|
||||||
lastClickTime = event.timeStamp
|
if (lastClickTimeStamp != 0 && event.timeStamp - lastClickTimeStamp < 500 &&
|
||||||
|
Math.abs(lastClickCoord.x - this._startPos.x) < 10 && Math.abs(lastClickCoord.y - this._startPos.y) < 10) {
|
||||||
|
// Simulate the dblclick event
|
||||||
|
simulateMouseEvent(event, 'dblclick');
|
||||||
|
}
|
||||||
|
lastClickTimeStamp = event.timeStamp
|
||||||
lastClickCoord = this._startPos;
|
lastClickCoord = this._startPos;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let endPos = getTouchCoords(event);
|
var endPos = getTouchCoords(event);
|
||||||
if ((Math.abs(endPos.x - this._startPos.x) < 10) && (Math.abs(endPos.y - this._startPos.y) < 10)) {
|
if ((Math.abs(endPos.x - this._startPos.x) < 10) && (Math.abs(endPos.y - this._startPos.y) < 10)) {
|
||||||
// If the touch interaction did not move, it should trigger a click
|
// If the touch interaction did not move, it should trigger a click
|
||||||
if (!this._touchMoved || event.originalEvent.changedTouches[0].touchType === 'stylus') {
|
if (!this._touchMoved || event.originalEvent.changedTouches[0].touchType === 'stylus') {
|
||||||
|
|
@ -250,10 +256,6 @@
|
||||||
touchHandled = false;
|
touchHandled = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
let _touchStartBound;
|
|
||||||
let _touchMoveBound;
|
|
||||||
let _touchEndBound
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
|
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
|
||||||
* This method extends the widget with bound touch event handlers that
|
* This method extends the widget with bound touch event handlers that
|
||||||
|
|
@ -262,22 +264,18 @@
|
||||||
*/
|
*/
|
||||||
mouseProto._mouseInit = function () {
|
mouseProto._mouseInit = function () {
|
||||||
|
|
||||||
let self = this;
|
var self = this;
|
||||||
|
|
||||||
// Microsoft Surface Support = remove original touch Action
|
// Microsoft Surface Support = remove original touch Action
|
||||||
if ($.mspointer) {
|
if ($.support.mspointer) {
|
||||||
self.element[0].style.msTouchAction = 'none';
|
self.element[0].style.msTouchAction = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
_touchStartBound = mouseProto._touchStart.bind(self);
|
|
||||||
_touchMoveBound = mouseProto._touchMove.bind(self);
|
|
||||||
_touchEndBound = mouseProto._touchEnd.bind(self);
|
|
||||||
|
|
||||||
// Delegate the touch handlers to the widget's element
|
// Delegate the touch handlers to the widget's element
|
||||||
self.element.on({
|
self.element.on({
|
||||||
touchstart: _touchStartBound,
|
touchstart: $.proxy(self, '_touchStart'),
|
||||||
touchmove: _touchMoveBound,
|
touchmove: $.proxy(self, '_touchMove'),
|
||||||
touchend: _touchEndBound
|
touchend: $.proxy(self, '_touchEnd')
|
||||||
});
|
});
|
||||||
|
|
||||||
// Call the original $.ui.mouse init method
|
// Call the original $.ui.mouse init method
|
||||||
|
|
@ -289,13 +287,13 @@
|
||||||
*/
|
*/
|
||||||
mouseProto._mouseDestroy = function () {
|
mouseProto._mouseDestroy = function () {
|
||||||
|
|
||||||
let self = this;
|
var self = this;
|
||||||
|
|
||||||
// Delegate the touch handlers to the widget's element
|
// Delegate the touch handlers to the widget's element
|
||||||
self.element.off({
|
self.element.off({
|
||||||
touchstart: _touchStartBound,
|
touchstart: $.proxy(self, '_touchStart'),
|
||||||
touchmove: _touchMoveBound,
|
touchmove: $.proxy(self, '_touchMove'),
|
||||||
touchend: _touchEndBound
|
touchend: $.proxy(self, '_touchEnd')
|
||||||
});
|
});
|
||||||
|
|
||||||
// Call the original $.ui.mouse destroy method
|
// Call the original $.ui.mouse destroy method
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
This file is a part of myTinyTodo.
|
This file is a part of myTinyTodo.
|
||||||
(C) Copyright 2009-2010,2020-2025 Max Pozdeev <maxpozdeev@gmail.com>
|
(C) Copyright 2009-2010,2020-2023 Max Pozdeev <maxpozdeev@gmail.com>
|
||||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
openList: 0,
|
openList: 0,
|
||||||
autotag: false,
|
autotag: false,
|
||||||
instantSearch: true,
|
instantSearch: true,
|
||||||
tagPreview: false,
|
tagPreview: true,
|
||||||
tagPreviewDelay: 700, //milliseconds
|
tagPreviewDelay: 700, //milliseconds
|
||||||
ajaxAnimationDelay: 200,
|
ajaxAnimationDelay: 200,
|
||||||
saveShowNotes: false,
|
saveShowNotes: false,
|
||||||
|
|
@ -78,15 +78,13 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
history: true,
|
history: true,
|
||||||
markdown: true,
|
markdown: true,
|
||||||
viewTaskOnClick: false,
|
viewTaskOnClick: false,
|
||||||
newTaskCounter: false,
|
newTaskCounter: true,
|
||||||
newTaskCounterIcon: false,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
timers: {
|
timers: {
|
||||||
previewtag: 0,
|
previewtag: 0,
|
||||||
ajaxAnimation: 0,
|
ajaxAnimation: 0,
|
||||||
newTaskCounter: 0,
|
newTaskCounter: 0,
|
||||||
searchTags: 0,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
lang: {
|
lang: {
|
||||||
|
|
@ -138,9 +136,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
// procs
|
// procs
|
||||||
setApiDriver: function(driver)
|
setApiDriver: function(driver)
|
||||||
{
|
{
|
||||||
this.db = new driver({
|
this.db = new driver(_mtt);
|
||||||
useREST: false
|
|
||||||
});
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -298,37 +294,14 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
if(flag.tagsChanged) {
|
if(flag.tagsChanged) {
|
||||||
$('#tagcloudcontent').html('');
|
$('#tagcloudcontent').html('');
|
||||||
$('#tagcloudload').show();
|
$('#tagcloudload').show();
|
||||||
loadTags(curList.id, function() {
|
loadTags(curList.id, function(){$('#tagcloudload').hide();});
|
||||||
$('#tagcloudload').hide();
|
|
||||||
document.getElementById('tagcloudSearch').value = '';
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
alignRight: true,
|
alignRight:true
|
||||||
onClose: function(){
|
|
||||||
document.getElementById('tagcloudSearch').value = '';
|
|
||||||
searchTags();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
_mtt.menus.tagcloud.show(this);
|
_mtt.menus.tagcloud.show(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#tagcloudSearch').keyup(function(event) {
|
|
||||||
if (event.keyCode == 27) return;
|
|
||||||
clearTimeout(_mtt.timers.searchTags);
|
|
||||||
_mtt.timers.searchTags = setTimeout(function(){searchTags()}, 400);
|
|
||||||
|
|
||||||
})
|
|
||||||
.keydown(function(event){
|
|
||||||
if (event.keyCode == 27) { // Cancel on Esc
|
|
||||||
if (this.value === '') return; //allow to close the popup
|
|
||||||
this.value = '';
|
|
||||||
clearTimeout(_mtt.timers.searchTags);
|
|
||||||
searchTags();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$('#tagcloudcancel').click(function(){
|
$('#tagcloudcancel').click(function(){
|
||||||
if(_mtt.menus.tagcloud) _mtt.menus.tagcloud.close();
|
if(_mtt.menus.tagcloud) _mtt.menus.tagcloud.close();
|
||||||
});
|
});
|
||||||
|
|
@ -336,8 +309,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
$('#tagcloudcontent').on('click', '.tag', function(event){
|
$('#tagcloudcontent').on('click', '.tag', function(event){
|
||||||
//tag is not escaped
|
//tag is not escaped
|
||||||
addFilterTag( this.dataset.tag, this.dataset.tagId, (event.metaKey || event.ctrlKey ? true : false) );
|
addFilterTag( this.dataset.tag, this.dataset.tagId, (event.metaKey || event.ctrlKey ? true : false) );
|
||||||
if (_mtt.menus.tagcloud)
|
if(_mtt.menus.tagcloud) _mtt.menus.tagcloud.close();
|
||||||
_mtt.menus.tagcloud.close();
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -345,10 +317,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
flag.showTagsFromAllLists = this.checked;
|
flag.showTagsFromAllLists = this.checked;
|
||||||
$('#tagcloudcontent').html('');
|
$('#tagcloudcontent').html('');
|
||||||
$('#tagcloudload').show();
|
$('#tagcloudload').show();
|
||||||
loadTags(curList.id, function(){
|
loadTags(curList.id, function(){$('#tagcloudload').hide();});
|
||||||
$('#tagcloudload').hide();
|
|
||||||
$('#tagcloudSearch').val('');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#mtt-notes-show').click(function(e){
|
$('#mtt-notes-show').click(function(e){
|
||||||
|
|
@ -443,8 +412,6 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
dayNames:_mtt.lang.daysLong,
|
dayNames:_mtt.lang.daysLong,
|
||||||
monthNamesShort:_mtt.lang.monthsShort,
|
monthNamesShort:_mtt.lang.monthsShort,
|
||||||
monthNames:_mtt.lang.monthsLong,
|
monthNames:_mtt.lang.monthsLong,
|
||||||
changeMonth: true,
|
|
||||||
changeYear: true,
|
|
||||||
isRTL: _mtt.lang.isRTL()
|
isRTL: _mtt.lang.isRTL()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -752,12 +719,8 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counter
|
// Counter
|
||||||
if (this.options.newTaskCounter /* TODO: && !flag.readOnly */) {
|
if (this.options.newTaskCounter) {
|
||||||
this.addAction('listsLoaded', newTaskCounterStart);
|
this.addAction('listsLoaded', newTaskCounterStart);
|
||||||
this.addAction('listSelected', newTaskCounterOnListSelected)
|
|
||||||
if (this.options.newTaskCounterIcon) {
|
|
||||||
this.addAction('newTaskCounterUpdated', newTaskCounterUpdated);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.doAction( 'init' );
|
this.doAction( 'init' );
|
||||||
|
|
@ -902,19 +865,16 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
|
|
||||||
duedatepickerformat: function()
|
duedatepickerformat: function()
|
||||||
{
|
{
|
||||||
if (!this.options.duedatepickerformat)
|
if(!this.options.duedatepickerformat) return 'yy-mm-dd';
|
||||||
return 'yy-mm-dd';
|
|
||||||
|
|
||||||
const s = this.options.duedatepickerformat.replace(/(.)/g, function(t,s) {
|
var s = this.options.duedatepickerformat.replace(/(.)/g, function(t,s) {
|
||||||
switch(t) {
|
switch(t) {
|
||||||
case 'Y': return 'yy';
|
case 'Y': return 'yy';
|
||||||
case 'y': return 'yy';
|
case 'y': return 'yy';
|
||||||
case 'd': return 'dd';
|
case 'd': return 'dd';
|
||||||
case 'j': return 'd';
|
case 'j': return 'd';
|
||||||
case 'm': return 'mm';
|
case 'm': return 'mm';
|
||||||
case 'M': return 'M';
|
|
||||||
case 'n': return 'm';
|
case 'n': return 'm';
|
||||||
case ' ':
|
|
||||||
case '/':
|
case '/':
|
||||||
case '.':
|
case '.':
|
||||||
case '-': return t;
|
case '-': return t;
|
||||||
|
|
@ -922,8 +882,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (s == '')
|
if(s == '') return 'yy-mm-dd';
|
||||||
return 'yy-mm-dd';
|
|
||||||
return s;
|
return s;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -980,38 +939,25 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
|
|
||||||
filter: {
|
filter: {
|
||||||
_filters: [],
|
_filters: [],
|
||||||
|
clear: function() {
|
||||||
clear() {
|
|
||||||
this._filters = [];
|
this._filters = [];
|
||||||
$('#mtt-tag-toolbar').hide();
|
$('#mtt-tag-toolbar').hide();
|
||||||
$('#mtt-tag-filters').html('');
|
$('#mtt-tag-filters').html('');
|
||||||
},
|
},
|
||||||
|
addTag: function(tagId, tag, exclude)
|
||||||
addTag(tagId, tag, exclude)
|
|
||||||
{
|
{
|
||||||
//Catch 'any tag' filter
|
tagId += 0;
|
||||||
if (tagId == -2) {
|
for (let i in this._filters) {
|
||||||
tagId = -1;
|
if (this._filters[i].tagId && this._filters[i].tagId == tagId)
|
||||||
tag = '^';
|
|
||||||
exclude = true
|
|
||||||
}
|
|
||||||
for (const filter of this._filters) {
|
|
||||||
if (filter.tagId && filter.tagId == tagId)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
this._filters.push({tagId:tagId, tag:tag, exclude:exclude});
|
this._filters.push({tagId:tagId, tag:tag, exclude:exclude});
|
||||||
if (tagId == -1) {
|
|
||||||
// for display purposes only
|
|
||||||
tag = exclude ? _mtt.lang.get('withAnyTag') : _mtt.lang.get('withoutTags');
|
|
||||||
exclude = false;
|
|
||||||
}
|
|
||||||
const tagHtml = this.prepareTagHtml(tagId, tag, ['tag-filter', 'tag-id-'+tagId, exclude ? 'tag-filter-exclude' : '']) ;
|
const tagHtml = this.prepareTagHtml(tagId, tag, ['tag-filter', 'tag-id-'+tagId, exclude ? 'tag-filter-exclude' : '']) ;
|
||||||
$('#mtt-tag-filters').append(tagHtml);
|
$('#mtt-tag-filters').append(tagHtml);
|
||||||
$('#mtt-tag-toolbar').show();
|
$('#mtt-tag-toolbar').show();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
cancelTag: function(tagId)
|
||||||
cancelTag(tagId)
|
|
||||||
{
|
{
|
||||||
for (let i in this._filters) {
|
for (let i in this._filters) {
|
||||||
if (this._filters[i].tagId && this._filters[i].tagId == tagId) {
|
if (this._filters[i].tagId && this._filters[i].tagId == tagId) {
|
||||||
|
|
@ -1025,25 +971,23 @@ var mytinytodo = window.mytinytodo = _mtt = {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
getTags: function(withExcluded)
|
||||||
getTags(withExcluded)
|
|
||||||
{
|
{
|
||||||
let a = [];
|
let a = [];
|
||||||
for (const filter of this._filters) {
|
for (let i in this._filters) {
|
||||||
if (filter.tagId) {
|
if (this._filters[i].tagId) {
|
||||||
if (filter.exclude && withExcluded)
|
if (this._filters[i].exclude && withExcluded)
|
||||||
a.push('^'+ filter.tag);
|
a.push('^'+ this._filters[i].tag);
|
||||||
else if (!filter.exclude)
|
else if (!this._filters[i].exclude)
|
||||||
a.push(filter.tag)
|
a.push(this._filters[i].tag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return a.join(', ');
|
return a.join(', ');
|
||||||
},
|
},
|
||||||
|
prepareTagHtml: function(tagId, tag, classes)
|
||||||
prepareTagHtml(tagId, tag, classes)
|
|
||||||
{
|
{
|
||||||
// tag is not escaped
|
// tag is not escaped
|
||||||
return `<span class="${classes.join(' ')} mtt-filter-close" tagid="${tagId}">${escapeHtml(tag)}<span class="tag-filter-btn"></span></span>`;
|
return '<span class="' + classes.join(' ') + ' mtt-filter-close" tagid="' + tagId + '">' + escapeHtml(tag) + '<span class="tag-filter-btn"></span></span>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1233,8 +1177,7 @@ function loadTasks(opts)
|
||||||
changeTaskCnt(item, 1);
|
changeTaskCnt(item, 1);
|
||||||
});
|
});
|
||||||
curList.lastTime = json.time;
|
curList.lastTime = json.time;
|
||||||
setNewTaskCounterForList(curList.id, 0);
|
$('#list_'+curList.id).find('.counter').text('').addClass('hidden');
|
||||||
_mtt.doAction("newTaskCounterUpdated", curList.id);
|
|
||||||
if(opts.beforeShow && opts.beforeShow.call) {
|
if(opts.beforeShow && opts.beforeShow.call) {
|
||||||
opts.beforeShow();
|
opts.beforeShow();
|
||||||
}
|
}
|
||||||
|
|
@ -1281,9 +1224,9 @@ function prepareTaskBlocks(item)
|
||||||
'<div class="task-through">' +
|
'<div class="task-through">' +
|
||||||
preparePrio(item.prio,id) +
|
preparePrio(item.prio,id) +
|
||||||
'<span class="task-title">' + prepareTaskTitleInlineHtml(item.title) + '</span> ' +
|
'<span class="task-title">' + prepareTaskTitleInlineHtml(item.title) + '</span> ' +
|
||||||
(curList.id == -1 ? prepareListNameInline(item) : '') +
|
(curList.id == -1 ? '<span class="task-listname">'+ tabLists.get(item.listId).name +'</span>' : '') +
|
||||||
'<span class="task-tags">' + prepareTagsStr(item) + '</span>' +
|
'<span class="task-tags">' + prepareTagsStr(item) + '</span>' +
|
||||||
'<div class="task-date">' + prepareInlineDate(item) + '</div>' +
|
'<span class="task-date">' + prepareInlineDate(item) + '</span>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="task-through-right">' + prepareDueDate(item) + "</div>" +
|
'<div class="task-through-right">' + prepareDueDate(item) + "</div>" +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
|
@ -1304,22 +1247,14 @@ _mtt.prepareTaskBlocks = prepareTaskBlocks;
|
||||||
|
|
||||||
function prepareTaskTitleInlineHtml(s)
|
function prepareTaskTitleInlineHtml(s)
|
||||||
{
|
{
|
||||||
// Task title is already escaped on back-end
|
// Task title is already escaped on php back-end
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
_mtt.prepareTaskTitleInlineHtml = prepareTaskTitleInlineHtml;
|
_mtt.prepareTaskTitleInlineHtml = prepareTaskTitleInlineHtml;
|
||||||
|
|
||||||
function prepareListNameInline(item)
|
|
||||||
{
|
|
||||||
// Used in AllTasks list
|
|
||||||
// List name is already escaped on back-end
|
|
||||||
return '<span class="task-listname">'+ item.listName +'</span>';
|
|
||||||
}
|
|
||||||
_mtt.prepareListNameInline = prepareListNameInline;
|
|
||||||
|
|
||||||
function prepareTaskNoteInlineHtml(s, rawText)
|
function prepareTaskNoteInlineHtml(s, rawText)
|
||||||
{
|
{
|
||||||
// Task note is already escaped on back-end
|
// Task note is already escaped on php back-end
|
||||||
return s;
|
return s;
|
||||||
};
|
};
|
||||||
_mtt.prepareTaskNoteInlineHtml = prepareTaskNoteInlineHtml;
|
_mtt.prepareTaskNoteInlineHtml = prepareTaskNoteInlineHtml;
|
||||||
|
|
@ -1424,9 +1359,9 @@ function changeTaskOrder(id)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// sortByHand
|
// sortByHand
|
||||||
if (curList.sort == 0 || curList.sort == 100) {
|
if (curList.sort == 0) {
|
||||||
taskOrder.sort( (a, b) => firstNonZero(
|
taskOrder.sort( (a, b) => firstNonZero(
|
||||||
curList.sort,
|
0,
|
||||||
taskList[a].compl - taskList[b].compl,
|
taskList[a].compl - taskList[b].compl,
|
||||||
taskList[a].ow - taskList[b].ow
|
taskList[a].ow - taskList[b].ow
|
||||||
))
|
))
|
||||||
|
|
@ -1533,13 +1468,13 @@ function setTaskPrio(id, prio)
|
||||||
taskList[id].prio = prio;
|
taskList[id].prio = prio;
|
||||||
var $t = $('#taskrow_'+id);
|
var $t = $('#taskrow_'+id);
|
||||||
$t.find('.task-prio').replaceWith(preparePrio(prio, id));
|
$t.find('.task-prio').replaceWith(preparePrio(prio, id));
|
||||||
if (curList.sort != 0 && curList.sort != 100) changeTaskOrder(id);
|
if(curList.sort != 0) changeTaskOrder(id);
|
||||||
$t.effect("highlight", {color:_mtt.theme.editTaskFlashColor}, 'normal');
|
$t.effect("highlight", {color:_mtt.theme.editTaskFlashColor}, 'normal');
|
||||||
};
|
};
|
||||||
|
|
||||||
function setSort(v, init)
|
function setSort(v, init)
|
||||||
{
|
{
|
||||||
if (v < 0 || (v > 5 && v < 100) || v > 105) {
|
if (v < 0 || (v > 5 && v < 101) || v > 105) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
curList.sort = v;
|
curList.sort = v;
|
||||||
|
|
@ -1550,7 +1485,7 @@ function setSort(v, init)
|
||||||
function updateSortUI(v)
|
function updateSortUI(v)
|
||||||
{
|
{
|
||||||
$('#listmenucontainer .sort-item').removeClass('mtt-item-checked').children('.mtt-sort-direction').text('');
|
$('#listmenucontainer .sort-item').removeClass('mtt-item-checked').children('.mtt-sort-direction').text('');
|
||||||
if (v == 0 || v == 100) $('#sortByHand').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==0 ? '↓' : '↑');
|
if (v == 0) $('#sortByHand').addClass('mtt-item-checked');
|
||||||
else if(v==1 || v==101) $('#sortByPrio').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==1 ? '↑' : '↓');
|
else if(v==1 || v==101) $('#sortByPrio').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==1 ? '↑' : '↓');
|
||||||
else if(v==2 || v==102) $('#sortByDueDate').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==2 ? '↑' : '↓');
|
else if(v==2 || v==102) $('#sortByDueDate').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==2 ? '↑' : '↓');
|
||||||
else if(v==3 || v==103) $('#sortByDateCreated').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==3 ? '↓' : '↑');
|
else if(v==3 || v==103) $('#sortByDateCreated').addClass('mtt-item-checked').children('.mtt-sort-direction').text(v==3 ? '↓' : '↑');
|
||||||
|
|
@ -1559,7 +1494,7 @@ function updateSortUI(v)
|
||||||
else return;
|
else return;
|
||||||
|
|
||||||
curList.sort = v;
|
curList.sort = v;
|
||||||
if ( (v == 0 || v == 100) && !flag.readOnly) $("#tasklist").sortable('enable');
|
if (v == 0 && !flag.readOnly) $("#tasklist").sortable('enable');
|
||||||
else $("#tasklist").sortable('disable');
|
else $("#tasklist").sortable('disable');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1676,12 +1611,9 @@ function tabSelect(elementOrId)
|
||||||
if (id == -1) $('#mtt').addClass('show-all-tasks');
|
if (id == -1) $('#mtt').addClass('show-all-tasks');
|
||||||
else $('#mtt').removeClass('show-all-tasks');
|
else $('#mtt').removeClass('show-all-tasks');
|
||||||
if (filter.search != '') liveSearchToggle(0, 1);
|
if (filter.search != '') liveSearchToggle(0, 1);
|
||||||
mytinytodo.doAction('listSelected', {
|
mytinytodo.doAction('listSelected', tabLists.get(id));
|
||||||
'list': curList,
|
|
||||||
'prevList':prevList
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const newTitle = dehtml(curList.name) + ' - ' + _mtt.options.title;
|
const newTitle = curList.name + ' - ' + _mtt.options.title;
|
||||||
const isFirstLoad = flag.firstLoad;
|
const isFirstLoad = flag.firstLoad;
|
||||||
//replaceHistoryState( 'list', { list:id }, _mtt.urlForList(curList), newTitle );
|
//replaceHistoryState( 'list', { list:id }, _mtt.urlForList(curList), newTitle );
|
||||||
updateHistoryState( { list:id }, _mtt.urlForList(curList), newTitle );
|
updateHistoryState( { list:id }, _mtt.urlForList(curList), newTitle );
|
||||||
|
|
@ -1732,7 +1664,7 @@ function listMenuClick(el, menu)
|
||||||
case 'btnRssFeed': return true;
|
case 'btnRssFeed': return true;
|
||||||
case 'btnShowCompleted': showCompletedToggle(); break;
|
case 'btnShowCompleted': showCompletedToggle(); break;
|
||||||
case 'btnClearCompleted': clearCompleted(); break;
|
case 'btnClearCompleted': clearCompleted(); break;
|
||||||
case 'sortByHand': setSort(curList.sort==0 ? 100 : 0); break;
|
case 'sortByHand': setSort(0); break;
|
||||||
case 'sortByPrio': setSort(curList.sort==1 ? 101 : 1); break;
|
case 'sortByPrio': setSort(curList.sort==1 ? 101 : 1); break;
|
||||||
case 'sortByDueDate': setSort(curList.sort==2 ? 102 : 2); break;
|
case 'sortByDueDate': setSort(curList.sort==2 ? 102 : 2); break;
|
||||||
case 'sortByDateCreated': setSort(curList.sort==3 ? 103 : 3); break;
|
case 'sortByDateCreated': setSort(curList.sort==3 ? 103 : 3); break;
|
||||||
|
|
@ -1849,7 +1781,7 @@ function fillTaskViewer(id)
|
||||||
$('#page_taskviewer .prio .content').html(preparePrio(item.prio,item.id));
|
$('#page_taskviewer .prio .content').html(preparePrio(item.prio,item.id));
|
||||||
$('#page_taskviewer .due .content').html(item.duedate);
|
$('#page_taskviewer .due .content').html(item.duedate);
|
||||||
$('#page_taskviewer .tags .content').html(prepareTagsStr(item, ''));
|
$('#page_taskviewer .tags .content').html(prepareTagsStr(item, ''));
|
||||||
$('#page_taskviewer .list .content').text(curList.id == -1 ? item.listName : curList.name);
|
$('#page_taskviewer .list .content').text(curList.name);
|
||||||
if (item.note == '') {
|
if (item.note == '') {
|
||||||
$('#page_taskviewer').addClass('no-note');
|
$('#page_taskviewer').addClass('no-note');
|
||||||
}
|
}
|
||||||
|
|
@ -1864,7 +1796,7 @@ function viewTask(id)
|
||||||
const item = fillTaskViewer(id);
|
const item = fillTaskViewer(id);
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
_mtt.pageSet('taskviewer');
|
_mtt.pageSet('taskviewer');
|
||||||
updateHistoryState({ task: item.id, list: item.listId }, '#task/'+item.id, dehtml(item.title) + ' - ' + dehtml(curList.name) + ' - ' + _mtt.options.title);
|
updateHistoryState({ task: item.id, list: item.listId }, '#task/'+item.id, dehtml(item.title) + ' - ' + curList.name + ' - ' + _mtt.options.title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1967,9 +1899,8 @@ function saveTask(form)
|
||||||
taskList[item.id] = item;
|
taskList[item.id] = item;
|
||||||
const noteExpanded = (item.note != '' && $('#taskrow_'+item.id).is('.task-expanded')) ? 1 : 0;
|
const noteExpanded = (item.note != '' && $('#taskrow_'+item.id).is('.task-expanded')) ? 1 : 0;
|
||||||
$('#taskrow_'+item.id).replaceWith(_mtt.prepareTaskStr(item, noteExpanded));
|
$('#taskrow_'+item.id).replaceWith(_mtt.prepareTaskStr(item, noteExpanded));
|
||||||
if (curList.sort != 0 && curList.sort != 100) {
|
if (curList.sort != 0)
|
||||||
changeTaskOrder(item.id);
|
changeTaskOrder(item.id);
|
||||||
}
|
|
||||||
refreshTaskCnt();
|
refreshTaskCnt();
|
||||||
_mtt.pageBack(); //back to list or viewer
|
_mtt.pageBack(); //back to list or viewer
|
||||||
if (_mtt.pages.current.page == 'taskviewer') {
|
if (_mtt.pages.current.page == 'taskviewer') {
|
||||||
|
|
@ -2032,28 +1963,19 @@ function loadTags(listId, callback)
|
||||||
_mtt.db.request('tagCloud', {list:listId}, function(json){
|
_mtt.db.request('tagCloud', {list:listId}, function(json){
|
||||||
if (!parseInt(json.total)) tagsList = [];
|
if (!parseInt(json.total)) tagsList = [];
|
||||||
else tagsList = json.items;
|
else tagsList = json.items;
|
||||||
flag.tagsChanged = false;
|
|
||||||
setTagcloudContent(tagsList);
|
|
||||||
callback();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function setTagcloudContent(tags, isFiltered = false)
|
|
||||||
{
|
|
||||||
let cloud = '';
|
let cloud = '';
|
||||||
tags.forEach( item => {
|
tagsList.forEach( item => {
|
||||||
// item.tag is escaped with htmlspecialchars()
|
// item.tag is escaped with htmlspecialchars()
|
||||||
cloud += ` <span class="tag" data-tag="${item.tag}" data-tag-id="${item.id}">${item.tag}</span>`;
|
cloud += ' <span class="tag" data-tag="' + item.tag + '" data-tag-id="' + item.id + '">' + item.tag + '</span>';
|
||||||
});
|
});
|
||||||
if (cloud == '') {
|
if (cloud == '') {
|
||||||
cloud = _mtt.lang.get('noTags');
|
cloud = _mtt.lang.get('noTags');
|
||||||
}
|
}
|
||||||
else if (!isFiltered) {
|
|
||||||
cloud = `<span class="tag special-no-tags" data-tag="^" data-tag-id="-1">${_mtt.lang.get('withoutTags')}</span>` +
|
|
||||||
`<span class="tag special-any-tag" data-tag="^^" data-tag-id="-2">${_mtt.lang.get('withAnyTag')}</span>` + cloud;
|
|
||||||
}
|
|
||||||
$('#tagcloudcontent').html(cloud)
|
$('#tagcloudcontent').html(cloud)
|
||||||
}
|
flag.tagsChanged = false;
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function cancelTagFilter(tagId, dontLoadTasks)
|
function cancelTagFilter(tagId, dontLoadTasks)
|
||||||
{
|
{
|
||||||
|
|
@ -2064,27 +1986,10 @@ function cancelTagFilter(tagId, dontLoadTasks)
|
||||||
|
|
||||||
function addFilterTag(tag, tagId, exclude)
|
function addFilterTag(tag, tagId, exclude)
|
||||||
{
|
{
|
||||||
if (!_mtt.filter.addTag(tagId, tag, exclude))
|
if(!_mtt.filter.addTag(tagId, tag, exclude)) return false;
|
||||||
return false;
|
|
||||||
loadTasks();
|
loadTasks();
|
||||||
};
|
};
|
||||||
|
|
||||||
function searchTags()
|
|
||||||
{
|
|
||||||
const filter = document.getElementById('tagcloudSearch').value.toLocaleLowerCase();
|
|
||||||
if (filter === '') {
|
|
||||||
setTagcloudContent(tagsList);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const filtered = [];
|
|
||||||
tagsList.forEach( item => {
|
|
||||||
if (item.tagText.toLocaleLowerCase().search(filter) === -1)
|
|
||||||
return;
|
|
||||||
filtered.push(item);
|
|
||||||
});
|
|
||||||
setTagcloudContent(filtered, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function liveSearchToggle(toSearch, dontLoad)
|
function liveSearchToggle(toSearch, dontLoad)
|
||||||
{
|
{
|
||||||
if(toSearch)
|
if(toSearch)
|
||||||
|
|
@ -2141,7 +2046,6 @@ function submitFullTask(form)
|
||||||
var item = json.list[0];
|
var item = json.list[0];
|
||||||
taskList[item.id] = item;
|
taskList[item.id] = item;
|
||||||
taskOrder.push(parseInt(item.id));
|
taskOrder.push(parseInt(item.id));
|
||||||
curList.lastTaskCreatedTime = item.dateInt;
|
|
||||||
$('#tasklist').append(_mtt.prepareTaskStr(item));
|
$('#tasklist').append(_mtt.prepareTaskStr(item));
|
||||||
changeTaskOrder(item.id);
|
changeTaskOrder(item.id);
|
||||||
_mtt.pageBack();
|
_mtt.pageBack();
|
||||||
|
|
@ -2164,50 +2068,39 @@ function tasklistSortStart(event, ui)
|
||||||
|
|
||||||
function tasklistSortUpdated(event, ui)
|
function tasklistSortUpdated(event, ui)
|
||||||
{
|
{
|
||||||
if (!ui.item[0]) {
|
if(!ui.item[0]) return;
|
||||||
return;
|
var itemId = ui.item[0].id;
|
||||||
}
|
var n = $(this).sortable('toArray');
|
||||||
const itemId = ui.item[0].id;
|
|
||||||
const n = $(this).sortable('toArray');
|
|
||||||
|
|
||||||
// remove possible empty id's
|
// remove possible empty id's
|
||||||
for (let i = 0; i < sortOrder.length; i++) {
|
for(var i=0; i<sortOrder.length; i++) {
|
||||||
if (sortOrder[i] == '') {
|
if(sortOrder[i] == '') { sortOrder.splice(i,1); i--; }
|
||||||
sortOrder.splice(i,1); i--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (n.toString() == sortOrder.toString()) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
if(n.toString() == sortOrder.toString()) return;
|
||||||
|
|
||||||
// make index: id=>position
|
// make index: id=>position
|
||||||
const posBefore = {};
|
var h0 = {}; //before
|
||||||
for (let j = 0; j < sortOrder.length; j++) {
|
for(var j=0; j<sortOrder.length; j++) {
|
||||||
posBefore[sortOrder[j]] = j;
|
h0[sortOrder[j]] = j;
|
||||||
}
|
}
|
||||||
const posAfter = {};
|
var h1 = {}; //after
|
||||||
for (let j = 0; j < n.length; j++) {
|
for(var j=0; j<n.length; j++) {
|
||||||
posAfter[n[j]] = j;
|
h1[n[j]] = j;
|
||||||
taskOrder[j] = parseInt(n[j].split('_')[1]);
|
taskOrder[j] = parseInt(n[j].split('_')[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare params
|
// prepare param
|
||||||
const o = [];
|
var o = [];
|
||||||
const newWeight = taskList[sortOrder[posAfter[itemId]].split('_')[1]].ow;
|
var diff;
|
||||||
let diff;
|
var replaceOW = taskList[sortOrder[h1[itemId]].split('_')[1]].ow;
|
||||||
for (const j in posBefore)
|
for(var j in h0)
|
||||||
{
|
{
|
||||||
diff = posAfter[j] - posBefore[j]; // depends on position
|
diff = h1[j] - h0[j];
|
||||||
if (curList.sort == 100) {
|
|
||||||
diff *= -1;
|
|
||||||
}
|
|
||||||
if(diff != 0) {
|
if(diff != 0) {
|
||||||
const taskId = j.split('_')[1];
|
var a = j.split('_');
|
||||||
if (j == itemId) {
|
if(j == itemId) diff = replaceOW - taskList[a[1]].ow;
|
||||||
diff = newWeight - taskList[taskId].ow; // just for new weight
|
o.push({id:a[1], diff:diff});
|
||||||
}
|
taskList[a[1]].ow += diff;
|
||||||
o.push({id:taskId, diff:diff});
|
|
||||||
taskList[taskId].ow += diff;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2510,9 +2403,7 @@ function moveTaskToList(taskId, listId)
|
||||||
taskList[item.id] = item;
|
taskList[item.id] = item;
|
||||||
var noteExpanded = (item.note != '' && $('#taskrow_'+item.id).is('.task-expanded')) ? 1 : 0;
|
var noteExpanded = (item.note != '' && $('#taskrow_'+item.id).is('.task-expanded')) ? 1 : 0;
|
||||||
$('#taskrow_'+item.id).replaceWith(_mtt.prepareTaskStr(item, noteExpanded));
|
$('#taskrow_'+item.id).replaceWith(_mtt.prepareTaskStr(item, noteExpanded));
|
||||||
if (curList.sort != 0 && curList.sort != 100) {
|
if(curList.sort != 0) changeTaskOrder(item.id);
|
||||||
changeTaskOrder(item.id);
|
|
||||||
}
|
|
||||||
refreshTaskCnt();
|
refreshTaskCnt();
|
||||||
$('#taskrow_'+item.id).effect("highlight", {color:_mtt.theme.editTaskFlashColor}, 'normal', function(){$(this).css('display','')});
|
$('#taskrow_'+item.id).effect("highlight", {color:_mtt.theme.editTaskFlashColor}, 'normal', function(){$(this).css('display','')});
|
||||||
}
|
}
|
||||||
|
|
@ -2554,9 +2445,8 @@ function cmenuOnListRenamed(list)
|
||||||
$('#cmenu_list\\:'+list.id).text(list.name);
|
$('#cmenu_list\\:'+list.id).text(list.name);
|
||||||
};
|
};
|
||||||
|
|
||||||
function cmenuOnListSelected(a)
|
function cmenuOnListSelected(list)
|
||||||
{
|
{
|
||||||
const list = a.list;
|
|
||||||
$('#cmenulistscontainer li').removeClass('mtt-item-disabled');
|
$('#cmenulistscontainer li').removeClass('mtt-item-disabled');
|
||||||
$('#cmenu_list\\:'+list.id).addClass('mtt-item-disabled').removeClass('mtt-list-hidden');
|
$('#cmenu_list\\:'+list.id).addClass('mtt-item-disabled').removeClass('mtt-list-hidden');
|
||||||
};
|
};
|
||||||
|
|
@ -2574,9 +2464,8 @@ function cmenuOnListHidden(list)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function tabmenuOnListSelected(a)
|
function tabmenuOnListSelected(list)
|
||||||
{
|
{
|
||||||
const list = a.list;
|
|
||||||
if (list.published) {
|
if (list.published) {
|
||||||
$('#btnPublish').addClass('mtt-item-checked');
|
$('#btnPublish').addClass('mtt-item-checked');
|
||||||
$('#btnRssFeed').removeClass('mtt-item-disabled');
|
$('#btnRssFeed').removeClass('mtt-item-disabled');
|
||||||
|
|
@ -2691,13 +2580,11 @@ function slmenuOnListsLoaded()
|
||||||
_mtt.menus.selectlist = null;
|
_mtt.menus.selectlist = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let s = '';
|
var s = '';
|
||||||
tabLists.getAll().forEach( (list) => {
|
var all = tabLists.getAll();
|
||||||
const classChecked = (list.id == curList.id) ? 'mtt-item-checked' : '';
|
for(var i in all) {
|
||||||
const classHidden = list.hidden ? 'mtt-list-hidden' : '';
|
s += '<li id="slmenu_list:'+all[i].id+'" class="'+(all[i].id==curList.id?'mtt-item-checked':'')+' list-id-'+all[i].id+(all[i].hidden?' mtt-list-hidden':'')+'"><div class="menu-icon"></div><a href="'+ _mtt.urlForList(all[i])+ '">'+all[i].name+'</a></li>';
|
||||||
s += `<li id="slmenu_list:${list.id}" class="list-id-${list.id} ${classChecked} ${classHidden}">
|
}
|
||||||
<div class="menu-icon"></div><a href="${_mtt.urlForList(list)}">${list.name}</a><div class="counter hidden"></div></li>`;
|
|
||||||
})
|
|
||||||
$('#slmenucontainer ul>.slmenu-lists-begin').nextAll().remove();
|
$('#slmenucontainer ul>.slmenu-lists-begin').nextAll().remove();
|
||||||
$('#slmenucontainer ul>.slmenu-lists-begin').after(s);
|
$('#slmenucontainer ul>.slmenu-lists-begin').after(s);
|
||||||
};
|
};
|
||||||
|
|
@ -2713,13 +2600,11 @@ function slmenuOnListAdded(list)
|
||||||
_mtt.menus.selectlist.destroy();
|
_mtt.menus.selectlist.destroy();
|
||||||
_mtt.menus.selectlist = null;
|
_mtt.menus.selectlist = null;
|
||||||
}
|
}
|
||||||
$('#slmenucontainer ul').append(`<li id="slmenu_list:${list.id}" class="list-id-${list.id}">
|
$('#slmenucontainer ul').append('<li id="slmenu_list:'+list.id+'" class="list-id-'+list.id+'"><div class="menu-icon"></div><a href="'+ _mtt.urlForList(list)+ '">'+list.name+'</a></li>');
|
||||||
<div class="menu-icon"></div><a href="${_mtt.urlForList(list)}">${list.name}</a><div class="counter hidden"></div></li>`);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function slmenuOnListSelected(a)
|
function slmenuOnListSelected(list)
|
||||||
{
|
{
|
||||||
const list = a.list;
|
|
||||||
$('#slmenucontainer li').removeClass('mtt-item-checked');
|
$('#slmenucontainer li').removeClass('mtt-item-checked');
|
||||||
$('#slmenucontainer li.list-id-'+list.id).addClass('mtt-item-checked').removeClass('mtt-list-hidden');
|
$('#slmenucontainer li.list-id-'+list.id).addClass('mtt-item-checked').removeClass('mtt-list-hidden');
|
||||||
|
|
||||||
|
|
@ -2833,132 +2718,35 @@ function newTaskCounter()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
_mtt.db.request("newTaskCounter", params, json => {
|
fetch(_mtt.apiUrl + 'tasks/newCounter', {
|
||||||
if (json && json.ok) {
|
method: 'POST',
|
||||||
let counters = {};
|
headers: {
|
||||||
let curCounter = 0;
|
'Content-Type': 'application/json',
|
||||||
|
'MTT-Token': _mtt.options.token,
|
||||||
|
},
|
||||||
|
body: JSON.stringify(params)
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(json => {
|
||||||
|
if (json && json.total) {
|
||||||
if (Array.isArray(json.tasks)) {
|
if (Array.isArray(json.tasks)) {
|
||||||
|
let curCounter = 0;
|
||||||
json.tasks.forEach((id) => {
|
json.tasks.forEach((id) => {
|
||||||
if (!taskList[id]) {
|
if (!taskList[id]) {
|
||||||
curCounter++;
|
curCounter++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (curCounter > 0) {
|
||||||
|
$('#list_'+curList.id).find('.counter').text(curCounter).removeClass('hidden');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
counters[curList.id] = curCounter;
|
|
||||||
|
|
||||||
if (Array.isArray(json.lists)) {
|
if (Array.isArray(json.lists)) {
|
||||||
json.lists.forEach((item) => {
|
json.lists.forEach((item) => {
|
||||||
counters["" + item.listId] = +item.counter;
|
$('#list_'+item.listId).find('.counter').text(item.counter).removeClass('hidden');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
tabLists.getAll().forEach( (list) => {
|
|
||||||
if (!list.hidden || list.id != -1) {
|
|
||||||
setNewTaskCounterForList(list.id, counters[list.id]);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_mtt.doAction("newTaskCounterUpdated");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNewTaskCounterForList(listId, counter)
|
|
||||||
{
|
|
||||||
const list = tabLists.get(listId);
|
|
||||||
if (!list) return;
|
|
||||||
if (list.newTaskCounterOld) {
|
|
||||||
counter += list.newTaskCounterOld;
|
|
||||||
}
|
|
||||||
if (counter > 0) {
|
|
||||||
$('#list_' + listId).find('.counter').text(counter).removeClass('hidden');
|
|
||||||
$('#slmenucontainer li.list-id-' + listId).find('.counter').text(counter).removeClass('hidden');
|
|
||||||
list.newTaskCounter = counter;
|
|
||||||
} else {
|
|
||||||
$('#list_' + listId).find('.counter').text('').addClass('hidden');
|
|
||||||
$('#slmenucontainer li.list-id-' + listId).find('.counter').text('').addClass('hidden');
|
|
||||||
list.newTaskCounter = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function newTaskCounterOnListSelected(a)
|
|
||||||
{
|
|
||||||
if (a.prevList && a.prevList.newTaskCounter) {
|
|
||||||
a.prevList.newTaskCounterOld = a.prevList.newTaskCounter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set favicon with number of new tasks
|
|
||||||
*/
|
|
||||||
function newTaskCounterUpdated()
|
|
||||||
{
|
|
||||||
// Calc a total number of new tasks in visible tabs
|
|
||||||
let total = 0;
|
|
||||||
tabLists.getAll().forEach( (list) => {
|
|
||||||
if (list.newTaskCounter && (!list.hidden || list.id != -1)) {
|
|
||||||
total += list.newTaskCounter;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Restore original icon
|
|
||||||
if (total <= 0) {
|
|
||||||
const o = document.querySelectorAll('link[rel="icon"]');
|
|
||||||
let oType, oHref;
|
|
||||||
for (let i = 0; i < o.length; i++) {
|
|
||||||
if (o[i].dataset.ohref) {
|
|
||||||
oHref = o[i].dataset.ohref;
|
|
||||||
oType = o[i].dataset.otype;
|
|
||||||
o[i].parentNode.removeChild(o[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (oHref) {
|
|
||||||
const n = document.createElement('link');
|
|
||||||
n.setAttribute('rel', 'icon');
|
|
||||||
n.setAttribute('href', oHref);
|
|
||||||
n.setAttribute('type', oType);
|
|
||||||
document.querySelector('head').appendChild(n);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw new icon
|
|
||||||
const c = document.createElement('canvas');
|
|
||||||
c.height = c.width = 64;
|
|
||||||
const ctx = c.getContext('2d');
|
|
||||||
//filled circle in center
|
|
||||||
ctx.lineWidth = 4;
|
|
||||||
ctx.fillStyle = '#ff0000';
|
|
||||||
ctx.beginPath();
|
|
||||||
ctx.arc(c.width / 2, c.height / 2, c.width / 2 - 2, 0, 2 * Math.PI, false);
|
|
||||||
ctx.fill();
|
|
||||||
//number in center
|
|
||||||
ctx.font = '48px Helvetica';
|
|
||||||
ctx.fillStyle = '#ffffff';
|
|
||||||
ctx.textAlign = 'center';
|
|
||||||
ctx.textBaseline = 'middle';
|
|
||||||
ctx.fillText( total > 9 ? '9+' : total, 32, 32, 50);
|
|
||||||
|
|
||||||
// Save params of original icon
|
|
||||||
const o = document.querySelectorAll('link[rel="icon"]');
|
|
||||||
let oType, oHref;
|
|
||||||
for (let i = 0; i < o.length; i++) {
|
|
||||||
oHref = o[i].dataset.ohref;
|
|
||||||
oType = o[i].dataset.otype;
|
|
||||||
if (!oHref) {
|
|
||||||
oHref = o[i].getAttribute('href');
|
|
||||||
oType = o[i].getAttribute('type') || '';
|
|
||||||
}
|
|
||||||
o[i].parentNode.removeChild(o[i]);
|
|
||||||
}
|
|
||||||
// Set new icon
|
|
||||||
const n = document.createElement('link');
|
|
||||||
n.setAttribute('rel', 'icon');
|
|
||||||
n.setAttribute('href', c.toDataURL()); //"data:image/png;base64,......"
|
|
||||||
if (oHref) {
|
|
||||||
n.dataset.ohref = oHref;
|
|
||||||
n.dataset.otype = oType;
|
|
||||||
}
|
|
||||||
document.querySelector('head').appendChild(n);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -3169,17 +2957,8 @@ function extensionSettingsAction(actionString, ext, formData)
|
||||||
$('#page_ajax .mtt-settings-table').html(json.html); //FIXME: maybe whole page?
|
$('#page_ajax .mtt-settings-table').html(json.html); //FIXME: maybe whole page?
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (json.alertText) {
|
|
||||||
mttAlert(json.alertText);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const callback = function() {
|
const callback = function() {
|
||||||
if (json.alertTextOnLoad) {
|
if (json.msg) flashInfo(json.msg, json.details);
|
||||||
mttAlert(json.alertTextOnLoad);
|
|
||||||
}
|
|
||||||
else if (json.msg) {
|
|
||||||
flashInfo(json.msg, json.details);
|
|
||||||
}
|
|
||||||
if (json.reload) {
|
if (json.reload) {
|
||||||
setTimeout( function(){
|
setTimeout( function(){
|
||||||
//window.location.hash = '';
|
//window.location.hash = '';
|
||||||
|
|
|
||||||
|
|
@ -1,72 +1,56 @@
|
||||||
/*
|
/*
|
||||||
This file is a part of myTinyTodo.
|
This file is a part of myTinyTodo.
|
||||||
(C) Copyright 2010,2020-2025 Max Pozdeev <maxpozdeev@gmail.com>
|
(C) Copyright 2010,2020,2022 Max Pozdeev <maxpozdeev@gmail.com>
|
||||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
(function(){
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/**
|
var mtt;
|
||||||
* @class
|
|
||||||
*/
|
function MytinytodoAjaxApi(amtt)
|
||||||
function MytinytodoAjaxApi(props)
|
|
||||||
{
|
{
|
||||||
if (typeof mytinytodo !== 'object') {
|
mtt = amtt;
|
||||||
throw "mytinytodo global object is not found!";
|
|
||||||
}
|
|
||||||
this.useREST = true;
|
|
||||||
|
|
||||||
if (props.hasOwnProperty('useREST')) {
|
|
||||||
this.useREST = !!props.useREST;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MytinytodoAjaxApi.prototype = {
|
window.MytinytodoAjaxApi = MytinytodoAjaxApi;
|
||||||
|
|
||||||
|
MytinytodoAjaxApi.prototype =
|
||||||
|
{
|
||||||
|
/* required method */
|
||||||
|
request: function(action, params, callback)
|
||||||
|
{
|
||||||
|
if (!this[action]) throw "Unknown ApiDriver action: " + action;
|
||||||
|
|
||||||
/**
|
|
||||||
* required method
|
|
||||||
* @param {string} action
|
|
||||||
* @param {Object.<string, any>} [params]
|
|
||||||
* @param {ApiDriverCallback} [callback]
|
|
||||||
*
|
|
||||||
* @callback ApiDriverCallback
|
|
||||||
* @param {object} json
|
|
||||||
*/
|
|
||||||
request(action, params, callback) {
|
|
||||||
if (typeof this[action] !== 'function') {
|
|
||||||
throw "Unknown ApiDriver action: " + action;
|
|
||||||
}
|
|
||||||
this[action] (params, function(json){
|
this[action] (params, function(json){
|
||||||
if (json.denied) {
|
if (json.denied) mtt.errorDenied();
|
||||||
mytinytodo.errorDenied();
|
if (callback) callback.call(mtt, json)
|
||||||
}
|
|
||||||
if (callback) {
|
|
||||||
callback.call(mytinytodo, json)
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
loadTasks(params, callback) {
|
loadTasks: function(params, callback)
|
||||||
let q = '';
|
{
|
||||||
|
var q = '';
|
||||||
if (params.search && params.search != '') q += '&s=' + encodeURIComponent(params.search);
|
if (params.search && params.search != '') q += '&s=' + encodeURIComponent(params.search);
|
||||||
if (params.tag && params.tag != '') q += '&t=' + encodeURIComponent(params.tag);
|
if (params.tag && params.tag != '') q += '&t=' + encodeURIComponent(params.tag);
|
||||||
if (params.setCompl && params.setCompl != 0) q += '&setCompl=1';
|
if (params.setCompl && params.setCompl != 0) q += '&setCompl=1';
|
||||||
if (params.saveSort && params.saveSort != 0) q += '&saveSort=1';
|
if (params.saveSort && params.saveSort != 0) q += '&saveSort=1';
|
||||||
|
|
||||||
$.getJSON(mytinytodo.apiUrl + 'tasks' + (mytinytodo.apiUrl.indexOf('?') > -1 ? '&' : '?') +
|
$.getJSON(mtt.apiUrl + 'tasks' + (mtt.apiUrl.indexOf('?') > -1 ? '&' : '?') + 'list='+params.list+'&compl='+params.compl+'&sort='+params.sort+q, callback);
|
||||||
'list='+params.list+'&compl='+params.compl+'&sort='+params.sort+q,
|
|
||||||
callback);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
newTask(params, callback) {
|
newTask: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks',
|
url: mtt.apiUrl + 'tasks',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'newSimple',
|
action: 'simple',
|
||||||
list: params.list,
|
list: params.list,
|
||||||
title: params.title,
|
title: params.title,
|
||||||
tag: params.tag,
|
tag: params.tag,
|
||||||
|
|
@ -77,13 +61,14 @@ MytinytodoAjaxApi.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
fullNewTask(params, callback) {
|
fullNewTask: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks',
|
url: mtt.apiUrl + 'tasks',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'newFull',
|
action: 'full',
|
||||||
list: params.list,
|
list: params.list,
|
||||||
title: params.title,
|
title: params.title,
|
||||||
note: params.note,
|
note: params.note,
|
||||||
|
|
@ -98,10 +83,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
editTask(params, callback) {
|
editTask: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
url: mtt.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'edit',
|
action: 'edit',
|
||||||
|
|
@ -117,10 +103,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
editNote(params, callback) {
|
editNote: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
url: mtt.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'note',
|
action: 'note',
|
||||||
|
|
@ -132,10 +119,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
completeTask(params, callback) {
|
completeTask: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
url: mtt.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'complete',
|
action: 'complete',
|
||||||
|
|
@ -147,24 +135,22 @@ MytinytodoAjaxApi.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
deleteTask(params, callback) {
|
deleteTask: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
url: mtt.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
||||||
method: this.useREST ? 'DELETE' : 'POST',
|
method: 'DELETE',
|
||||||
contentType : 'application/json', // contentType and data are required if method is POST
|
|
||||||
data: JSON.stringify({
|
|
||||||
action: 'delete',
|
|
||||||
}),
|
|
||||||
success: callback,
|
success: callback,
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
setTaskPriority(params, callback) {
|
setTaskPriority: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
url: mtt.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'priority',
|
action: 'priority',
|
||||||
|
|
@ -175,10 +161,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
changeOrder(params, callback) {
|
changeOrder: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks',
|
url: mtt.apiUrl + 'tasks',
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'order',
|
action: 'order',
|
||||||
|
|
@ -189,18 +176,21 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
suggestTags(params, callback) {
|
suggestTags: function(params, callback)
|
||||||
$.getJSON(mytinytodo.apiUrl + 'suggestTags', {list:params.list, q:params.q}, callback);
|
{
|
||||||
|
$.getJSON(mtt.apiUrl + 'suggestTags', {list:params.list, q:params.q}, callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
tagCloud(params, callback) {
|
tagCloud: function(params, callback)
|
||||||
$.getJSON(mytinytodo.apiUrl + 'tagCloud/' + encodeURIComponent(params.list), callback);
|
{
|
||||||
|
$.getJSON(mtt.apiUrl + 'tagCloud/' + encodeURIComponent(params.list), callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
moveTask(params, callback) {
|
moveTask: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
url: mtt.apiUrl + 'tasks/' + encodeURIComponent(params.id),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'move',
|
action: 'move',
|
||||||
|
|
@ -212,9 +202,10 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
parseTaskStr(params, callback) {
|
parseTaskStr: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'tasks/parseTitle',
|
url: mtt.apiUrl + 'tasks/parseTitle',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
|
|
@ -227,42 +218,20 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
newTaskCounter(params, callback) {
|
|
||||||
fetch(mytinytodo.apiUrl + 'tasks/newCounter', {
|
|
||||||
method: 'POST',
|
|
||||||
credentials: 'same-origin', // old browsers
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'MTT-Token': mytinytodo.options.token,
|
|
||||||
},
|
|
||||||
body: JSON.stringify(params)
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
if (!response.ok) throw response;
|
|
||||||
return response.json();
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
if (e instanceof Error) console.log("newTaskCounter fetch error: ", e);
|
|
||||||
else console.log("newTaskCounter fetch error, HTTP status code: " + e.status);
|
|
||||||
})
|
|
||||||
.then(json => {
|
|
||||||
callback(json)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// Lists
|
// Lists
|
||||||
loadLists(params, callback) {
|
loadLists: function(params, callback)
|
||||||
$.getJSON(mytinytodo.apiUrl + 'lists', callback);
|
{
|
||||||
|
$.getJSON(mtt.apiUrl + 'lists', callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
addList(params, callback) {
|
addList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists',
|
url: mtt.apiUrl + 'lists',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'new',
|
|
||||||
name: params.name,
|
name: params.name,
|
||||||
}),
|
}),
|
||||||
success: callback,
|
success: callback,
|
||||||
|
|
@ -271,23 +240,21 @@ MytinytodoAjaxApi.prototype = {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteList(params, callback) {
|
deleteList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'DELETE' : 'POST',
|
method: 'DELETE',
|
||||||
contentType : 'application/json', // contentType and data are required if method is POST
|
|
||||||
data: JSON.stringify({
|
|
||||||
action: 'delete',
|
|
||||||
}),
|
|
||||||
success: callback,
|
success: callback,
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
renameList(params, callback) {
|
renameList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'rename',
|
action: 'rename',
|
||||||
|
|
@ -298,10 +265,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setSort(params, callback) {
|
setSort: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'sort',
|
action: 'sort',
|
||||||
|
|
@ -313,10 +281,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
publishList(params, callback) {
|
publishList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'publish',
|
action: 'publish',
|
||||||
|
|
@ -327,10 +296,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
enableFeedKey(params, callback) {
|
enableFeedKey: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'enableFeedKey',
|
action: 'enableFeedKey',
|
||||||
|
|
@ -341,10 +311,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setShowNotesInList(params, callback) {
|
setShowNotesInList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'showNotes',
|
action: 'showNotes',
|
||||||
|
|
@ -355,10 +326,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setHideList(params, callback) {
|
setHideList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'hide',
|
action: 'hide',
|
||||||
|
|
@ -369,10 +341,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
changeListOrder(params, callback) {
|
changeListOrder: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists',
|
url: mtt.apiUrl + 'lists',
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'order',
|
action: 'order',
|
||||||
|
|
@ -383,10 +356,11 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
clearCompletedInList(params, callback) {
|
clearCompletedInList: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
url: mtt.apiUrl + 'lists/' + encodeURIComponent(params.list),
|
||||||
method: this.useREST ? 'PUT' : 'POST',
|
method: 'PUT',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
action: 'clearCompleted',
|
action: 'clearCompleted',
|
||||||
|
|
@ -398,9 +372,10 @@ MytinytodoAjaxApi.prototype = {
|
||||||
|
|
||||||
/* Auth */
|
/* Auth */
|
||||||
|
|
||||||
login(params, callback) {
|
login: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'login',
|
url: mtt.apiUrl + 'login',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
contentType : 'application/json',
|
contentType : 'application/json',
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
|
|
@ -411,9 +386,10 @@ MytinytodoAjaxApi.prototype = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
logout(params, callback) {
|
logout: function(params, callback)
|
||||||
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: mytinytodo.apiUrl + 'logout',
|
url: mtt.apiUrl + 'logout',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: callback,
|
success: callback,
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
|
|
@ -421,3 +397,5 @@ MytinytodoAjaxApi.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
})();
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,9 @@
|
||||||
|
|
||||||
/* Dark mode */
|
/* Dark mode */
|
||||||
|
|
||||||
/* prefers-color-scheme media query is used in html link tag */
|
/* prefers-color-scheme media query value detected in js part */
|
||||||
:root {
|
html[data-appearance=dark],
|
||||||
|
html[data-appearance=system][data-system-appearance=dark] {
|
||||||
|
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
@media print {
|
@media print {
|
||||||
|
|
||||||
html,body { height:auto; }
|
html { height:0; }
|
||||||
|
body { height:0; min-height:0; margin:0; }
|
||||||
h2 { display: none; }
|
h2 { display: none; }
|
||||||
h3 { border-bottom:2px solid #777777; }
|
h3 { border-bottom:2px solid #777777; }
|
||||||
#toolbar { display: none; }
|
#toolbar { display: none; }
|
||||||
|
|
@ -9,9 +10,8 @@
|
||||||
.mtt-tab { display:none; }
|
.mtt-tab { display:none; }
|
||||||
.mtt-tab.mtt-tab-selected { display:block; border:none; background:none; margin:0; }
|
.mtt-tab.mtt-tab-selected { display:block; border:none; background:none; margin:0; }
|
||||||
.mtt-tab.mtt-tab-selected a { padding:0; display:inline-block; height:auto; }
|
.mtt-tab.mtt-tab-selected a { padding:0; display:inline-block; height:auto; }
|
||||||
.mtt-tab.mtt-tab-selected .title-block { display:inline-block; }
|
|
||||||
.mtt-tab.mtt-tab-selected .list-action { display:none; }
|
.mtt-tab.mtt-tab-selected .list-action { display:none; }
|
||||||
.mtt-tab.mtt-tab-selected .title { text-align:left; padding:0; margin:0; max-width:none; font-size:1.3rem; color:#000; }
|
.mtt-tab a span { text-align:left; padding:0; max-width:none; font-size:1.3rem; color:#000; }
|
||||||
|
|
||||||
.mtt-tabs-new-button { display:none; }
|
.mtt-tabs-new-button { display:none; }
|
||||||
#tabs_buttons { display:none; }
|
#tabs_buttons { display:none; }
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ body, td, th, input, textarea, select, button {
|
||||||
width:100%;
|
width:100%;
|
||||||
max-width:1100px;
|
max-width:1100px;
|
||||||
padding:8px;
|
padding:8px;
|
||||||
margin-bottom: 1rem;
|
margin-bottom:8px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,13 +176,7 @@ body::after {
|
||||||
content:url(images/logo-loading.gif);
|
content:url(images/logo-loading.gif);
|
||||||
}
|
}
|
||||||
|
|
||||||
h3.page-title {
|
h3.page-title { margin:0; border-bottom:2px solid var(--color-content-delimiter); margin-bottom:10px; padding:0.6rem 0; font-size:1.1rem; }
|
||||||
margin:0;
|
|
||||||
border-bottom:2px solid var(--color-content-delimiter);
|
|
||||||
margin-bottom:1rem;
|
|
||||||
padding:0.6rem 0;
|
|
||||||
font-size:1.1rem;
|
|
||||||
}
|
|
||||||
a { color: var(--color-link); cursor:pointer; text-decoration:underline; }
|
a { color: var(--color-link); cursor:pointer; text-decoration:underline; }
|
||||||
|
|
||||||
.topblock { display:flex; align-items:flex-start; margin-bottom:1rem; }
|
.topblock { display:flex; align-items:flex-start; margin-bottom:1rem; }
|
||||||
|
|
@ -606,15 +600,12 @@ li.task-row.task-expanded .task-toggle { transform:rotate(90deg); }
|
||||||
background-color: var(--color-tasklist-row); /* ?? */
|
background-color: var(--color-tasklist-row); /* ?? */
|
||||||
position:relative; /* for z-index */
|
position:relative; /* for z-index */
|
||||||
}
|
}
|
||||||
/*#mtt:not(.touch-device) #tasklist li.task-row:hover,*/
|
#mtt:not(.touch-device) #tasklist li.task-row:hover,
|
||||||
#mtt:not(.touch-device) #tasklist li.task-row.menu-active {
|
#mtt:not(.touch-device) #tasklist li.task-row.menu-active {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
box-shadow: 0 0 2px var(--color-tasklisk-hover-shadow);
|
box-shadow: 0 0 2px var(--color-tasklisk-hover-shadow);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
#mtt:not(.touch-device) #tasklist li.task-row.menu-active:not(.task-expanded) {
|
|
||||||
border-bottom-color: transparent;
|
|
||||||
}
|
|
||||||
#tasklist .task-block {
|
#tasklist .task-block {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|
@ -625,9 +616,6 @@ li.task-row.task-expanded .task-toggle { transform:rotate(90deg); }
|
||||||
border:1px solid var(--color-tasklist-row-expanded-border);
|
border:1px solid var(--color-tasklist-row-expanded-border);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
#tasklist li.task-row:not(.task-expanded):has(+ li.task-row.task-expanded) {
|
|
||||||
border-bottom-color: transparent;
|
|
||||||
}
|
|
||||||
#tasklist li.task-row.task-has-note.task-expanded .task-block {
|
#tasklist li.task-row.task-has-note.task-expanded .task-block {
|
||||||
border-bottom: 1px solid var(--color-tasklist-row-inter-border);
|
border-bottom: 1px solid var(--color-tasklist-row-inter-border);
|
||||||
}
|
}
|
||||||
|
|
@ -661,15 +649,14 @@ li.task-row.task-expanded .task-toggle { transform:rotate(90deg); }
|
||||||
margin-top: 0.2rem;
|
margin-top: 0.2rem;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.task-id::after {
|
.task-id {
|
||||||
content: ' · '; /* '·' */
|
/*display: none;*/
|
||||||
}
|
}
|
||||||
#mtt.show-date .task-date {
|
#mtt.show-date .task-date {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
#mtt.show-date.date-inline .task-date {
|
#mtt.show-date.date-inline .task-date {
|
||||||
display: inline-block; /* for RTL */
|
display: inline;
|
||||||
margin:0;
|
|
||||||
margin-left:3px;
|
margin-left:3px;
|
||||||
}
|
}
|
||||||
.task-through { overflow:hidden; flex-grow:1; }
|
.task-through { overflow:hidden; flex-grow:1; }
|
||||||
|
|
@ -691,7 +678,7 @@ li.task-row.task-expanded .task-toggle { transform:rotate(90deg); }
|
||||||
}
|
}
|
||||||
.task-tags {
|
.task-tags {
|
||||||
margin:0px 3px;
|
margin:0px 3px;
|
||||||
display: inline;
|
display: inline-block; /* for RTL */
|
||||||
}
|
}
|
||||||
.task-tags:empty {
|
.task-tags:empty {
|
||||||
margin:0;
|
margin:0;
|
||||||
|
|
@ -714,7 +701,6 @@ li.task-row.task-completed .duedate { /*font-size:0.8rem;*/ display:none; }
|
||||||
#tasklist li.task-row.past .duedate { color: var(--color-duedate-past); }
|
#tasklist li.task-row.past .duedate { color: var(--color-duedate-past); }
|
||||||
|
|
||||||
#tasklist li.task-row.task-completed { opacity:0.6; }
|
#tasklist li.task-row.task-completed { opacity:0.6; }
|
||||||
#tasklist li.task-row.task-completed .task-through { text-decoration:line-through; }
|
|
||||||
#tasklist li.task-row.task-completed:hover { opacity:1.0; }
|
#tasklist li.task-row.task-completed:hover { opacity:1.0; }
|
||||||
|
|
||||||
#tasklist li.task-row.not-in-tagpreview {
|
#tasklist li.task-row.not-in-tagpreview {
|
||||||
|
|
@ -778,12 +764,13 @@ li.task-row:hover .taskactionbtn {
|
||||||
word-wrap:break-word;
|
word-wrap:break-word;
|
||||||
}
|
}
|
||||||
li.task-row.task-expanded .task-note-block { display:block; }
|
li.task-row.task-expanded .task-note-block { display:block; }
|
||||||
li.task-row.task-completed .task-note-block .task-note { text-decoration:line-through; }
|
|
||||||
.task-note-area { display:none; margin-bottom:5px; }
|
.task-note-area { display:none; margin-bottom:5px; }
|
||||||
.task-note-area textarea { color:var(--color-text-reduced); width:100%; display:block; height:65px; }
|
.task-note-area textarea { color:var(--color-text-reduced); width:100%; display:block; height:65px; }
|
||||||
.task-note-actions { font-size:0.8rem; }
|
.task-note-actions { font-size:0.8rem; }
|
||||||
.hidden { display:none; }
|
.hidden { display:none; }
|
||||||
.invisible { visibility:hidden; }
|
.invisible { visibility:hidden; }
|
||||||
|
.in500 { width:500px; color: var(--color-text-reduced); }
|
||||||
|
.in100 { width:100px; color: var(--color-text-reduced); }
|
||||||
.task-note a { color: var(--color-tasklist-note-link); }
|
.task-note a { color: var(--color-tasklist-note-link); }
|
||||||
.task-note a:hover { color: var(--color-tasklist-link-hover) }
|
.task-note a:hover { color: var(--color-tasklist-link-hover) }
|
||||||
|
|
||||||
|
|
@ -810,43 +797,23 @@ li.task-row.task-completed .task-note-block .task-note { text-decoration:line-th
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-container {
|
|
||||||
display: flex;
|
.form-row { margin-top:0.6rem; }
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.form-row {
|
|
||||||
margin-top:0.6rem;
|
|
||||||
}
|
|
||||||
.form-row-short {
|
|
||||||
margin-right:12px;
|
|
||||||
}
|
|
||||||
.form-row:not(.form-row-short) {
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
.form-row .h {
|
.form-row .h {
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
color: var(--color-text-reduced);
|
color: var(--color-text-reduced);
|
||||||
}
|
}
|
||||||
.form-row div.h {
|
.form-row div.h { margin-bottom:3px; }
|
||||||
margin-bottom:3px;
|
.form-row-short-end { clear:both; }
|
||||||
}
|
#page_taskedit .form-row .in500 { width:100%; box-sizing:border-box; }
|
||||||
.form-input {
|
#page_taskedit .form-row textarea.in500 {
|
||||||
color: var(--color-text-reduced);
|
height:300px;
|
||||||
}
|
|
||||||
.form-input.in100 {
|
|
||||||
width:100px;
|
|
||||||
}
|
|
||||||
.form-input.inmax {
|
|
||||||
width:100%;
|
|
||||||
box-sizing:border-box;
|
|
||||||
}
|
|
||||||
textarea.form-input.inmax {
|
|
||||||
height:280px;
|
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
font-family: ui-monospace,Consolas,"SF Mono",Menlo,"Liberation Mono",monospace;
|
font-family: ui-monospace,Consolas,"SF Mono",Menlo,"Liberation Mono",monospace;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
#page_taskedit .form-row-short { float:left; margin-right:12px; }
|
||||||
.alltags-cell { width:1%; white-space:nowrap; padding-left:5px; }
|
.alltags-cell { width:1%; white-space:nowrap; padding-left:5px; }
|
||||||
#page_taskedit.mtt-inadd .mtt-inedit { display:none; }
|
#page_taskedit.mtt-inadd .mtt-inedit { display:none; }
|
||||||
#page_taskedit.mtt-inedit .mtt-inadd { display:none; }
|
#page_taskedit.mtt-inedit .mtt-inadd { display:none; }
|
||||||
|
|
@ -869,8 +836,6 @@ textarea.form-input.inmax {
|
||||||
#page_taskviewer .container .left {
|
#page_taskviewer .container .left {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
min-width: 0; /* to limit long text*/
|
min-width: 0; /* to limit long text*/
|
||||||
border-right: 1px solid var(--color-tasklist-row-expanded-border);
|
|
||||||
padding-right: 0.5rem;
|
|
||||||
}
|
}
|
||||||
#page_taskviewer .container .right {
|
#page_taskviewer .container .right {
|
||||||
min-width:300px;
|
min-width:300px;
|
||||||
|
|
@ -911,9 +876,6 @@ textarea.form-input.inmax {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
#mtt.readonly #taskviewer_edit_btn {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* autocomplete */
|
/* autocomplete */
|
||||||
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
.ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
|
||||||
|
|
@ -978,9 +940,6 @@ textarea.form-input.inmax {
|
||||||
#tagcloudAllLists:disabled + label {
|
#tagcloudAllLists:disabled + label {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
#tagcloudSearch {
|
|
||||||
margin-left: 0.5rem;
|
|
||||||
}
|
|
||||||
#tagcloudcancel span {
|
#tagcloudcancel span {
|
||||||
mask: var(--svg-closetag) no-repeat; -webkit-mask: var(--svg-closetag) no-repeat;
|
mask: var(--svg-closetag) no-repeat; -webkit-mask: var(--svg-closetag) no-repeat;
|
||||||
background-color: var(--color-btn-reduced);
|
background-color: var(--color-btn-reduced);
|
||||||
|
|
@ -1073,23 +1032,7 @@ textarea.form-input.inmax {
|
||||||
mask: var(--svg-arr-right) no-repeat; -webkit-mask: var(--svg-arr-right) no-repeat;
|
mask: var(--svg-arr-right) no-repeat; -webkit-mask: var(--svg-arr-right) no-repeat;
|
||||||
background-color: var(--color-btn-default);
|
background-color: var(--color-btn-default);
|
||||||
}
|
}
|
||||||
.ui-datepicker select {
|
|
||||||
appearance: none;
|
|
||||||
-webkit-appearance: none; -moz-appearance: none;
|
|
||||||
background: transparent var(--svg-select) no-repeat top 2px right 4px;
|
|
||||||
background-size: 1rem 1rem;
|
|
||||||
padding: 1px 3px;
|
|
||||||
padding-right: calc(1rem + 7px);
|
|
||||||
border: 1px solid var(--color-border-default);
|
|
||||||
border-radius: 2px;
|
|
||||||
color: var(--color-text-default);
|
|
||||||
margin: 0 2px;
|
|
||||||
}
|
|
||||||
.ui-datepicker select:focus {
|
|
||||||
outline:none;
|
|
||||||
/*border-color: var(--color-border-focus);
|
|
||||||
box-shadow:0 0 0 2px var(--color-border-focus-shadow);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.mtt-menu-button {
|
.mtt-menu-button {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
@ -1163,15 +1106,6 @@ li.mtt-menu-indicator .submenu-icon {
|
||||||
mask: var(--svg-arr-right) no-repeat; -webkit-mask: var(--svg-arr-right) no-repeat;
|
mask: var(--svg-arr-right) no-repeat; -webkit-mask: var(--svg-arr-right) no-repeat;
|
||||||
background-color: var(--color-btn-default);
|
background-color: var(--color-btn-default);
|
||||||
}
|
}
|
||||||
.mtt-menu-container .counter {
|
|
||||||
position:absolute; right:6px; top:50%; margin-top:-8px;
|
|
||||||
height: 16px; min-width:16px;
|
|
||||||
border-radius: 1rem;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
text-align: center;
|
|
||||||
background-color: #686868; /* #de5141 */
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
li.mtt-item-hidden { display:none; }
|
li.mtt-item-hidden { display:none; }
|
||||||
|
|
||||||
#slmenucontainer li.mtt-list-hidden a { font-style:italic; }
|
#slmenucontainer li.mtt-list-hidden a { font-style:italic; }
|
||||||
|
|
@ -1205,19 +1139,14 @@ li.mtt-item-hidden { display:none; }
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.mtt-settings-table .tr.group-header {
|
|
||||||
border-bottom: none !important;
|
|
||||||
padding-bottom: 0 !important;
|
|
||||||
background-color: unset !important;
|
|
||||||
}
|
|
||||||
.mtt-settings-table .group {
|
.mtt-settings-table .group {
|
||||||
margin-top: 0.75rem;
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
background-color: var(--color-settings-row);
|
background-color: var(--color-settings-row);
|
||||||
}
|
}
|
||||||
.mtt-settings-table .group .tr {
|
.mtt-settings-table .group .tr {
|
||||||
margin: 0 10px;
|
margin: 0 1rem;
|
||||||
padding: 1rem 0;
|
padding: 1rem 0;
|
||||||
}
|
}
|
||||||
.mtt-settings-table .group .th {
|
.mtt-settings-table .group .th {
|
||||||
|
|
@ -1235,10 +1164,6 @@ li.mtt-item-hidden { display:none; }
|
||||||
.mtt-settings-table .th {
|
.mtt-settings-table .th {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.mtt-settings-table .group-header .th {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
}
|
}
|
||||||
.mtt-settings-table .td {
|
.mtt-settings-table .td {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
@ -1361,12 +1286,10 @@ li.mtt-item-hidden { display:none; }
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
-webkit-text-size-adjust: 100%; /* Dont increase font-size in horizontal orientation on ios */
|
-webkit-text-size-adjust: 100%; /* Dont increase font-size in horizontal orientation on ios */
|
||||||
}
|
}
|
||||||
textarea.form-input.inmax { font-size: 14px; }
|
#page_taskedit .form-row textarea.in500 { font-size: 14px; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* narrow screens */
|
||||||
|
|
||||||
/* ========== narrow screens =========*/
|
|
||||||
@media only screen and (max-width: 600px) {
|
@media only screen and (max-width: 600px) {
|
||||||
|
|
||||||
#mtt { padding: 15px 8px 0px; }
|
#mtt { padding: 15px 8px 0px; }
|
||||||
|
|
@ -1408,10 +1331,6 @@ li.mtt-item-hidden { display:none; }
|
||||||
#toolbar.mtt-insearch .searchbox-c { width:100%; max-width:100%; }
|
#toolbar.mtt-insearch .searchbox-c { width:100%; max-width:100%; }
|
||||||
#search { padding:5px 20px; border-radius:15px; }
|
#search { padding:5px 20px; border-radius:15px; }
|
||||||
|
|
||||||
#tagcloudSearch {
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.task-date {
|
.task-date {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
@ -1439,13 +1358,11 @@ li.mtt-item-hidden { display:none; }
|
||||||
|
|
||||||
.task-toggle { display:none; }
|
.task-toggle { display:none; }
|
||||||
#tasklist .mtt-task-placeholder { line-height:1rem; padding-top:0.6rem; padding-bottom:0.6rem; }
|
#tasklist .mtt-task-placeholder { line-height:1rem; padding-top:0.6rem; padding-bottom:0.6rem; }
|
||||||
#tasklist .ui-sortable-helper { box-shadow:0px 0px 3px #555; opacity: 0.9; }
|
#tasklist .ui-sortable-helper { box-shadow:0px 0px 3px #555; }
|
||||||
#tasklist .ui-sortable-helper .task-left { visibility: hidden }
|
|
||||||
#tasklist .ui-sortable-helper .task-actions > * { visibility: hidden }
|
|
||||||
|
|
||||||
#page_taskedit { max-width:100%; border:none; position:static; padding:0; }
|
#page_taskedit { max-width:100%; border:none; position:static; padding:0; }
|
||||||
#page_taskedit .form-table { width:100%; }
|
#page_taskedit .form-table { width:100%; }
|
||||||
#page_taskedit .form-row textarea { height: 150px; }
|
#page_taskedit .form-row textarea { height: 70px; }
|
||||||
|
|
||||||
#loading { padding:0px; padding-top:1px; padding-right:1px; height:16px; overflow:hidden; }
|
#loading { padding:0px; padding-top:1px; padding-right:1px; height:16px; overflow:hidden; }
|
||||||
|
|
||||||
|
|
@ -1453,18 +1370,11 @@ li.mtt-item-hidden { display:none; }
|
||||||
.mtt-settings-table .in350 { min-width:50px; width:100%; }
|
.mtt-settings-table .in350 { min-width:50px; width:100%; }
|
||||||
.mtt-notes-showhide { display:none; }
|
.mtt-notes-showhide { display:none; }
|
||||||
|
|
||||||
.mtt-menu-container li {
|
.mtt-menu-container li { padding-top:0.3rem; padding-bottom:0.3rem; }
|
||||||
padding-top: 0.4rem;
|
|
||||||
padding-bottom: 0.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#page_taskviewer .container {
|
#page_taskviewer .container {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
#page_taskviewer .container .left {
|
|
||||||
border-right: none;
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
#page_taskviewer .container .right {
|
#page_taskviewer .container .right {
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|
@ -1477,8 +1387,7 @@ li.mtt-item-hidden { display:none; }
|
||||||
}
|
}
|
||||||
#page_taskviewer .note,
|
#page_taskviewer .note,
|
||||||
#page_taskviewer .no-note {
|
#page_taskviewer .no-note {
|
||||||
padding-bottom: 1rem;
|
padding-bottom:10px;
|
||||||
margin-bottom: 1rem;
|
|
||||||
border-bottom: 2px solid var(--color-tasklist-row-expanded-border);
|
border-bottom: 2px solid var(--color-tasklist-row-expanded-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1489,22 +1398,15 @@ li.mtt-item-hidden { display:none; }
|
||||||
padding:10px 15px;
|
padding:10px 15px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
.mtt-settings-table .group {
|
|
||||||
background-color: var(--color-settings-row);
|
|
||||||
}
|
|
||||||
.mtt-settings-table .group .tr {
|
.mtt-settings-table .group .tr {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
padding: 1rem 1rem;
|
padding: 1rem 0;
|
||||||
margin: 0 0;
|
margin: 0 1rem;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
background-color: unset;
|
|
||||||
}
|
}
|
||||||
.mtt-settings-table .group .tr:not(:last-child) {
|
.mtt-settings-table .group .tr:not(:last-child) {
|
||||||
border-bottom:1px solid var(--color-border-default);
|
border-bottom:1px solid var(--color-border-default);
|
||||||
}
|
}
|
||||||
.mtt-settings-table .group .th {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
.mtt-settings-table .th {
|
.mtt-settings-table .th {
|
||||||
width: auto;
|
width: auto;
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
|
|
@ -1516,12 +1418,7 @@ li.mtt-item-hidden { display:none; }
|
||||||
.mtt-settings-table .td.extensions {
|
.mtt-settings-table .td.extensions {
|
||||||
line-height: 2em;
|
line-height: 2em;
|
||||||
}
|
}
|
||||||
.mtt-settings-table input,
|
.mtt-settings-table input , .mtt-settings-table select, .mtt-settings-table label { margin-top:5px; background-color: var(--color-settings-row); }
|
||||||
.mtt-settings-table select,
|
|
||||||
.mtt-settings-table label {
|
|
||||||
margin-top:5px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.form-bottom-buttons > * {
|
.form-bottom-buttons > * {
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,13 @@
|
||||||
body { direction:rtl; }
|
body { direction:rtl; }
|
||||||
.topblock h2 {
|
h2 { padding-left:10px; padding-right:0px; }
|
||||||
background-position: right;
|
|
||||||
padding-left: 10px;
|
|
||||||
padding-right: 30px;
|
|
||||||
}
|
|
||||||
#loading { margin-left:6px; margin-right:0px; }
|
#loading { margin-left:6px; margin-right:0px; }
|
||||||
.bar-menu { text-align: left; }
|
|
||||||
.bar-menu > * {
|
|
||||||
margin-right: 10px;
|
|
||||||
margin-left: unset;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mtt-tab { margin-left:3px; margin-right:0px; border-top-right-radius:0px; border-top-left-radius:8px; }
|
.mtt-tab { margin-left:3px; margin-right:0px; border-top-right-radius:0px; border-top-left-radius:8px; }
|
||||||
.mtt-tabs-new-button { border-top-right-radius:0px; border-top-left-radius:8px; }
|
.mtt-tabs-new-button { border-top-right-radius:0px; border-top-left-radius:8px; }
|
||||||
.mtt-tabs-select-button>span { transform:rotateY(180deg); }
|
.mtt-tabs-select-button>span { transform:rotateY(180deg); }
|
||||||
|
|
||||||
#task { padding-left:20px; padding-right:4px; }
|
#task { padding-left:20px; padding-right:4px; }
|
||||||
.mtt-taskbox-icon { left:2px; right:auto; transform:rotateY(180deg); }
|
.mtt-taskbox-icon { left:2px; right:auto; transform:rotateY(180deg); }
|
||||||
#newtask_adv { margin-left:0; margin-right:0.5rem; transform:rotateY(180deg); }
|
#newtask_adv { margin-left:0; margin-right:0.5rem; }
|
||||||
.mtt-searchbox-icon.mtt-icon-search { right:4px; left:auto; }
|
.mtt-searchbox-icon.mtt-icon-search { right:4px; left:auto; }
|
||||||
.mtt-searchbox-icon.mtt-icon-cancelsearch { left:4px; right:auto; }
|
.mtt-searchbox-icon.mtt-icon-cancelsearch { left:4px; right:auto; }
|
||||||
|
|
||||||
|
|
@ -37,9 +27,10 @@ body { direction:rtl; }
|
||||||
.duedate:before { content:'\20\2190\20'; }
|
.duedate:before { content:'\20\2190\20'; }
|
||||||
|
|
||||||
#tagcloud { box-shadow:-1px 2px 5px rgba(0,0,0,0.5); }
|
#tagcloud { box-shadow:-1px 2px 5px rgba(0,0,0,0.5); }
|
||||||
|
#tagcloudcancel { float:left; }
|
||||||
|
|
||||||
h3.page-title a.mtt-back-button { transform:rotate(180deg); }
|
#taskedit-date { float:left; }
|
||||||
.form-row-short { margin-left:12px; margin-right:0; }
|
#page_taskedit .form-row-short { float:right; margin-left:12px; margin-right:0; }
|
||||||
.alltags-cell { padding-left:0; padding-right:5px; }
|
.alltags-cell { padding-left:0; padding-right:5px; }
|
||||||
|
|
||||||
.mtt-menu-container { box-shadow:-1px 2px 5px rgba(0,0,0,0.5); }
|
.mtt-menu-container { box-shadow:-1px 2px 5px rgba(0,0,0,0.5); }
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
<FilesMatch "\.(json|md|MD)$">
|
|
||||||
Order deny,allow
|
|
||||||
Deny from all
|
|
||||||
</FilesMatch>
|
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file is a part of myTinyTodo.
|
This file is a part of myTinyTodo.
|
||||||
(C) Copyright 2023-2025 Max Pozdeev <maxpozdeev@gmail.com>
|
(C) Copyright 2023 Max Pozdeev <maxpozdeev@gmail.com>
|
||||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -86,10 +86,12 @@ class Backup
|
||||||
}
|
}
|
||||||
$db = \DBConnection::instance();
|
$db = \DBConnection::instance();
|
||||||
$props = null;
|
$props = null;
|
||||||
$autoinc = $this->getTableAutoIncrement($table);
|
if ($db::DBTYPE == \DBConnection::DBTYPE_MYSQL) {
|
||||||
|
$autoinc = $this->getMysqlTableAutoIncrement($table);
|
||||||
if ($autoinc != '') {
|
if ($autoinc != '') {
|
||||||
$props = ['auto_increment' => $autoinc];
|
$props = ['auto_increment' => $autoinc];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$this->writeOpeningTag($group, $props);
|
$this->writeOpeningTag($group, $props);
|
||||||
$q = $db->dq("SELECT * FROM $table");
|
$q = $db->dq("SELECT * FROM $table");
|
||||||
while ($r = $q->fetchAssoc()) {
|
while ($r = $q->fetchAssoc()) {
|
||||||
|
|
@ -118,27 +120,12 @@ class Backup
|
||||||
$this->writeClosingTag($entity);
|
$this->writeClosingTag($entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTableAutoIncrement($table): string
|
function getMysqlTableAutoIncrement(string $table): string
|
||||||
{
|
{
|
||||||
$db = \DBConnection::instance();
|
$db = \DBConnection::instance();
|
||||||
if ($db::DBTYPE == \DBConnection::DBTYPE_MYSQL) {
|
|
||||||
$r = $db->sqa("SHOW TABLE STATUS WHERE Name=?", [$table]);
|
$r = $db->sqa("SHOW TABLE STATUS WHERE Name=?", [$table]);
|
||||||
return (string)$r['Auto_increment'] ?? '';
|
return (string)$r['Auto_increment'] ?? '';
|
||||||
}
|
}
|
||||||
else if ($db::DBTYPE == \DBConnection::DBTYPE_SQLITE) {
|
|
||||||
$seq = (int)$db->sq("SELECT seq FROM sqlite_sequence WHERE name=?", [$table]);
|
|
||||||
if ($seq > 0)
|
|
||||||
return (string)$seq;
|
|
||||||
}
|
|
||||||
else if ($db::DBTYPE == \DBConnection::DBTYPE_POSTGRES) {
|
|
||||||
if ($db->tableFieldExists($table, 'id')) {
|
|
||||||
$v = (int)$db->sq("SELECT last_value FROM ". $table. '_id_seq');
|
|
||||||
if ($v > 0)
|
|
||||||
return (string)$v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,8 @@ class Controller extends \ApiController
|
||||||
|
|
||||||
$this->response->data = [
|
$this->response->data = [
|
||||||
'total' => 1,
|
'total' => 1,
|
||||||
'ok' => true,
|
|
||||||
'msg' => __("backup.done"),
|
'msg' => __("backup.done"),
|
||||||
'alertTextOnLoad' => __("backup.done"),
|
'details' => ''
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,17 +118,12 @@ class Controller extends \ApiController
|
||||||
];
|
];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$html = "<pre>". htmlspecialchars($check->report). "</pre>";
|
||||||
$this->response->data = [
|
$this->response->data = [
|
||||||
'total' => 1,
|
'total' => 1,
|
||||||
'ok' => true,
|
|
||||||
'msg' => __("backup.done"),
|
'msg' => __("backup.done"),
|
||||||
|
'html' => $html,
|
||||||
];
|
];
|
||||||
if ($check->report == 'OK') {
|
|
||||||
$this->response->data['alertText'] = "OK";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$this->response->data['html'] = "<pre>". htmlspecialchars($check->report). "</pre>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function postRepairInconsistency()
|
function postRepairInconsistency()
|
||||||
|
|
@ -147,9 +141,7 @@ class Controller extends \ApiController
|
||||||
}
|
}
|
||||||
$this->response->data = [
|
$this->response->data = [
|
||||||
'total' => 1,
|
'total' => 1,
|
||||||
'ok' => true,
|
|
||||||
'msg' => __("backup.done"),
|
'msg' => __("backup.done"),
|
||||||
'alertText' => __("backup.done"),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file is a part of myTinyTodo.
|
This file is a part of myTinyTodo.
|
||||||
(C) Copyright 2023-2025 Max Pozdeev <maxpozdeev@gmail.com>
|
(C) Copyright 2023 Max Pozdeev <maxpozdeev@gmail.com>
|
||||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -217,9 +217,6 @@ class Restore
|
||||||
case DBConnection::DBTYPE_POSTGRES:
|
case DBConnection::DBTYPE_POSTGRES:
|
||||||
$db->ex("ALTER TABLE {$db->prefix}$table ALTER COLUMN id RESTART WITH ". (int)$autoinc);
|
$db->ex("ALTER TABLE {$db->prefix}$table ALTER COLUMN id RESTART WITH ". (int)$autoinc);
|
||||||
break;
|
break;
|
||||||
case DBConnection::DBTYPE_SQLITE:
|
|
||||||
$db->ex("UPDATE sqlite_sequence SET seq=? WHERE name=?", [$autoinc, $db->prefix. $table]);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -235,9 +232,8 @@ class Restore
|
||||||
$db->ex("TRUNCATE TABLE $table RESTART IDENTITY");
|
$db->ex("TRUNCATE TABLE $table RESTART IDENTITY");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# - we do not use TRUNCATE on mysql due to autocommit
|
// we do not use TRUNCATE on mysql due to autocommit
|
||||||
# - sqlite has truncate optimizer while delete all to make it faster
|
// sqlite has truncate optimizer
|
||||||
# - no need to reset auto_increment sequence before inserting lower ids
|
|
||||||
$db->ex("DELETE FROM $table");
|
$db->ex("DELETE FROM $table");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"bundleId": "backup",
|
"bundleId": "backup",
|
||||||
"name": "Backup",
|
"name": "Backup",
|
||||||
"version": "1.1",
|
"version": "0.9",
|
||||||
"description": "Backup"
|
"description": "Backup"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ class BackupExtension extends MTTExtension implements MTTExtensionSettingsInterf
|
||||||
$filename = MTTPATH. 'db/backup.xml';
|
$filename = MTTPATH. 'db/backup.xml';
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
$time = filemtime($filename);
|
$time = filemtime($filename);
|
||||||
$lastBackup = htmlspecialchars( sprintf($e('backup.last_backup'), formatTime(Config::get('dateformat'). " H:i:s", $time)) );
|
$lastBackup = htmlspecialchars( sprintf($e('backup.last_backup'), formatTime(Config::get('dateformat'). " H:m:s", $time)) );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$downloadDisabled = 'disabled';
|
$downloadDisabled = 'disabled';
|
||||||
|
|
@ -95,7 +95,7 @@ function onBackupFileChange(el) {
|
||||||
<div class="descr">{$e('backup.d_inconsistency')}</div>
|
<div class="descr">{$e('backup.d_inconsistency')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="td">
|
<div class="td">
|
||||||
<button type=button data-ext-settings-action="post:checkInconsistency" data-ext="$ext"> {$e('backup.check')} </button>
|
<button type=button data-ext-settings-action="post:checkInconsistency:file" data-ext="$ext"> {$e('backup.check')} </button>
|
||||||
<button type=button data-ext-settings-action="post:repairInconsistency" data-ext="$ext"> {$e('backup.repair')} </button> <br>
|
<button type=button data-ext-settings-action="post:repairInconsistency" data-ext="$ext"> {$e('backup.repair')} </button> <br>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class Sender
|
||||||
function __construct(array $prefs, bool $useCli = false)
|
function __construct(array $prefs, bool $useCli = false)
|
||||||
{
|
{
|
||||||
$this->prefs = $prefs;
|
$this->prefs = $prefs;
|
||||||
if ($useCli && function_exists('pcntl_fork') && function_exists('posix_setsid')) {
|
if ($useCli && function_exists('pcntl_fork')) {
|
||||||
$this->cli = true;
|
$this->cli = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -193,7 +193,7 @@ class Sender
|
||||||
$host = parse_url(get_unsafe_mttinfo('url'), PHP_URL_HOST);
|
$host = parse_url(get_unsafe_mttinfo('url'), PHP_URL_HOST);
|
||||||
$host = preg_replace('/^(www\.)/', '', $host);
|
$host = preg_replace('/^(www\.)/', '', $host);
|
||||||
//$host = gethostname();
|
//$host = gethostname();
|
||||||
if (function_exists('posix_getpwuid') && false !== ($userinfo = posix_getpwuid(posix_getuid())) ) {
|
if (function_exists('posix_getuid') && false !== ($userinfo = posix_getpwuid(posix_getuid())) ) {
|
||||||
return $userinfo['name']. '@'. $host;
|
return $userinfo['name']. '@'. $host;
|
||||||
}
|
}
|
||||||
return "mytinytodo@$host";
|
return "mytinytodo@$host";
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file is a part of myTinyTodo.
|
This file is a part of myTinyTodo.
|
||||||
(C) Copyright 2022-2023 Max Pozdeev <maxpozdeev@gmail.com>
|
(C) Copyright 2022 Max Pozdeev <maxpozdeev@gmail.com>
|
||||||
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
Licensed under the GNU GPL version 2 or any later. See file COPYRIGHT for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -16,10 +16,6 @@ if (!function_exists('pcntl_fork')) {
|
||||||
error_log("Required PHP module is not found: pcntl");
|
error_log("Required PHP module is not found: pcntl");
|
||||||
exit(-2);
|
exit(-2);
|
||||||
}
|
}
|
||||||
if (!function_exists('posix_setsid')) {
|
|
||||||
error_log("Required PHP module is not found: posix");
|
|
||||||
exit(-2);
|
|
||||||
}
|
|
||||||
$dontStartSession = 1;
|
$dontStartSession = 1;
|
||||||
require(__DIR__.'/../../init.php');
|
require(__DIR__.'/../../init.php');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"bundleId": "notifications",
|
"bundleId": "notifications",
|
||||||
"name": "Notifications",
|
"name": "Notifications",
|
||||||
"version": "1.2.1",
|
"version": "1.1",
|
||||||
"description": "Notify about new tasks and lists on e-mail or telegram"
|
"description": "Notify about new tasks and lists on e-mail or telegram"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
"ext.notifications.name": "Benachrichtigungen",
|
|
||||||
"notifications.urlconfigwarning": "Aktivieren Sie die PHP-Direktive 'allow_url_fopen', um Telegram-Benachrichtigungen zu verwenden.",
|
|
||||||
"notifications.check": "Check",
|
|
||||||
"notifications.bot_not_configured": "Bot ist nicht konfiguriert",
|
|
||||||
"notifications.g_email": "E-Mail",
|
|
||||||
"notifications.h_email": "E-Mail:",
|
|
||||||
"notifications.d_email": "Mehrere Adressen mit Komma trennen.",
|
|
||||||
"notifications.h_mailfrom": "Mail von:",
|
|
||||||
"notifications.d_mailfrom": "Diese E-Mail als Absenderadresse verwenden.",
|
|
||||||
"notifications.g_telegram": "Telegram",
|
|
||||||
"notifications.h_token": "Bot-Token:",
|
|
||||||
"notifications.d_token": "Telegram Bot API-Token von @BotFather",
|
|
||||||
"notifications.h_active_chats": "Aktive Chats:",
|
|
||||||
"notifications.d_active_chats": "Anzahl der Chats, bei denen der Bot Benachrichtigungen sendet.",
|
|
||||||
"notifications.deactivate_all": "Alle deaktivieren",
|
|
||||||
"notifications.h_new_chat": "Neuer Chat:",
|
|
||||||
"notifications.d_new_chat": "Starte eine neue Unterhaltung mit dem Bot, sende diesen Code an den Chat und klicke hier auf "Überprüfen".",
|
|
||||||
"notifications.saved": "Gesichert",
|
|
||||||
"notifications.invalid_email": "Ungültige E-Mail Adresse",
|
|
||||||
"notifications.no_bot_info": "Kann keine Bot-Informationen erhalten, Token scheint ungültig zu sein",
|
|
||||||
"notifications.all_chats_deactivated": "Alle Chats deaktiviert",
|
|
||||||
"notifications.no_new_chats": "Keine neuen Chats": "Keine neuen Chats",
|
|
||||||
"notifications.already_active": "Bereits aktiv",
|
|
||||||
"notifications.please_send": "Bitte senden Sie einen Code zur Aktivierung",
|
|
||||||
"notifications.code_not_set": "Code ist nicht gesetzt",
|
|
||||||
"notifications.code_expired": "Der Code ist abgelaufen",
|
|
||||||
"notifications.code_wrong": "Falscher Code",
|
|
||||||
"notifications.activated": "Aktiviert"
|
|
||||||
}
|
|
||||||
|
|
@ -3,12 +3,11 @@
|
||||||
"notifications.urlconfigwarning": "Enable PHP 'allow_url_fopen' directive to use Telegram notifications.",
|
"notifications.urlconfigwarning": "Enable PHP 'allow_url_fopen' directive to use Telegram notifications.",
|
||||||
"notifications.check": "Check",
|
"notifications.check": "Check",
|
||||||
"notifications.bot_not_configured": "Bot is not configured",
|
"notifications.bot_not_configured": "Bot is not configured",
|
||||||
"notifications.g_email": "E-Mail",
|
"notifications.h_email": "E-Mail:",
|
||||||
"notifications.h_email": "E-mail:",
|
|
||||||
"notifications.d_email": "Separate multiple addresses with comma.",
|
"notifications.d_email": "Separate multiple addresses with comma.",
|
||||||
"notifications.h_mailfrom": "Mail from:",
|
"notifications.h_mailfrom": "Mail from:",
|
||||||
"notifications.d_mailfrom": "Use this e-mail as sender's address.",
|
"notifications.d_mailfrom": "Use this e-mail as sender's address.",
|
||||||
"notifications.g_telegram": "Telegram",
|
"notifications.h_telegram": "Telegram",
|
||||||
"notifications.h_token": "Bot token:",
|
"notifications.h_token": "Bot token:",
|
||||||
"notifications.d_token": "Telegram Bot API token from @BotFather.",
|
"notifications.d_token": "Telegram Bot API token from @BotFather.",
|
||||||
"notifications.h_active_chats": "Active chats:",
|
"notifications.h_active_chats": "Active chats:",
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,11 @@
|
||||||
"notifications.urlconfigwarning": "Для использования Telegram требуется включить директиву 'allow_url_fopen' в настройках PHP .",
|
"notifications.urlconfigwarning": "Для использования Telegram требуется включить директиву 'allow_url_fopen' в настройках PHP .",
|
||||||
"notifications.check": "Проверить",
|
"notifications.check": "Проверить",
|
||||||
"notifications.bot_not_configured": "Бот не настроен",
|
"notifications.bot_not_configured": "Бот не настроен",
|
||||||
"notifications.g_email": "E-Mail",
|
"notifications.h_email": "E-Mail:",
|
||||||
"notifications.h_email": "E-mail:",
|
|
||||||
"notifications.d_email": "Разделите несколько адресов c помощью запятой.",
|
"notifications.d_email": "Разделите несколько адресов c помощью запятой.",
|
||||||
"notifications.h_mailfrom": "Адрес отправителя:",
|
"notifications.h_mailfrom": "Адрес отправителя:",
|
||||||
"notifications.d_mailfrom": "Этот адрес будет указан как адрес отправителя в письмах с уведомлениями.",
|
"notifications.d_mailfrom": "Этот адрес будет указан как адрес отправителя в письмах с уведомлениями.",
|
||||||
"notifications.g_telegram": "Telegram",
|
"notifications.h_telegram": "Telegram",
|
||||||
"notifications.h_token": "Токен для бота:",
|
"notifications.h_token": "Токен для бота:",
|
||||||
"notifications.d_token": "Токен для телеграм-бота, полученный от @BotFather.",
|
"notifications.d_token": "Токен для телеграм-бота, полученный от @BotFather.",
|
||||||
"notifications.h_active_chats": "Активные чаты:",
|
"notifications.h_active_chats": "Активные чаты:",
|
||||||
|
|
|
||||||
|
|
@ -113,11 +113,6 @@ class NotificationsExtension extends MTTExtension implements MTTHttpApiExtender,
|
||||||
return
|
return
|
||||||
<<<EOD
|
<<<EOD
|
||||||
$warning
|
$warning
|
||||||
|
|
||||||
<div class="tr group-header">
|
|
||||||
<div class="th"> {$e('notifications.g_email')} </div>
|
|
||||||
</div>
|
|
||||||
<div class="group">
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="th"> {$e('notifications.h_email')}
|
<div class="th"> {$e('notifications.h_email')}
|
||||||
<div class="descr">{$e('notifications.d_email')}</div>
|
<div class="descr">{$e('notifications.d_email')}</div>
|
||||||
|
|
@ -130,12 +125,9 @@ $warning
|
||||||
</div>
|
</div>
|
||||||
<div class="td"> <input name="mailfrom" value="$mailfrom" class="in350" autocomplete="email" placeholder="$mailfromDefault"> </div>
|
<div class="td"> <input name="mailfrom" value="$mailfrom" class="in350" autocomplete="email" placeholder="$mailfromDefault"> </div>
|
||||||
</div>
|
</div>
|
||||||
</div><!--/group-->
|
<div class="tr">
|
||||||
|
<div class="th"> {$e('notifications.h_telegram')} </div>
|
||||||
<div class="tr group-header">
|
|
||||||
<div class="th"> {$e('notifications.g_telegram')} </div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="group">
|
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="th"> {$e('notifications.h_token')}
|
<div class="th"> {$e('notifications.h_token')}
|
||||||
<div class="descr">{$e('notifications.d_token')}</div>
|
<div class="descr">{$e('notifications.d_token')}</div>
|
||||||
|
|
@ -154,7 +146,6 @@ $warning
|
||||||
</div>
|
</div>
|
||||||
<div class="td"> $newChat </div>
|
<div class="td"> $newChat </div>
|
||||||
</div>
|
</div>
|
||||||
</div><!--/group-->
|
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue