comparison plugins/calendar/calendar_ui.js @ 12:ff1f27bd05ad

partial success in getting back_link to message when making event from mail
author Charlie Root
date Sat, 13 Jan 2018 09:39:32 -0500
parents f6fe4b6ae66a
children 3bd5fe8166b8
comparison
equal deleted inserted replaced
11:d57f154e7764 12:ff1f27bd05ad
397 $('#event-title').html(Q(event.title)).show(); 397 $('#event-title').html(Q(event.title)).show();
398 398
399 if (event.location) 399 if (event.location)
400 $('#event-location').html('@ ' + text2html(event.location)).show(); 400 $('#event-location').html('@ ' + text2html(event.location)).show();
401 if (event.description) 401 if (event.description)
402 $('#event-description').show().children('.event-text').html(text2html(event.description, 300, 6)); 402 $('#event-description').show().html(event.description);
403 //children('.event-text').html(text2html(event.description, 300, 6));
403 if (event.vurl) 404 if (event.vurl)
404 $('#event-url').show().children('.event-text').html(render_link(event.vurl)); 405 $('#event-url').show().children('.event-text').html(render_link(event.vurl));
405 406
406 // render from-to in a nice human-readable way 407 // render from-to in a nice human-readable way
407 // -> now shown in dialog title 408 // -> now shown in dialog title
668 rcmail.triggerEvent('calendar-event-init', {o: event}); 669 rcmail.triggerEvent('calendar-event-init', {o: event});
669 670
670 // event details 671 // event details
671 var title = $('#edit-title').val(event.title || ''); 672 var title = $('#edit-title').val(event.title || '');
672 var location = $('#edit-location').val(event.location || ''); 673 var location = $('#edit-location').val(event.location || '');
673 var description = $('#edit-description').text(event.description || '');
674 var vurl = $('#edit-url').val(event.vurl || ''); 674 var vurl = $('#edit-url').val(event.vurl || '');
675 var categories = $('#edit-categories').val(event.categories); 675 var categories = $('#edit-categories').val(event.categories);
676 var calendars = $('#edit-calendar').val(event.calendar); 676 var calendars = $('#edit-calendar').val(event.calendar);
677 var eventstatus = $('#edit-event-status').val(event.status); 677 var eventstatus = $('#edit-event-status').val(event.status);
678 var freebusy = $('#edit-free-busy').val(event.free_busy); 678 var freebusy = $('#edit-free-busy').val(event.free_busy);
720 // check categories drop-down: add value if not exists 720 // check categories drop-down: add value if not exists
721 if (event.categories && !categories.find("option[value='"+event.categories+"']").length) { 721 if (event.categories && !categories.find("option[value='"+event.categories+"']").length) {
722 $('<option>').attr('value', event.categories).text(event.categories).appendTo(categories).prop('selected', true); 722 $('<option>').attr('value', event.categories).text(event.categories).appendTo(categories).prop('selected', true);
723 } 723 }
724 724
725 var description;
725 if ($.isArray(event.links) && event.links.length) { 726 if ($.isArray(event.links) && event.links.length) {
726 render_message_links(event.links, $('#edit-event-links .event-text'), true, 'calendar'); 727 render_message_links(event.links, $('#edit-event-links .event-text'), true, 'calendar');
727 $('#edit-event-links').show(); 728 // hack! database_driver doesn't save the links property :-(
729 description = $('#edit-description').html("<div><a href='"+event.links[0].mailurl+"'>"+event.links[0].subject+"</a>\n<textarea class='text' rows='5' cols='40'>"+(event.description || '')+"</textarea></div>");
730 $('#edit-event-links').show();
728 } 731 }
729 else { 732 else {
730 $('#edit-event-links').hide(); 733 description = $('#edit-description').html("<div><textarea class='text' rows='5' cols='40'>"+(event.description || '')+"</textarea></div>");
734 $('#edit-event-links').hide();
731 } 735 }
732 736
733 // show warning if editing a recurring event 737 // show warning if editing a recurring event
734 if (event.id && event.recurrence) { 738 if (event.id && event.recurrence) {
735 var sel = event._savemode || (event.thisandfuture ? 'future' : (event.isexception ? 'current' : 'all')); 739 var sel = event._savemode || (event.thisandfuture ? 'future' : (event.isexception ? 'current' : 'all'));
834 calendar: event.calendar, 838 calendar: event.calendar,
835 start: date2servertime(start), 839 start: date2servertime(start),
836 end: date2servertime(end), 840 end: date2servertime(end),
837 allday: allday.checked?1:0, 841 allday: allday.checked?1:0,
838 title: title.val(), 842 title: title.val(),
839 description: description.val(), 843 description: description.html(),
840 location: location.val(), 844 location: location.val(),
841 categories: categories.val(), 845 categories: categories.val(),
842 vurl: vurl.val(), 846 vurl: vurl.val(),
843 free_busy: freebusy.val(), 847 free_busy: freebusy.val(),
844 priority: priority.val(), 848 priority: priority.val(),