From a9b2ee4f41ec4f2424c928f60ef3b93257b2820a Mon Sep 17 00:00:00 2001 From: marvin78 Date: Tue, 14 Jan 2020 18:15:30 +0000 Subject: [PATCH] 98_todoist: alarm clock icon for due dates in widget git-svn-id: https://svn.fhem.de/fhem/trunk@20977 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/98_todoist.pm | 16 +++++++++++----- fhem/www/pgm2/todoist.js | 11 +++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index c0a7f5723..de61c50e3 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -4,6 +4,7 @@ - feature: 70_ONKYO_AVR: introduced 'set rawCommand' - change: 98_todoist: removed Attribute "sortTasks" / better commandref better move in widget (not delete and add) + alarm clock icon for due dates - change: 93_DbLog: change datetime pattern in valueFn of addCacheLine Forum: #107285 - change: 98_todoist: reorder tasks - widget reorder diff --git a/fhem/FHEM/98_todoist.pm b/fhem/FHEM/98_todoist.pm index 34d8c54ac..4822fa83c 100644 --- a/fhem/FHEM/98_todoist.pm +++ b/fhem/FHEM/98_todoist.pm @@ -17,7 +17,7 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse "; ####################### # Global variables -my $version = "1.3.2"; +my $version = "1.3.3"; my $srandUsed; @@ -2100,7 +2100,10 @@ sub todoist_Html(;$$$) { height: 12px!important; width: 12px!important; } - "; + .todoist_dueDateButton svg { + margin-top:-2px!important; + } + "; if (!$detail) { $rot.=" .todoist_table { @@ -2164,16 +2167,19 @@ sub todoist_Html(;$$$) { my $ind=0; - + my $dueDate = defined($hash->{helper}{DUE_DATE}{$_})?$hash->{helper}{DUE_DATE}{$_}:""; - $ret .= "{PID}."\" data-line-id=\"".$_."\" class=\"sortit todoist_data ".$eo."\">\n". + my $dueDateClass = $dueDate!=""?" todoist_dueDate":""; + + $ret .= "{PID}."\" data-line-id=\"".$_."\" class=\"sortit todoist_data ".$eo."\">\n". " \n". "
\n". " {'check'}."\" class=\"todoist_checkbox_".$name."\" type=\"checkbox\" id=\"check_".$_."\" data-id=\"".$_."\" />\n". " \n". - " \n". + " \n". " ".$hash->{helper}{TITLE}{$_}."\n". " {helper}{TITLE}{$_}."\" />\n". + "
". " \n"; $ret .= "\n". diff --git a/fhem/www/pgm2/todoist.js b/fhem/www/pgm2/todoist.js index d6fa684d9..d04b9d6c4 100644 --- a/fhem/www/pgm2/todoist.js +++ b/fhem/www/pgm2/todoist.js @@ -13,8 +13,9 @@ if (typeof todoist_checkVar === 'undefined') { var todoist_svgPrefix=''; - todoist_icon.del=todoist_svgPrefix+'d="M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm416 56v324c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V140c0-6.6 5.4-12 12-12h360c6.6 0 12 5.4 12 12zm-272 68c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208z"/>'; + todoist_icon.alarm = todoist_svgPrefix+'d="M 225.68,131.09 C 225.68,131.09 193.65,131.09 193.65,131.09 193.65,131.09 193.65,259.20 193.65,259.20 193.65,259.20 294.96,320.15 294.96,320.15 294.96,320.15 311.08,293.78 311.08,293.78 311.08,293.78 225.68,243.18 225.68,243.18 225.68,243.18 225.68,131.09 225.68,131.09 Z M 214.89,45.69 C 108.67,45.69 22.85,131.73 22.85,237.84 22.85,343.96 108.67,430.00 214.89,430.00 321.11,430.00 407.16,343.96 407.16,237.84 407.16,131.73 321.11,45.69 214.89,45.69 Z M 215.00,387.30 C 132.48,387.30 65.55,320.37 65.55,237.85 65.55,155.33 132.48,88.39 215.00,88.39 297.52,88.39 364.45,155.33 364.45,237.84 364.45,320.36 297.63,387.30 215.00,387.30 Z M 428.51,82.41 C 428.51,82.41 330.40,0.11 330.40,0.11 330.40,0.11 302.96,32.77 302.96,32.77 302.96,32.77 401.07,115.08 401.07,115.08 401.07,115.08 428.51,82.41 428.51,82.41 Z M 127.04,32.67 C 127.04,32.67 99.60,0.00 99.60,0.00 99.60,0.00 1.49,82.31 1.49,82.31 1.49,82.31 28.93,114.97 28.93,114.97 28.93,114.97 127.04,32.67 127.04,32.67 Z"/>'; + todoist_icon.ref = todoist_svgPrefix+'d="M440.935 12.574l3.966 82.766C399.416 41.904 331.674 8 256 8 134.813 8 33.933 94.924 12.296 209.824 10.908 217.193 16.604 224 24.103 224h49.084c5.57 0 10.377-3.842 11.676-9.259C103.407 137.408 172.931 80 256 80c60.893 0 114.512 30.856 146.104 77.801l-101.53-4.865c-6.845-.328-12.574 5.133-12.574 11.986v47.411c0 6.627 5.373 12 12 12h200.333c6.627 0 12-5.373 12-12V12c0-6.627-5.373-12-12-12h-47.411c-6.853 0-12.315 5.729-11.987 12.574zM256 432c-60.895 0-114.517-30.858-146.109-77.805l101.868 4.871c6.845.327 12.573-5.134 12.573-11.986v-47.412c0-6.627-5.373-12-12-12H12c-6.627 0-12 5.373-12 12V500c0 6.627 5.373 12 12 12h47.385c6.863 0 12.328-5.745 11.985-12.599l-4.129-82.575C112.725 470.166 180.405 504 256 504c121.187 0 222.067-86.924 243.704-201.824 1.388-7.369-4.308-14.176-11.807-14.176h-49.084c-5.57 0-10.377 3.842-11.676 9.259C408.593 374.592 339.069 432 256 432z"/>'; + todoist_icon.del = todoist_svgPrefix+'d="M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm416 56v324c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V140c0-6.6 5.4-12 12-12h360c6.6 0 12 5.4 12 12zm-272 68c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208zm96 0c0-8.8-7.2-16-16-16s-16 7.2-16 16v224c0 8.8 7.2 16 16 16s16-7.2 16-16V208z"/>'; todoist_icon.loading=''; function todoist_encodeParm(oldVal) { @@ -127,6 +128,7 @@ if (typeof todoist_checkVar === 'undefined') { function todoist_removeLoading(name) { $('.todoist_devType_' + name).find('.todoist_loadingDiv').remove(); + todoist_addAlarmClock(); } function todoist_ErrorDialog(name,text,title) { @@ -204,10 +206,15 @@ if (typeof todoist_checkVar === 'undefined') { $("
").appendTo($('.todoist_devType')).html(todoist_icon.ref); $("
").appendTo($('.todoist_devType')).html(todoist_icon.del); } + + function todoist_addAlarmClock() { + $('td.todoist_dueDate .todoist_dueDateButton').html(todoist_icon.alarm); + } $(document).ready(function(){ todoist_getSizes(); todoist_addHeaders(); + todoist_addAlarmClock(); $('.todoist_name').each(function() { var name = $(this).val(); todoist_refreshTable(name);