Mailspring/examples/N1-Quick-Schedule/lib/calendar-button.cjsx

33 lines
961 B
Text
Raw Normal View History

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: =>
<button className="btn btn-toolbar" onClick={@_onClick} title="QuickSchedule">
<RetinaImg url="nylas://N1-Quick-Schedule/assets/quickschedule-icon@2x.png" mode={RetinaImg.Mode.ContentIsMask} />
</button>
2015-10-03 07:06:56 +08:00
_onClick: =>
BrowserWindow = require('remote').require('browser-window')
w = new BrowserWindow
title: 'N1 QuickSchedule'
nodeIntegration: false
webPreferences:
webSecurity:false
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'
w.loadURL "file://#{url}?draftClientId=#{@props.draftClientId}"
2015-10-03 07:06:56 +08:00
_getDialog: =>
require('remote').require('dialog')
module.exports = CalendarButton