mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
da15d4598c
Summary: Changes the internal signatures plugin to wrap the signature in a `<div class="nylas-n1-signature">` block, to make it easier to detect and handle signatures from within other plugins. Also: - Fixes the QuickSchedule plugin to place the scheduling block above the signature. - Fixes a small syntax error in Translate plugin Test Plan: manual Reviewers: evan Reviewed By: evan Differential Revision: https://phab.nylas.com/D2383
14 lines
620 B
CoffeeScript
14 lines
620 B
CoffeeScript
{ComposerExtension, AccountStore} = require 'nylas-exports'
|
|
|
|
class SignatureComposerExtension extends ComposerExtension
|
|
@prepareNewDraft: (draft) ->
|
|
accountId = AccountStore.current().id
|
|
signature = NylasEnv.config.get("nylas.account-#{accountId}.signature")
|
|
return unless signature
|
|
|
|
insertionPoint = draft.body.indexOf('<blockquote')
|
|
if insertionPoint is -1
|
|
insertionPoint = draft.body.length
|
|
draft.body = draft.body.slice(0, insertionPoint) + '<br/><div class="nylas-n1-signature">' + signature + "</div>" + draft.body.slice(insertionPoint)
|
|
|
|
module.exports = SignatureComposerExtension
|