2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

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
This commit is contained in:
marvin78 2020-01-14 18:15:30 +00:00
parent b594d80af6
commit a9b2ee4f41
3 changed files with 21 additions and 7 deletions

View File

@ -4,6 +4,7 @@
- feature: 70_ONKYO_AVR: introduced 'set rawCommand' - feature: 70_ONKYO_AVR: introduced 'set rawCommand'
- change: 98_todoist: removed Attribute "sortTasks" / better commandref - change: 98_todoist: removed Attribute "sortTasks" / better commandref
better move in widget (not delete and add) better move in widget (not delete and add)
alarm clock icon for due dates
- change: 93_DbLog: change datetime pattern in valueFn of addCacheLine - change: 93_DbLog: change datetime pattern in valueFn of addCacheLine
Forum: #107285 Forum: #107285
- change: 98_todoist: reorder tasks - widget reorder - change: 98_todoist: reorder tasks - widget reorder

View File

@ -17,7 +17,7 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse ";
####################### #######################
# Global variables # Global variables
my $version = "1.3.2"; my $version = "1.3.3";
my $srandUsed; my $srandUsed;
@ -2100,6 +2100,9 @@ sub todoist_Html(;$$$) {
height: 12px!important; height: 12px!important;
width: 12px!important; width: 12px!important;
} }
.todoist_dueDateButton svg {
margin-top:-2px!important;
}
"; ";
if (!$detail) { if (!$detail) {
@ -2164,16 +2167,19 @@ sub todoist_Html(;$$$) {
my $ind=0; my $ind=0;
my $dueDate = defined($hash->{helper}{DUE_DATE}{$_})?$hash->{helper}{DUE_DATE}{$_}:"";
my $dueDateClass = $dueDate!=""?" todoist_dueDate":"";
$ret .= "<tr id=\"".$name."_".$_."\" data-data=\"true\" data-project-name=\"".$name."\" data-project-id=\"".$hash->{PID}."\" data-line-id=\"".$_."\" class=\"sortit todoist_data ".$eo."\">\n". $ret .= "<tr id=\"".$name."_".$_."\" data-due-date=\"".$dueDate."\" data-data=\"true\" data-project-name=\"".$name."\" data-project-id=\"".$hash->{PID}."\" data-line-id=\"".$_."\" class=\"sortit todoist_data ".$eo."\">\n".
" <td class=\"col1 todoist_col1\">\n". " <td class=\"col1 todoist_col1\">\n".
" <div class=\"todoist_move\"></div>\n". " <div class=\"todoist_move\"></div>\n".
" <input title=\"".$todoist_tt->{'check'}."\" class=\"todoist_checkbox_".$name."\" type=\"checkbox\" id=\"check_".$_."\" data-id=\"".$_."\" />\n". " <input title=\"".$todoist_tt->{'check'}."\" class=\"todoist_checkbox_".$name."\" type=\"checkbox\" id=\"check_".$_."\" data-id=\"".$_."\" />\n".
" </td>\n". " </td>\n".
" <td class=\"col1 todoist_input\">\n". " <td class=\"col1 todoist_input".$dueDateClass."\">\n".
" <span class=\"todoist_task_text\" data-id=\"".$_."\">".$hash->{helper}{TITLE}{$_}."</span>\n". " <span class=\"todoist_task_text\" data-id=\"".$_."\">".$hash->{helper}{TITLE}{$_}."</span>\n".
" <input type=\"text\" data-id=\"".$_."\" style=\"display:none;\" class=\"todoist_input_".$name."\" value=\"".$hash->{helper}{TITLE}{$_}."\" />\n". " <input type=\"text\" data-id=\"".$_."\" style=\"display:none;\" class=\"todoist_input_".$name."\" value=\"".$hash->{helper}{TITLE}{$_}."\" />\n".
" <div class='todoist_dueDateButton todoist_icon' title='".$dueDate."'> </div>".
" </td>\n"; " </td>\n";
$ret .= "<td class=\"col2 todoist_delete\">\n". $ret .= "<td class=\"col2 todoist_delete\">\n".

View File

@ -13,8 +13,9 @@ if (typeof todoist_checkVar === 'undefined') {
var todoist_svgPrefix='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path '; var todoist_svgPrefix='<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path ';
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"/></svg>'; 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"/></svg>';
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"/></svg>'; 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"/></svg>';
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"/></svg>';
todoist_icon.loading='<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" viewBox="0 0 128 128" xml:space="preserve"><g transform="rotate(-32.1269 64 64)"><path d="M78.75 16.18V1.56a64.1 64.1 0 0 1 47.7 47.7H111.8a49.98 49.98 0 0 0-33.07-33.08zM16.43 49.25H1.8a64.1 64.1 0 0 1 47.7-47.7V16.2a49.98 49.98 0 0 0-33.07 33.07zm33.07 62.32v14.62A64.1 64.1 0 0 1 1.8 78.5h14.63a49.98 49.98 0 0 0 33.07 33.07zm62.32-33.07h14.62a64.1 64.1 0 0 1-47.7 47.7v-14.63a49.98 49.98 0 0 0 33.08-33.07z" fill-opacity="1"/><animateTransform attributeName="transform" type="rotate" from="0 64 64" to="-90 64 64" dur="1800ms" repeatCount="indefinite"/></g></svg>'; todoist_icon.loading='<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" viewBox="0 0 128 128" xml:space="preserve"><g transform="rotate(-32.1269 64 64)"><path d="M78.75 16.18V1.56a64.1 64.1 0 0 1 47.7 47.7H111.8a49.98 49.98 0 0 0-33.07-33.08zM16.43 49.25H1.8a64.1 64.1 0 0 1 47.7-47.7V16.2a49.98 49.98 0 0 0-33.07 33.07zm33.07 62.32v14.62A64.1 64.1 0 0 1 1.8 78.5h14.63a49.98 49.98 0 0 0 33.07 33.07zm62.32-33.07h14.62a64.1 64.1 0 0 1-47.7 47.7v-14.63a49.98 49.98 0 0 0 33.08-33.07z" fill-opacity="1"/><animateTransform attributeName="transform" type="rotate" from="0 64 64" to="-90 64 64" dur="1800ms" repeatCount="indefinite"/></g></svg>';
function todoist_encodeParm(oldVal) { function todoist_encodeParm(oldVal) {
@ -127,6 +128,7 @@ if (typeof todoist_checkVar === 'undefined') {
function todoist_removeLoading(name) { function todoist_removeLoading(name) {
$('.todoist_devType_' + name).find('.todoist_loadingDiv').remove(); $('.todoist_devType_' + name).find('.todoist_loadingDiv').remove();
todoist_addAlarmClock();
} }
function todoist_ErrorDialog(name,text,title) { function todoist_ErrorDialog(name,text,title) {
@ -205,9 +207,14 @@ if (typeof todoist_checkVar === 'undefined') {
$("<div class='todoist_deleteAll todoist_icon' title='" + todoist_tt.clearList + "'> </div>").appendTo($('.todoist_devType')).html(todoist_icon.del); $("<div class='todoist_deleteAll todoist_icon' title='" + todoist_tt.clearList + "'> </div>").appendTo($('.todoist_devType')).html(todoist_icon.del);
} }
function todoist_addAlarmClock() {
$('td.todoist_dueDate .todoist_dueDateButton').html(todoist_icon.alarm);
}
$(document).ready(function(){ $(document).ready(function(){
todoist_getSizes(); todoist_getSizes();
todoist_addHeaders(); todoist_addHeaders();
todoist_addAlarmClock();
$('.todoist_name').each(function() { $('.todoist_name').each(function() {
var name = $(this).val(); var name = $(this).val();
todoist_refreshTable(name); todoist_refreshTable(name);