diff --git a/src/content/mytinytodo.js b/src/content/mytinytodo.js index 1232cce..ac1bd50 100644 --- a/src/content/mytinytodo.js +++ b/src/content/mytinytodo.js @@ -70,6 +70,8 @@ var mytinytodo = window.mytinytodo = _mtt = { tagPreviewDelay: 700, //milliseconds ajaxAnimationDelay: 200, saveShowNotes: false, + showdate: false, + showdateInline: false, firstdayofweek: 1, touchDevice: false, calendarIcon: 'calendar.png', // need themeUrl+icon @@ -180,7 +182,10 @@ var mytinytodo = window.mytinytodo = _mtt = { flag.isLogged = options.isLogged ? true : false; if (this.options.showdate) { - $('#mtt').addClass('show-inline-date'); + $('#mtt').addClass('show-date'); + } + if (this.options.showdateInline) { + $('#mtt').addClass('date-inline'); } // handlers @@ -1204,8 +1209,8 @@ _mtt.prepareTaskStr = prepareTaskStr; function prepareTaskBlocks(item) { - var id = item.id; - var markdown = ''; + const id = item.id; + let markdown = ''; if (_mtt.options.markdown == true) markdown = 'markdown-note'; return '' + '
' + @@ -1221,12 +1226,10 @@ function prepareTaskBlocks(item) '' + prepareTaskTitleInlineHtml(item.title) + ' ' + (curList.id == -1 ? ''+ tabLists.get(item.listId).name +'' : '') + '' + prepareTagsStr(item) + '' + + '' + prepareInlineDate(item) + '' + '
' + '
' + prepareDueDate(item) + "
" + '' + - '
' + - prepareInlineDate(item) + - '
' + "" + '
' + @@ -1273,6 +1276,7 @@ function prepareTagsStr(item, delimiter = ', ') if (!a.length) return ''; const b = item.tags_ids.split(',') for (let i in a) { + // tag is escaped a[i] = ''+a[i]+''; } return a.join(delimiter); diff --git a/src/content/theme/style.css b/src/content/theme/style.css index 9fa94f0..2da8970 100644 --- a/src/content/theme/style.css +++ b/src/content/theme/style.css @@ -652,7 +652,13 @@ li.task-row.task-expanded .task-toggle { transform:rotate(90deg); } .task-id { /*display: none;*/ } -#mtt.show-inline-date .task-date { display: block; } +#mtt.show-date .task-date { + display: block; +} +#mtt.show-date.date-inline .task-date { + display: inline; + margin-left:3px; +} .task-through { overflow:hidden; flex-grow:1; } #mtt.view-task-on-click .task-title { cursor: pointer; @@ -670,7 +676,10 @@ li.task-row.task-expanded .task-toggle { transform:rotate(90deg); } padding: 0px 3px; margin: 0px 2px; } -.task-tags { padding:0px 2px; } +.task-tags { + margin:0px 3px; + display: inline-block; /* for RTL */ +} .task-tags .tag { font-size:0.9rem; font-weight:bold; diff --git a/src/includes/class.config.php b/src/includes/class.config.php index bb3c82c..aa2baeb 100644 --- a/src/includes/class.config.php +++ b/src/includes/class.config.php @@ -81,6 +81,7 @@ class Config # Show task date in list 'showdate' => array('default'=>0, 'type'=>'i'), 'showtime' => array('default'=>0, 'type'=>'i'), + 'showdateInline' => array('default'=>0, 'type'=>'i'), 'exactduedate' => array('default'=>0, 'type'=>'i'), # Use Markdown syntax for notes. Set to 'v1' to use old v1.6 syntax. diff --git a/src/includes/lang/en.json b/src/includes/lang/en.json index bf835ce..11b15af 100644 --- a/src/includes/lang/en.json +++ b/src/includes/lang/en.json @@ -183,6 +183,7 @@ "set_cancel": "Cancel", "set_showdate": "Show task date in list", "set_showtime": "Show time", + "set_showdate_inline": "Show date inline", "set_exactduedate": "Always show due date as a date", "set_appearance": "Appearance", "set_appearance_system": "Same as system", diff --git a/src/includes/lang/ru.json b/src/includes/lang/ru.json index e9e4b47..c77b6e8 100644 --- a/src/includes/lang/ru.json +++ b/src/includes/lang/ru.json @@ -183,6 +183,7 @@ "set_cancel": "Отмена", "set_showdate": "Показывать дату создания задачи", "set_showtime": "Показывать время", + "set_showdate_inline": "В той же строке", "set_exactduedate": "Показывать срок исполнения всегда датой", "set_appearance": "Тема оформления", "set_appearance_system": "Как в системе", diff --git a/src/index.php b/src/index.php index a87bdaa..6391dad 100644 --- a/src/index.php +++ b/src/index.php @@ -89,6 +89,7 @@ function js_options() "isLogged" => is_logged() ? true : false, "showdate" => Config::get('showdate') ? true : false, "showtime" => Config::get('showtime') ? true : false, + "showdateInline" => Config::get('showdateInline') ? true : false, "duedatepickerformat" => htmlspecialchars(Config::get('dateformat2')), "firstdayofweek" => (int) Config::get('firstdayofweek'), "calendarIcon" => get_mttinfo('theme_url'). 'images/calendar.svg', diff --git a/src/settings.php b/src/settings.php index c1c9337..34b5ffb 100644 --- a/src/settings.php +++ b/src/settings.php @@ -52,6 +52,7 @@ if(isset($_POST['save'])) Config::set('title', removeNewLines(trim(_post('title'))) ); Config::set('showdate', (int)_post('showdate')); Config::set('showtime', (int)_post('showtime')); + Config::set('showdateInline', (int)_post('showdateInline')); Config::set('exactduedate', (int)_post('exactduedate')); Config::set('appearance', removeNewLines(trim(_post('appearance'))) ); Config::save(); @@ -360,8 +361,9 @@ header('Content-type:text/html; charset=utf-8');
:
-
-
+
+
+