Skip to content

Commit

Permalink
+ add setting for counter of new tasks (disabled by default) (2 strin…
Browse files Browse the repository at this point in the history
…gs added for translation)
  • Loading branch information
maxpozdeev committed Jan 23, 2024
1 parent 34e8421 commit 80de4b7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/content/mytinytodo.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var mytinytodo = window.mytinytodo = _mtt = {
history: true,
markdown: true,
viewTaskOnClick: false,
newTaskCounter: true,
newTaskCounter: false,
},

timers: {
Expand Down
3 changes: 3 additions & 0 deletions src/includes/class.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class Config
# Appearance: system default or always light
'appearance' => array('default'=>'system', 'type'=>'s', 'options'=>array('system','light','dark')),

# New tasks counter
'newTaskCounter' => array('default' => 0, 'type'=>'i'),

# Array of activated extensions
'extensions' => array('default'=>[], 'type'=>'a')
);
Expand Down
6 changes: 4 additions & 2 deletions src/includes/lang/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_header": {
"ver": "v1.8",
"date": "2023-09-08",
"ver": "v1.8.1",
"date": "2024-01-23",
"language": "English",
"original_name": "English",
"author": "Max Pozdeev",
Expand Down Expand Up @@ -189,6 +189,8 @@
"set_appearance_system": "Same as system",
"set_appearance_light": "Light",
"set_appearance_dark": "Dark",
"set_newtaskcounter_h": "New tasks counter",
"set_newtaskcounter": "Check for new tasks",
"set_extensions": "Extensions",
"set_activate": "Activate",
"set_deactivate": "Deactivate",
Expand Down
6 changes: 4 additions & 2 deletions src/includes/lang/ru.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_header": {
"ver": "v1.8",
"date": "2023-09-08",
"ver": "v1.8.1",
"date": "2024-01-23",
"language": "Russian",
"original_name": "Русский",
"author": "Max Pozdeev",
Expand Down Expand Up @@ -189,6 +189,8 @@
"set_appearance_system": "Как в системе",
"set_appearance_light": "Светлая",
"set_appearance_dark": "Тёмная",
"set_newtaskcounter_h": "Счетчик новых задач",
"set_newtaskcounter": "Проверять наличие новых задач",
"set_extensions": "Дополнения",
"set_activate": "Активировать",
"set_deactivate": "Деактивировать",
Expand Down
3 changes: 2 additions & 1 deletion src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ function js_options()
"firstdayofweek" => (int) Config::get('firstdayofweek'),
"calendarIcon" => get_mttinfo('theme_url'). 'images/calendar.svg',
"autotag" => Config::get('autotag') ? true : false,
"markdown" => Config::get('markup') == 'v1' ? false : true
"markdown" => Config::get('markup') == 'v1' ? false : true,
"newTaskCounter" => Config::get('newTaskCounter') ? true : false,
);
$json = json_encode($a, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_INVALID_UTF8_SUBSTITUTE);
if ($json === false) {
Expand Down
6 changes: 6 additions & 0 deletions src/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
Config::set('showdateInline', (int)_post('showdateInline'));
Config::set('exactduedate', (int)_post('exactduedate'));
Config::set('appearance', removeNewLines(trim(_post('appearance'))) );
Config::set('newTaskCounter', (int)_post('newTaskCounter'));
Config::save();
$t['saved'] = 1;
jsonExit($t);
Expand Down Expand Up @@ -384,6 +385,11 @@ function listExtensions()
</div>
</div>

<div class="tr">
<div class="th"><?php _e('set_newtaskcounter_h');?>:</div>
<div class="td"><label><input type="checkbox" name="newTaskCounter" value="1" <?php if(_c('newTaskCounter')) echo 'checked="checked"'; ?> /> <?php _e('set_newtaskcounter');?></label></div>
</div>

<?php
if (!defined('MTT_DISABLE_EXT')) {
?>
Expand Down

0 comments on commit 80de4b7

Please sign in to comment.