Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support File Templates - to replace Stationery from Thunderbird 68 forward #8

Closed
RealRaven2000 opened this issue Aug 27, 2019 · 13 comments
Assignees

Comments

@RealRaven2000
Copy link
Owner

@RealRaven2000 RealRaven2000 commented Aug 27, 2019

SmartTemplate⁴ needs to support external HTML files in a similar fashion as is currently supported via the Stationery Add-on. This means I need to build UI for managing external file lists for write, reply and forward and integrate them with the appropriate buttons (dropdowns like in Stationery would be ideal, as they only require a single click to be activated)

@RealRaven2000 RealRaven2000 self-assigned this Aug 27, 2019
@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Aug 27, 2019

Since this UI is fairly familiar to my users, I decided to integrate the management part into the (left-hand side of) the SmartTemplate⁴ Settings dialog, as the second choice in the "Account" drop-down, below the "Common" entry but before any identity specific items.

image

I copied some of the UI elements I used in my Add-on "Menu On Top" which has a customizable bookmark menu. This makes it possible to add / remove / rename items and also to reorder items in the list - I may add an "alphanumeric sort" feature in the future.

every entry has 2 attributes: full file path (load files only, but may support UNC) and title. I might add some "magic" by parsing the <title> element when opening a new file.

There will be 3 independent, seperate lists for write / reply / forward. Clicking an entry will copy it to the edit fields below; this can also be used for transferring from one tab to another by then clicking the "Add" button.

@RealRaven2000 RealRaven2000 pinned this issue Aug 27, 2019
@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Aug 29, 2019

Here is a first preview version, just adding the management UI - it currently stores a file (smartTemplates.json) in the Profile/extension folder, which stores 3 separate lists:
(templatesNew, templatesRsp, templatedFwd) which contain references to template files. My next step will be the integration with the write button and the loading code, then reply & forward integration. 2.3 prerelease 95: smartTemplate-fx-2.3pre95.zip

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Aug 30, 2019

Here is a new version to try out - 2.3 prerelease 142. I have managed to plumb in code that attaches items to the write and forward button, but only in Thunderbird 68 because that already has the necessary dropdown. My next task is adding the dropdown elements when it is not present (namely for the reply button and for all buttons in THunderbird 60) - then we will finally have a truly useable prototype.

smartTemplate-fx-2.3pre142.zip

here is a screenshot of the integration taken in Thunderbird 68 release:

image

PS: don't forget to activate the following in about:config 👍

extensions.smartTemplate4.fileTemplates = true

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Aug 31, 2019

I added support to the "Reply" and "Forward" buttons, the click events are a little confusing right now. Here is the latest version, 2.3 prerelease 168:

smartTemplate-fx-2.3pre168.zip

Don't forget to activate the following in about:config:
extensions.smartTemplate4.fileTemplates = true

PPS: the releases increasing from 95 through 142 to 168 are real. There's a lot of trial and error with this one. Also I only tested in Thunderbird 68 (because that's where we lose support from Stationery) - I may well add compatibility in Tb 60 later.

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Sep 2, 2019

Latest trial version: prerelease 180, This one doesn't need the about:config switch anymore. Also added an icon on the menu items (when hovering). When Stationery is also enabled my links are added "on top" unfortunately the divider, too, so there are 2 dividers (one from ST4 and one from Stationery). Ultimately the idea is to uninstall Stationery anyway.

smartTemplate-fx-2.3pre180.zip

to do:

  • also support the buttons in the header bar, like Stationery already does.
  • add the "reply" template list to the "reply all" button
  • add an item "select Smart Template file..." at the bottom to do ad-hoc selection from disk (this could suggest adding a non-existing item to the menu permanently, with "don't show message again" option)
@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Sep 6, 2019

Next Milestone (prerelease 215) - this includes:

  • modifying header buttons
  • supports reply all button (to test)
  • added a menu item "Open SmartTemplate⁴ file template..." item at the end
  • better handling of separators. This in Tb 60 this even works when Stationery is also loaded and configured to add its own items.

smartTemplate-fx-2.3pre215.zip

I am also restricting the number of useable items to three if no license is found.

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Sep 12, 2019

Fixed some regressions connected to identities, here is the latest trial version:
smartTemplate-fx-2.3pre251.zip

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Sep 16, 2019

Closing as complete with release 2.3 16/09/2019

@ygoe

This comment has been minimized.

Copy link

@ygoe ygoe commented Oct 27, 2019

Coming from the now abandoned Stationery repository, looking for a replacement for Thunderbird 68. I did use SmartTemplate in the past but found a simpler and more stable alternative for my needs, Reply with header. So I just need something that can load my CSS into every new message I write. Are you aware of alternatives that do just that? I don't need all the other features of SmartTemplate.

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Oct 27, 2019

Coming from the now abandoned Stationery repository, looking for a replacement for Thunderbird 68. I did use SmartTemplate in the past but found a simpler and more stable alternative for my needs, Reply with header. So I just need something that can load my CSS into every new message I write. Are you aware of alternatives that do just that? I don't need all the other features of SmartTemplate.

Sorry, no idea. SmartTemplate4 can set headers, too. :) But the main reason to use Stationery was to have a choice of different replies attached to the reply button, this is now possible in SmartTemplate4, too,

@ygoe

This comment has been minimized.

Copy link

@ygoe ygoe commented Oct 27, 2019

I know, but every time SmartTemplate changed the message content, there was additional space around things, the formatting selection was changed (paragraph instead of normal text), there was this "single space" hack, and when I hadn't written anything and closed the compose window, Thunderbird asked me whether I wanted to save my changes. And the configuration is huge, there are dozens of things to adjust. Reply with header runs a lot smoother, without all these disturbances.

I just need something that injects a small CSS fixup into my messages to remove vertical spacing from paragraphs, lists and quotes. They look nice in a typographically totally controlled environment, but when dealing with foreign content in reply messages, that concept fails. Traditionally, there was no such thing a paragraph spacing in e-mails. And there still isn't today. You just have to take Outlook's behaviour as the basis, that's what everybody expects. Here's the CSS for it:

p, ul, ol, blockquote
{
    margin-top: 0;
    margin-bottom: 0;
}

As Thunderbird wants to throw out legacy add-ons support in version 78 around June 2020, a lot of existing extensions will finally disappear. I'm wondering why they have put so much effort in their overlay loader when they're going to remove it again so soon anyway. But that means that I'll have to write some extensions myself where the original authors have disappeared. So I'll probably just create a tiny extension that only inserts this CSS in every HTML message.

@RealRaven2000

This comment has been minimized.

Copy link
Owner Author

@RealRaven2000 RealRaven2000 commented Oct 27, 2019

one hack you may try - why not included a <style> block in the signature?

@ygoe

This comment has been minimized.

Copy link

@ygoe ygoe commented Nov 7, 2019

It does the job but is very fragile. When I remove my signature for less formal messages, the style can easily be removed with it, and then the default styles apply again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.