2015-10-03 07:06:56 +08:00
|
|
|
{Utils, DraftStore, React} = require 'nylas-exports'
|
|
|
|
{RetinaImg} = require 'nylas-component-kit'
|
|
|
|
|
|
|
|
class CalendarButton extends React.Component
|
|
|
|
@displayName: 'CalendarButton'
|
|
|
|
|
|
|
|
render: =>
|
2015-11-20 10:16:38 +08:00
|
|
|
<button className="btn btn-toolbar" onClick={@_onClick}>
|
2015-10-03 07:06:56 +08:00
|
|
|
Add Availability
|
2015-11-20 10:16:38 +08:00
|
|
|
</button>
|
2015-10-03 07:06:56 +08:00
|
|
|
|
|
|
|
_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
|