mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 05:41:05 +08:00
92820fc3d2
Summary: Several fixes and updates the the Send Availability example package. Switches from using `electron-safe-ipc` to using `protocol.RegisterStringProtocol` to communicate with the child window. Changes the URLs in the package from localhost to our live demo backend. Test Plan: manual Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2271
30 lines
819 B
CoffeeScript
30 lines
819 B
CoffeeScript
{Utils, DraftStore, React} = require 'nylas-exports'
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
class CalendarButton extends React.Component
|
|
@displayName: 'CalendarButton'
|
|
|
|
render: =>
|
|
<button className="btn btn-toolbar" onClick={@_onClick}>
|
|
Add Availability
|
|
</button>
|
|
|
|
_onClick: =>
|
|
BrowserWindow = require('remote').require('browser-window')
|
|
w = new BrowserWindow
|
|
'node-integration': false,
|
|
'web-preferences': {'web-security':false},
|
|
'width': 700,
|
|
'height': 600
|
|
|
|
# Here, we load an arbitrary html file into the Composer!
|
|
path = require 'path'
|
|
url = path.join __dirname, '..', 'calendar.html'
|
|
w.loadUrl "file://#{url}?draftClientId=#{@props.draftClientId}"
|
|
|
|
|
|
_getDialog: =>
|
|
require('remote').require('dialog')
|
|
|
|
|
|
module.exports = CalendarButton
|