Skip to content
  • Michael Gratton's avatar
    Split composer web view up into multiple parts. · 96ffcdb6
    Michael Gratton authored
    This lets us implement changing signatures and deleting bottom-quoted
    messages without having to reload the whole view, and makes it possible
    to target only the user's content when modifying for send, etc.
    
    * src/client/composer/composer-web-view.vala (ComposerWebView): Move
      composer CSS into composer-web-view.css resource file, load it when
      loading JS resource and add it to the view's user content manager.
      (ComposerWebView::load_html): Split up body, signature and quote into a
      DIV container for each.
      (ComposerWebView::linkify_content): Replaced with ::clean_content,
      which will also tidy up internal markup before sending. Update call
      site and unit test.
    
    * src/engine/rfc822/rfc822-utils.vala (Geary.RFC822.Utils): Remove some
      more obtrusive white space when sending replies/forwards.
    
    * test/client/composer/composer-web-view-test.vala,
      test/js/composer-page-state-test.vala: Update tests to expect new HTML
      and text output from ComposerWebView and use of individual parts for
      composer markup.
    
    * ui/composer-web-view.js (ComposerPageState): Replace messageBody
      property and uses with bodyPart, signaturePart and quotePart. Set these
      content-editable on load. Move listeners from messageBody back to the
      document.body so they also listen for events on the additional
      parts. Keep track of text cursor location within the parts and set a
      class if so, to work around the lack of :focus-inside support.
      (ComposerPageState::updateSignature): Implement by updating the inner
      content of the signature part.
      (ComposerPageState::deleteQuotedMessage): Implement by removing the
      quote part from the DOM tree.
      (ComposerPageState::containsAttachmentKeyword): Consider only the
      bodyPart when scanning for attachments, remove hacks for ignoring the
      signature any any quoted message.
      (ComposerPageState::linkifyContent): Mirror ClientWebView change and
      replace with ::cleanContent. Ensure existing parts have contenteditable
      and focus class removed, remove signature and quote parts if empty.
      (ComposerPageState::getHtml): Generate HTML using clones of the three
      parts, so we can rmeove contenteditable and focus classes without
      modifying the actual DOM.
      (ComposerPageState::selectionChanged): Update focus class on parts as
      needed.
    96ffcdb6