2016-05-07 07:23:48 +08:00
|
|
|
/* eslint global-require: 0 */
|
2015-12-05 14:09:25 +08:00
|
|
|
import {PreferencesUIStore, ComponentRegistry, ExtensionRegistry} from 'nylas-exports';
|
2015-11-12 04:49:48 +08:00
|
|
|
import TemplatePicker from './template-picker';
|
|
|
|
import TemplateStatusBar from './template-status-bar';
|
2015-12-05 14:09:25 +08:00
|
|
|
import TemplateComposerExtension from './template-composer-extension';
|
2015-11-12 04:49:48 +08:00
|
|
|
|
2016-03-01 10:47:22 +08:00
|
|
|
export function activate(state = {}) {
|
|
|
|
this.state = state;
|
|
|
|
this.preferencesTab = new PreferencesUIStore.TabItem({
|
|
|
|
tabId: 'Quick Replies',
|
|
|
|
displayName: 'Quick Replies',
|
2016-05-14 08:14:04 +08:00
|
|
|
component: require('./preferences-templates').default,
|
2016-03-01 10:47:22 +08:00
|
|
|
});
|
|
|
|
ComponentRegistry.register(TemplatePicker, {role: 'Composer:ActionButton'});
|
|
|
|
ComponentRegistry.register(TemplateStatusBar, {role: 'Composer:Footer'});
|
|
|
|
PreferencesUIStore.registerPreferencesTab(this.preferencesTab);
|
|
|
|
ExtensionRegistry.Composer.register(TemplateComposerExtension);
|
|
|
|
}
|
2015-11-12 04:49:48 +08:00
|
|
|
|
2016-03-01 10:47:22 +08:00
|
|
|
export function deactivate() {
|
|
|
|
ComponentRegistry.unregister(TemplatePicker);
|
|
|
|
ComponentRegistry.unregister(TemplateStatusBar);
|
|
|
|
PreferencesUIStore.unregisterPreferencesTab(this.preferencesTab.tabId);
|
|
|
|
ExtensionRegistry.Composer.unregister(TemplateComposerExtension);
|
|
|
|
}
|
2015-11-12 04:49:48 +08:00
|
|
|
|
2016-03-01 10:47:22 +08:00
|
|
|
export function serialize() {
|
|
|
|
return this.state;
|
|
|
|
}
|