Make URLs in task titles clickable (#2289)

This commit is contained in:
Thomas Bruederli 2013-10-04 09:37:32 +02:00
parent 777fb89394
commit ed6fd93ac5
2 changed files with 7 additions and 4 deletions

View file

@ -281,7 +281,7 @@ function rcube_libcalendaring(settings)
var mailto_pattern = new RegExp('([^\\s\\n\\(\\);]+@'+utf_domain+')', 'ig'); var mailto_pattern = new RegExp('([^\\s\\n\\(\\);]+@'+utf_domain+')', 'ig');
return html return html
.replace(link_pattern, '<a href="$1$2" target="_blank">$1$2</a>') .replace(link_pattern, '<a href="$1$2" class="extlink" target="_blank">$1$2</a>')
.replace(mailto_pattern, '<a href="mailto:$1">$1</a>') .replace(mailto_pattern, '<a href="mailto:$1">$1</a>')
.replace(/(mailto:)([^"]+)"/g, '$1$2" onclick="rcmail.command(\'compose\', \'$2\');return false"') .replace(/(mailto:)([^"]+)"/g, '$1$2" onclick="rcmail.command(\'compose\', \'$2\');return false"')
.replace(/\n/g, "<br/>"); .replace(/\n/g, "<br/>");

View file

@ -298,6 +298,9 @@ function rcube_tasklist_ui(settings)
e.bubble = false; e.bubble = false;
break; break;
case 'extlink':
return true;
default: default:
if (e.target.nodeName != 'INPUT') if (e.target.nodeName != 'INPUT')
task_show_dialog(id); task_show_dialog(id);
@ -642,7 +645,7 @@ function rcube_tasklist_ui(settings)
'<div class="progressbar"><div class="progressvalue" style="width:' + (rec.complete * 100) + '%"></div></div>' + '<div class="progressbar"><div class="progressvalue" style="width:' + (rec.complete * 100) + '%"></div></div>' +
'<input type="checkbox" name="completed[]" value="1" class="complete" ' + (rec.complete == 1.0 ? 'checked="checked" ' : '') + '/>' + '<input type="checkbox" name="completed[]" value="1" class="complete" ' + (rec.complete == 1.0 ? 'checked="checked" ' : '') + '/>' +
'<span class="flagged"></span>' + '<span class="flagged"></span>' +
'<span class="title">' + Q(rec.title) + '</span>' + '<span class="title">' + text2html(Q(rec.title)) + '</span>' +
'<span class="tags">' + tags_html + '</span>' + '<span class="tags">' + tags_html + '</span>' +
'<span class="date">' + Q(rec.date || rcmail.gettext('nodate','tasklist')) + '</span>' + '<span class="date">' + Q(rec.date || rcmail.gettext('nodate','tasklist')) + '</span>' +
'<a href="#" class="actions">V</a>' '<a href="#" class="actions">V</a>'
@ -908,7 +911,7 @@ function rcube_tasklist_ui(settings)
// fill dialog data // fill dialog data
$('#task-parent-title').html(Q(rec.parent_title || '')+' &raquo;').css('display', rec.parent_title ? 'block' : 'none'); $('#task-parent-title').html(Q(rec.parent_title || '')+' &raquo;').css('display', rec.parent_title ? 'block' : 'none');
$('#task-title').html(Q(rec.title || '')); $('#task-title').html(text2html(Q(rec.title || '')));
$('#task-description').html(text2html(rec.description || '', 300, 6))[(rec.description ? 'show' : 'hide')](); $('#task-description').html(text2html(rec.description || '', 300, 6))[(rec.description ? 'show' : 'hide')]();
$('#task-date')[(rec.date ? 'show' : 'hide')]().children('.task-text').html(Q(rec.date || rcmail.gettext('nodate','tasklist'))); $('#task-date')[(rec.date ? 'show' : 'hide')]().children('.task-text').html(Q(rec.date || rcmail.gettext('nodate','tasklist')));
$('#task-time').html(Q(rec.time || '')); $('#task-time').html(Q(rec.time || ''));