Mailspring/internal_packages/quick-schedule/docs/calendar-button.html

110 lines
4.4 KiB
HTML
Raw Normal View History

2015-10-03 07:06:56 +08:00
<!DOCTYPE html>
<html>
<head>
<title>calendar-button.coffee</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
2015-10-03 07:06:56 +08:00
<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To &hellip;</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page_wrapper">
<div id="jump_page">
2015-10-03 07:06:56 +08:00
<a class="source" href="availability-draft-extension.html">
availability-draft-extension.coffee
</a>
2015-10-03 07:06:56 +08:00
<a class="source" href="calendar-button.html">
calendar-button.coffee
</a>
2015-10-03 07:06:56 +08:00
<a class="source" href="main.html">
main.coffee
</a>
2015-10-03 07:06:56 +08:00
</div>
</div>
</li>
</ul>
2015-10-03 07:06:56 +08:00
<ul class="sections">
2015-10-03 07:06:56 +08:00
<li id="title">
<div class="annotation">
<h1>calendar-button.coffee</h1>
</div>
</li>
2015-10-03 07:06:56 +08:00
<li id="section-1">
<div class="annotation">
2015-10-03 07:06:56 +08:00
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">&#182;</a>
</div>
2015-10-03 07:06:56 +08:00
</div>
2015-10-03 07:06:56 +08:00
<div class="content"><div class='highlight'><pre>{Utils, DraftStore, React} = <span class="hljs-built_in">require</span> <span class="hljs-string">'nylas-exports'</span>
{RetinaImg} = <span class="hljs-built_in">require</span> <span class="hljs-string">'nylas-component-kit'</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">CalendarButton</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span></span>
<span class="hljs-property">@displayName</span>: <span class="hljs-string">'CalendarButton'</span>
<span class="hljs-attribute">render</span>: <span class="hljs-function">=&gt;</span>
React.createElement(<span class="hljs-string">"div"</span>, {<span class="hljs-string">"className"</span>: <span class="hljs-string">"btn btn-toolbar"</span>, <span class="hljs-string">"onClick"</span>: (<span class="hljs-property">@_onClick</span>)}, <span class="hljs-string">"""
QuickSchedule
2015-10-03 07:06:56 +08:00
"""</span>)
<span class="hljs-attribute">_onClick</span>: <span class="hljs-function">=&gt;</span>
BrowserWindow = <span class="hljs-built_in">require</span>(<span class="hljs-string">'remote'</span>).<span class="hljs-built_in">require</span>(<span class="hljs-string">'browser-window'</span>)
w = <span class="hljs-keyword">new</span> BrowserWindow
<span class="hljs-string">'node-integration'</span>: <span class="hljs-literal">false</span>,
<span class="hljs-string">'web-preferences'</span>: {<span class="hljs-string">'web-security'</span>:<span class="hljs-literal">false</span>},
<span class="hljs-string">'width'</span>: <span class="hljs-number">700</span>,
<span class="hljs-string">'height'</span>: <span class="hljs-number">600</span></pre></div></div>
2015-10-03 07:06:56 +08:00
</li>
2015-10-03 07:06:56 +08:00
<li id="section-2">
<div class="annotation">
2015-10-03 07:06:56 +08:00
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p>Here, we load an arbitrary html file into the Composer!</p>
</div>
2015-10-03 07:06:56 +08:00
<div class="content"><div class='highlight'><pre> path = <span class="hljs-built_in">require</span> <span class="hljs-string">'path'</span>
url = path.join __dirname, <span class="hljs-string">'..'</span>, <span class="hljs-string">'calendar.html'</span>
w.loadURL <span class="hljs-string">"file://<span class="hljs-subst">#{url}</span>?draftClientId=<span class="hljs-subst">#{<span class="hljs-property">@props</span>.draftClientId}</span>"</span>
2015-10-03 07:06:56 +08:00
<span class="hljs-attribute">_getDialog</span>: <span class="hljs-function">=&gt;</span>
<span class="hljs-built_in">require</span>(<span class="hljs-string">'remote'</span>).<span class="hljs-built_in">require</span>(<span class="hljs-string">'dialog'</span>)
<span class="hljs-built_in">module</span>.exports = CalendarButton</pre></div></div>
2015-10-03 07:06:56 +08:00
</li>
2015-10-03 07:06:56 +08:00
</ul>
</div>
</body>
</html>