mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-27 10:28:31 +08:00
fix(docs): Replace docs references to Edgehill with N1
This commit is contained in:
parent
3ccc5e3d99
commit
9a3356c5e9
12 changed files with 88 additions and 88 deletions
|
@ -51,8 +51,8 @@ class TranslateButton extends React.Component
|
|||
# `React.createElement('a', {href: 'http://facebook.github.io/react/'}, 'Hello!')`
|
||||
#
|
||||
# We're rendering a `Popover` with a `Menu` inside. These components are part
|
||||
# of Edgehill's standard `nylas-component-kit` library, and make it easy to build
|
||||
# interfaces that match the rest of Edgehill's UI.
|
||||
# of N1's standard `nylas-component-kit` library, and make it easy to build
|
||||
# interfaces that match the rest of N1's UI.
|
||||
#
|
||||
render: =>
|
||||
React.createElement(Popover, {"ref": "popover", \
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
<body>
|
||||
<div id="container">
|
||||
<div id="background"></div>
|
||||
|
||||
|
||||
<ul class="sections">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-1">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-1">¶</a>
|
||||
</div>
|
||||
|
@ -27,7 +27,7 @@
|
|||
a language from a popup menu and translates draft text into that language.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre>
|
||||
request = <span class="hljs-built_in">require</span> <span class="hljs-string">'request'</span>
|
||||
|
||||
|
@ -54,28 +54,28 @@ YandexLanguages =
|
|||
<span class="hljs-string">'Korean'</span>: <span class="hljs-string">'ko'</span>
|
||||
|
||||
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">TranslateButton</span> <span class="hljs-keyword">extends</span> <span class="hljs-title">React</span>.<span class="hljs-title">Component</span></span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-2">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-2">¶</a>
|
||||
</div>
|
||||
<p>Adding a <code>displayName</code> makes debugging React easier</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-property">@displayName</span>: <span class="hljs-string">'TranslateButton'</span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-3">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-3">¶</a>
|
||||
</div>
|
||||
|
@ -84,16 +84,16 @@ we receive the local id of the current draft as a <code>prop</code> (a read-only
|
|||
property). Since our code depends on this prop, we mark it as a requirement.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-property">@propTypes</span>:
|
||||
<span class="hljs-attribute">draftLocalId</span>: React.PropTypes.string.isRequired</pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-4">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-4">¶</a>
|
||||
</div>
|
||||
|
@ -103,11 +103,11 @@ like HTML, but don’t be fooled. The CJSX preprocessor converts</p>
|
|||
<p>into Javascript objects which describe the HTML you want:</p>
|
||||
<p><code>React.createElement('a', {href: 'http://facebook.github.io/react/'}, 'Hello!')</code></p>
|
||||
<p>We’re rendering a <code>Popover</code> with a <code>Menu</code> inside. These components are part
|
||||
of Edgehill’s standard <code>nylas-component-kit</code> library, and make it easy to build
|
||||
interfaces that match the rest of Edgehill’s UI.</p>
|
||||
of N1’s standard <code>nylas-component-kit</code> library, and make it easy to build
|
||||
interfaces that match the rest of N1’s UI.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-attribute">render</span>: <span class="hljs-function">=></span>
|
||||
React.createElement(Popover, {<span class="hljs-string">"ref"</span>: <span class="hljs-string">"popover"</span>, \
|
||||
<span class="hljs-string">"className"</span>: <span class="hljs-string">"translate-language-picker pull-right"</span>, \
|
||||
|
@ -120,13 +120,13 @@ interfaces that match the rest of Edgehill’s UI.</p>
|
|||
)
|
||||
|
||||
</span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-5">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-5">¶</a>
|
||||
</div>
|
||||
|
@ -135,7 +135,7 @@ interfaces that match the rest of Edgehill’s UI.</p>
|
|||
<code>RetinaImg</code> will automatically chose the best image format for our display.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-attribute">_renderButton</span>: <span class="hljs-function">=></span>
|
||||
React.createElement(<span class="hljs-string">"button"</span>, {<span class="hljs-string">"className"</span>: <span class="hljs-string">"btn btn-toolbar"</span>}, <span class="hljs-string">"""
|
||||
Translate
|
||||
|
@ -144,13 +144,13 @@ interfaces that match the rest of Edgehill’s UI.</p>
|
|||
|
||||
<span class="hljs-attribute">_onTranslate</span>: <span class="hljs-function"><span class="hljs-params">(lang)</span> =></span>
|
||||
<span class="hljs-property">@refs</span>.popover.close()</pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-6">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-6">¶</a>
|
||||
</div>
|
||||
|
@ -159,18 +159,18 @@ the draft object and also manages saving changes to the local cache and
|
|||
Nilas API as multiple parts of the application touch the draft.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> session = DraftStore.sessionForLocalId(<span class="hljs-property">@props</span>.draftLocalId)
|
||||
session.prepare().<span class="hljs-keyword">then</span> =>
|
||||
body = session.draft().body
|
||||
bodyQuoteStart = Utils.quotedTextIndex(body)</pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-7">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-7">¶</a>
|
||||
</div>
|
||||
|
@ -178,7 +178,7 @@ Nilas API as multiple parts of the application touch the draft.</p>
|
|||
don’t translate quoted text.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> bodyQuoteStart > <span class="hljs-number">0</span>
|
||||
text = body.substr(<span class="hljs-number">0</span>, bodyQuoteStart)
|
||||
<span class="hljs-keyword">else</span>
|
||||
|
@ -189,30 +189,30 @@ don’t translate quoted text.</p>
|
|||
<span class="hljs-attribute">lang</span>: YandexLanguages[lang]
|
||||
<span class="hljs-attribute">text</span>: text
|
||||
<span class="hljs-attribute">format</span>: <span class="hljs-string">'html'</span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-8">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-8">¶</a>
|
||||
</div>
|
||||
<p>Use Node’s <code>request</code> library to perform the translation using the Yandex API.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> request {<span class="hljs-attribute">url</span>: YandexTranslationURL, <span class="hljs-attribute">qs</span>: query}, <span class="hljs-function"><span class="hljs-params">(error, resp, data)</span> =></span>
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-property">@_onError</span>(error) <span class="hljs-keyword">unless</span> resp.statusCode <span class="hljs-keyword">is</span> <span class="hljs-number">200</span>
|
||||
json = JSON.parse(data)</pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-9">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-9">¶</a>
|
||||
</div>
|
||||
|
@ -220,16 +220,16 @@ don’t translate quoted text.</p>
|
|||
that we didn’t process.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> translated = json.text.join(<span class="hljs-string">''</span>)
|
||||
translated += body.substr(bodyQuoteStart) <span class="hljs-keyword">if</span> bodyQuoteStart > <span class="hljs-number">0</span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-10">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-10">¶</a>
|
||||
</div>
|
||||
|
@ -238,7 +238,7 @@ automatically marshalls changes to the database and ensures that others accessin
|
|||
the same draft are notified of changes.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> session.changes.add(<span class="hljs-attribute">body</span>: translated)
|
||||
session.changes.commit()
|
||||
|
||||
|
@ -249,13 +249,13 @@ the same draft are notified of changes.</p>
|
|||
|
||||
|
||||
<span class="hljs-built_in">module</span>.exports =</pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-11">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-11">¶</a>
|
||||
</div>
|
||||
|
@ -263,17 +263,17 @@ the same draft are notified of changes.</p>
|
|||
saved state using <code>serialize</code> it is provided.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-attribute">activate</span>: <span class="hljs-function"><span class="hljs-params">(<span class="hljs-property">@state</span>)</span> -></span>
|
||||
ComponentRegistry.register TranslateButton,
|
||||
<span class="hljs-attribute">role</span>: <span class="hljs-string">'Composer:ActionButton'</span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-12">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-12">¶</a>
|
||||
</div>
|
||||
|
@ -282,15 +282,15 @@ You can return a state object that will be passed back to your package
|
|||
when it is re-activated.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-attribute">serialize</span>: <span class="hljs-function">-></span></pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
<li id="section-13">
|
||||
<div class="annotation">
|
||||
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-13">¶</a>
|
||||
</div>
|
||||
|
@ -300,12 +300,12 @@ watching any files, holding external resources, providing commands or
|
|||
subscribing to events, release them here.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="content"><div class='highlight'><pre> <span class="hljs-attribute">deactivate</span>: <span class="hljs-function">-></span>
|
||||
ComponentRegistry.unregister(TranslateButton)</pre></div></div>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -51,8 +51,8 @@ class TranslateButton extends React.Component
|
|||
# `React.createElement('a', {href: 'http://facebook.github.io/react/'}, 'Hello!')`
|
||||
#
|
||||
# We're rendering a `Popover` with a `Menu` inside. These components are part
|
||||
# of Edgehill's standard `nylas-component-kit` library, and make it easy to build
|
||||
# interfaces that match the rest of Edgehill's UI.
|
||||
# of N1's standard `nylas-component-kit` library, and make it easy to build
|
||||
# interfaces that match the rest of N1's UI.
|
||||
#
|
||||
render: =>
|
||||
<Popover ref="popover"
|
||||
|
|
|
@ -111,7 +111,7 @@ class MessageControls extends React.Component
|
|||
type: 'warning'
|
||||
buttons: ['OK'],
|
||||
message: "Thank you."
|
||||
detail: "The contents of this message have been sent to the Edgehill team and we added to a test suite."
|
||||
detail: "The contents of this message have been sent to the N1 team and we added to a test suite."
|
||||
}
|
||||
|
||||
_onShowOriginal: =>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "notification-mailto",
|
||||
"main": "./lib/main",
|
||||
"version": "0.36.0",
|
||||
"description": "Displays a notification asking the user to make Edgehill their default mailto handler",
|
||||
"description": "Displays a notification asking the user to make N1 their default mailto handler",
|
||||
"license": "Proprietary",
|
||||
"engines": {
|
||||
"atom": "*"
|
||||
|
|
|
@ -10,7 +10,7 @@ uuid_count = 0
|
|||
class Notification
|
||||
constructor: ({@message, @type, @tag, @sticky, @actions, @icon} = {}) ->
|
||||
# Check to make sure the provided data is a valid notificaiton, since
|
||||
# notifications may be constructed by anyone developing on Edgehill
|
||||
# notifications may be constructed by anyone developing on N1
|
||||
throw new Error "No `new` keyword when constructing Notification" unless @ instanceof Notification
|
||||
throw new Error "Type must be `info`,`error`, or `success`" unless @type in ['info', 'error', 'success']
|
||||
throw new Error "Message must be provided for notification" unless @message
|
||||
|
|
|
@ -187,7 +187,7 @@ class AccountSettingsPage extends React.Component
|
|||
@setState(tryingToAuthenticate: true)
|
||||
|
||||
# Send the form data directly to Nylas to get code
|
||||
# If this succeeds, send the received code to Edgehill server to register the account
|
||||
# If this succeeds, send the received code to N1 server to register the account
|
||||
# Otherwise process the error message from the server and highlight UI as needed
|
||||
NylasAPI.makeRequest
|
||||
path: "/auth?client_id=#{NylasAPI.AppID}"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
# Edgehill Jenkins must run a shell script.
|
||||
# N1 Jenkins must run a shell script.
|
||||
#
|
||||
# We also set the Keychain credentials inside of Jenkins Credentials
|
||||
# instead of plain text files.
|
||||
|
|
|
@ -31,7 +31,7 @@ function verifyNode(cb) {
|
|||
var nodeMajorVersion = +versionArray[0];
|
||||
var nodeMinorVersion = +versionArray[1];
|
||||
if (nodeMajorVersion === 0 && nodeMinorVersion < 10) {
|
||||
error = "node v0.10 is required to build Edgehill, node " + nodeVersion + " is installed.";
|
||||
error = "node v0.10 is required to build N1, node " + nodeVersion + " is installed.";
|
||||
cb(error);
|
||||
}
|
||||
else {
|
||||
|
@ -50,14 +50,14 @@ function verifyNpm(cb) {
|
|||
|
||||
childProcess.execFile(npmCommand, ['-v'], { env: process.env }, function(err, stdout) {
|
||||
if (err)
|
||||
return cb("npm 1.4 is required to build Edgehill. An error (" + err + ") occured when checking the version.");
|
||||
return cb("npm 1.4 is required to build N1. An error (" + err + ") occured when checking the version.");
|
||||
|
||||
var npmVersion = stdout ? stdout.trim() : '';
|
||||
var versionArray = npmVersion.split('.');
|
||||
var npmMajorVersion = +versionArray[0] || 0;
|
||||
var npmMinorVersion = +versionArray[1] || 0;
|
||||
if (npmMajorVersion === 1 && npmMinorVersion < 4)
|
||||
cb("npm v1.4+ is required to build Edgehill.");
|
||||
cb("npm v1.4+ is required to build N1.");
|
||||
else
|
||||
cb(null, "npm: v" + npmVersion);
|
||||
});
|
||||
|
@ -87,7 +87,7 @@ function checkPythonVersion (python, cb) {
|
|||
|
||||
childProcess.execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: process.env }, function (err, stdout) {
|
||||
if (err) {
|
||||
error = "Python 2.7 is required to build Edgehill. An error (" + err + ") occured when checking the version of '" + python + "'. ";
|
||||
error = "Python 2.7 is required to build N1. An error (" + err + ") occured when checking the version of '" + python + "'. ";
|
||||
error += pythonHelpMessage;
|
||||
cb(error);
|
||||
return;
|
||||
|
@ -101,11 +101,11 @@ function checkPythonVersion (python, cb) {
|
|||
version = version.replace(/rc(.*)$/ig, '');
|
||||
}
|
||||
|
||||
// Edgehill requires python 2.7 or higher (but not python 3) for node-gyp
|
||||
// N1 requires python 2.7 or higher (but not python 3) for node-gyp
|
||||
var versionArray = version.split('.').map(function(num) { return +num; });
|
||||
var goodPythonVersion = (versionArray[0] === 2 && versionArray[1] >= 7);
|
||||
if (!goodPythonVersion) {
|
||||
error = "Python 2.7 is required to build Edgehill. '" + python + "' returns version " + version + ". ";
|
||||
error = "Python 2.7 is required to build N1. '" + python + "' returns version " + version + ". ";
|
||||
error += pythonHelpMessage;
|
||||
cb(error);
|
||||
return;
|
||||
|
|
|
@ -5,7 +5,7 @@ protocol = require 'protocol'
|
|||
|
||||
# Handles requests with 'nylas' protocol.
|
||||
#
|
||||
# It's created by {EdgehillApplication} upon instantiation and is used to create a
|
||||
# It's created by {N1Application} upon instantiation and is used to create a
|
||||
# custom resource loader for 'nylas://' URLs.
|
||||
#
|
||||
# The following directories are searched in order:
|
||||
|
|
|
@ -74,7 +74,7 @@ Public: React component for multi-section Menus with key binding
|
|||
|
||||
The Menu component allows you to display a list of items. Menu takes care of
|
||||
several important things, ensuring that your menu is consistent with the rest
|
||||
of the Edgehill application and offers a near-native experience:
|
||||
of the N1 application and offers a near-native experience:
|
||||
|
||||
- Keyboard Interaction with the Up and Down arrow keys, Enter to select
|
||||
- Maintaining selection across content changes
|
||||
|
|
|
@ -4,7 +4,7 @@ _ = require 'underscore'
|
|||
|
||||
###
|
||||
Public: The Popover component makes it easy to display a sheet or popup menu when the
|
||||
user clicks the React element provided as `buttonComponent`. In Edgehill, the Popover
|
||||
user clicks the React element provided as `buttonComponent`. In N1, the Popover
|
||||
component is used to create rich dropdown menus, detail popups, etc. with consistent
|
||||
look and feel and behavior.
|
||||
|
||||
|
|
Loading…
Reference in a new issue