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-12-10 02:55:08 +08:00
|
|
|
<button className="btn btn-toolbar" onClick={@_onClick} title="QuickSchedule">
|
2016-01-08 06:56:34 +08:00
|
|
|
<RetinaImg url="nylas://quick-schedule/assets/quickschedule-icon@2x.png" mode={RetinaImg.Mode.ContentIsMask} />
|
2015-11-20 10:16:38 +08:00
|
|
|
</button>
|
2015-10-03 07:06:56 +08:00
|
|
|
|
|
|
|
_onClick: =>
|
2016-01-30 06:23:52 +08:00
|
|
|
BrowserWindow = require('electron').remote.BrowserWindow
|
2015-10-03 07:06:56 +08:00
|
|
|
w = new BrowserWindow
|
2016-01-08 06:56:34 +08:00
|
|
|
title: 'N1 Quick Schedule'
|
2015-11-24 14:09:17 +08:00
|
|
|
nodeIntegration: false
|
|
|
|
webPreferences:
|
|
|
|
webSecurity:false
|
2015-12-10 08:41:30 +08:00
|
|
|
width: 800
|
|
|
|
height: 650
|
2015-10-03 07:06:56 +08:00
|
|
|
|
|
|
|
# Here, we load an arbitrary html file into the Composer!
|
|
|
|
path = require 'path'
|
|
|
|
url = path.join __dirname, '..', 'calendar.html'
|
2015-11-24 14:09:17 +08:00
|
|
|
w.loadURL "file://#{url}?draftClientId=#{@props.draftClientId}"
|
2015-10-03 07:06:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
_getDialog: =>
|
|
|
|
require('remote').require('dialog')
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = CalendarButton
|