From 0caf5966ee2d1feb5771c77d9e11b261242a6a7f Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 18 Sep 2015 11:10:14 -0700 Subject: [PATCH] fix capitalization of JavaScript and CoffeeScript Summary: i accidentally messed up phab and arcanist locally, so this diff is to fix these mistakes i made. it's the combination of D2037 and D2028. Test Plan: tested manually Reviewers: bengotow, evan Differential Revision: https://phab.nylas.com/D2043 --- docs/Architecture.md | 4 ++-- docs/Database.md | 6 ++--- docs/First steps.md | 6 ++--- docs/PackageOverview.md | 4 ++-- docs/React.md | 2 +- src/atom.coffee | 4 ++-- src/components/menu.cjsx | 6 ++--- src/components/retina-img.cjsx | 30 ++++++++++++------------ src/flux/models/folder.coffee | 2 +- src/flux/models/model.coffee | 2 +- src/flux/tasks/change-folder-task.coffee | 10 ++++---- src/flux/tasks/change-labels-task.coffee | 10 ++++---- src/flux/tasks/task.coffee | 14 +++++------ 13 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/Architecture.md b/docs/Architecture.md index 1b9c62078..ce3875488 100644 --- a/docs/Architecture.md +++ b/docs/Architecture.md @@ -13,7 +13,7 @@ For more information about the Flux pattern, check out [this diagram](https://fa There are several core stores in the application: -- **{NamespaceStore}**: When the user signs in to Nylas Mail, their auth token provides one or more namespaces. The NamespaceStore manages the available Namespaces, exposes the current Namespace, and allows you to observe changes to the current namespace. +- **{AccountStore}**: When the user signs in to Nylas Mail, their auth token provides one or more accounts. The AccountStore manages the available Accounts, exposes the current Account, and allows you to observe changes to the current Account. - **{TaskQueue}**: Manages Tasks, operations queued for processing on the backend. Task objects represent individual API actions and are persisted to disk, ensuring that they are performed eventually. Each Task may depend on other tasks, and Tasks are executed in order. @@ -26,7 +26,7 @@ There are several core stores in the application: Most packages declare additional stores that subscribe to these Stores, as well as user Actions, and vend data to the package's React components. -###Actions +### Actions In Flux applications, views fire {Actions}, which anyone in the application can subscribe to. Typically, `Stores` listen to actions to perform business logic and trigger updates to their corresponding views. For example, when you click "Compose" in the top left corner of Nylas Mail, the React component for the button fires {Actions::composeNewBlankDraft}. The {DraftStore} listens to this action and opens a new composer window. diff --git a/docs/Database.md b/docs/Database.md index 9628d2a61..f5ecc7696 100644 --- a/docs/Database.md +++ b/docs/Database.md @@ -96,9 +96,9 @@ Drafts in Nylas Mail presented us with a unique challenge. The same draft may be The {DatabaseStore} exposes a single method, `unpersistModel`, that allows you to purge an object from the cache. You cannot remove a model by ID alone - you must load it first. -####Advanced Model Attributes +#### Advanced Model Attributes -## Attribute.JoinedData +##### Attribute.JoinedData Joined Data attributes allow you to store certain attributes of an object in a separate table in the database. We use this attribute type for Message bodies. Storing message bodies, which can be very large, in a separate table allows us to make queries on message metadata extremely fast, and inflate Message objects without their bodies to build the thread list. @@ -116,7 +116,7 @@ When you call `persistModel`, JoinedData attributes are automatically written to JoinedData attributes cannot be `queryable`. -## Attribute.Collection +##### Attribute.Collection Collection attributes provide basic support for one-to-many relationships. For example, {Thread}s in Nylas Mail have a collection of {Tag}s. diff --git a/docs/First steps.md b/docs/First steps.md index 6ea3bda7d..558795ce6 100644 --- a/docs/First steps.md +++ b/docs/First steps.md @@ -44,7 +44,7 @@ Order: 2

A
Explore the source

-

Nylas is built on the modern web - packages are written in Coffeescript or Javascript. Packages are a lot like node modules, with their own source, assets, and tests. Check out yours in ~/.nylas/dev/packages.

+

Nylas is built on the modern web - packages are written in CoffeeScript or JavaScript. Packages are a lot like node modules, with their own source, assets, and tests. Check out yours in ~/.nylas/dev/packages.

B
Run the specs

@@ -136,13 +136,13 @@ class MyMessageSidebar extends React.Component ... - _renderContent => + _renderContent: =>
{md5(@state.contact.email)}
``` -> JSX Tip: The `{..}` syntax is used for JavaScript expressions inside HTML elements. [Learn more](https://facebook.github.io/react/docs/jsx-in-depth.html) +> JSX Tip: The `{..}` syntax is used for JavaScript expressions inside HTML elements. [Learn more](https://facebook.github.io/react/docs/jsx-in-depth.html). You should see the MD5 hash appear in the sidebar (after you reload Nylas Mail): diff --git a/docs/PackageOverview.md b/docs/PackageOverview.md index 38ef07c74..1616f5b23 100644 --- a/docs/PackageOverview.md +++ b/docs/PackageOverview.md @@ -77,7 +77,7 @@ module.exports = ``` -> Nylas Mail uses CJSX, a Coffeescript version of JSX, which makes it easy to express Virtual DOM in React `render` methods! You may want to add the [Babel](https://github.com/babel/babel-sublime) plugin to Sublime Text, or the [CJSX Language](https://atom.io/packages/language-cjsx) for syntax highlighting. +> Nylas Mail uses CJSX, a CoffeeScript version of JSX, which makes it easy to express Virtual DOM in React `render` methods! You may want to add the [Babel](https://github.com/babel/babel-sublime) plugin to Sublime Text, or the [CJSX Language](https://atom.io/packages/language-cjsx) for syntax highlighting. ### Package Stylesheets @@ -102,7 +102,7 @@ a.src = "nylas://my-package-name/sounds/bloop.mp3" a.play() ``` -###Installing a Package +### Installing a Package Nylas Mail ships with many packages already bundled with the application. When the application launches, it looks for additional packages in `~/.nylas/dev/packages`. Each package you create belongs in its own directory inside this folder. diff --git a/docs/React.md b/docs/React.md index 39fd361b9..5c8654a3f 100644 --- a/docs/React.md +++ b/docs/React.md @@ -4,7 +4,7 @@ Section: Guides Order: 2 --- -Nylas Mail uses [React](https://facebook.github.io/react/) to create a fast, responsive UI. Packages that want to extend the Nylas Mail interface should use React. Using React's [JSX](https://facebook.github.io/react/jsx-in-depth.html) syntax is optional, but both [JSX](https://facebook.github.io/react/jsx-in-depth.html) and [CJSX](https://github.com/jsdf/coffee-react) (Coffeescript) are available. +Nylas Mail uses [React](https://facebook.github.io/react/) to create a fast, responsive UI. Packages that want to extend the Nylas Mail interface should use React. Using React's [JSX](https://facebook.github.io/react/jsx-in-depth.html) syntax is optional, but both [JSX](https://facebook.github.io/react/jsx-in-depth.html) and [CJSX](https://github.com/jsdf/coffee-react) (CoffeeScript) are available. For a quick introduction to React, take a look at Facebook's [Getting Started with React](https://facebook.github.io/react/getting-started.html). diff --git a/src/atom.coffee b/src/atom.coffee index 160a4eff0..501c45bf1 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -20,7 +20,7 @@ Utils = require './flux/models/utils' # Essential: Atom global for dealing with packages, themes, menus, and the window. # -# An instance of this class is always available as the `atom` global. +# The singleton of this class is always available as the `atom` global. module.exports = class Atom extends Model @version: 1 # Increment this when the serialization format changes @@ -514,7 +514,7 @@ class Atom extends Model onWindowPropsReceived: (callback) -> @emitter.on('window-props-received', callback) - # Extended: Returns a {Boolean} true when the current window is maximized. + # Extended: Is the current window maximized? isMaximixed: -> @getCurrentWindow().isMaximized() diff --git a/src/components/menu.cjsx b/src/components/menu.cjsx index 390f79e24..ea4d3b65f 100644 --- a/src/components/menu.cjsx +++ b/src/components/menu.cjsx @@ -17,9 +17,9 @@ class MenuItem extends React.Component Public: React `props` supported by MenuItem: - `divider` (optional) Pass a {Boolean} to render the menu item as a section divider. - - `key` (optional) - - `selected` (optional) - - `checked` (optional) + - `key` (optional) Pass a {String} to be the React key to optimize rendering lists of items. + - `selected` (optional) Pass a {Boolean} to specify whether the item is selected. + - `checked` (optional) Pass a {Boolean} to specify whether the item is checked. ### @propTypes: divider: React.PropTypes.bool diff --git a/src/components/retina-img.cjsx b/src/components/retina-img.cjsx index 7ef1b8e01..fb1cc4e75 100644 --- a/src/components/retina-img.cjsx +++ b/src/components/retina-img.cjsx @@ -41,25 +41,25 @@ RetinaImg also introduces the concept of image `modes`. Specifying an image mode is important for theming: it describes the content of your image, allowing theme developers to properly adjust it. The four modes are described below: -- `ContentPreserve`: Your image contains color or should not be adjusted by any theme. +- ContentPreserve: Your image contains color or should not be adjusted by any theme. -- `ContentLight`: Your image is a grayscale image with light colors, intended to be shown - against a dark background. If a theme developer changes the background to be light, they - can safely apply CSS filters to invert or darken this image. This mode adds the - `content-light` CSS class to the image. +- ContentLight: Your image is a grayscale image with light colors, intended to be shown + against a dark background. If a theme developer changes the background to be light, they + can safely apply CSS filters to invert or darken this image. This mode adds the + `content-light` CSS class to the image. -- `ContentDark`: Your image is a grayscale image with dark colors, intended to be shown - against a light background. If a theme developer changes the background to be dark, they - can safely apply CSS filters to invert or brighten this image. This mode adds the - `content-dark` CSS class to the image. +- ContentDark: Your image is a grayscale image with dark colors, intended to be shown + against a light background. If a theme developer changes the background to be dark, they + can safely apply CSS filters to invert or brighten this image. This mode adds the + `content-dark` CSS class to the image. -- `ContentIsMask`: This image provides alpha information only, and color should - be based on the `background-color` of the RetinaImg. This mode adds the - `content-mask` CSS class to the image, and leverages `-webkit-mask-image`. +- ContentIsMask: This image provides alpha information only, and color should + be based on the `background-color` of the RetinaImg. This mode adds the + `content-mask` CSS class to the image, and leverages `-webkit-mask-image`. - Example: Icons displayed within buttons specify ContentIsMask, and their - color is declared via CSS to be the same as the button text color. Changing - `@text-color-subtle` in a theme changes both button text and button icons! + Example: Icons displayed within buttons specify ContentIsMask, and their + color is declared via CSS to be the same as the button text color. Changing + `@text-color-subtle` in a theme changes both button text and button icons! ```css .btn-icon { diff --git a/src/flux/models/folder.coffee b/src/flux/models/folder.coffee index fd3538ffa..9fee1c8f5 100644 --- a/src/flux/models/folder.coffee +++ b/src/flux/models/folder.coffee @@ -8,7 +8,7 @@ information about Folder on the Nylas Platform, read the [Folder API Documentation](https://nylas.com/docs/api#folders) NOTE: This is different from a `Label`. A `Folder` is used for generic -IMAP and Exchange, while `Label`s are used for Gmail. The `Namespace` has +IMAP and Exchange, while `Label`s are used for Gmail. The `Account` has the filed `organizationUnit` which specifies if the current account uses either "folder" or "label". diff --git a/src/flux/models/model.coffee b/src/flux/models/model.coffee index cd0ac42a4..847f54d94 100644 --- a/src/flux/models/model.coffee +++ b/src/flux/models/model.coffee @@ -25,7 +25,7 @@ object. `object`: {AttributeString} The model's type. This field is used by the JSON deserializer to create an instance of the correct class when inflating the object. -`accountId`: {AttributeString} The string Namespace Id this model belongs to. +`accountId`: {AttributeString} The string Account Id this model belongs to. Section: Models ### diff --git a/src/flux/tasks/change-folder-task.coffee b/src/flux/tasks/change-folder-task.coffee index 494873aea..394f31cad 100644 --- a/src/flux/tasks/change-folder-task.coffee +++ b/src/flux/tasks/change-folder-task.coffee @@ -9,11 +9,11 @@ SyncbackCategoryTask = require './syncback-category-task' # Public: Create a new task to apply labels to a message or thread. # -# Takes an options array of the form: -# - `folder` The {Folder} or {Folder} IDs to move to -# - `threads` An array of {Thread}s or {Thread} IDs -# - `threads` An array of {Message}s or {Message} IDs -# - `undoData` Since changing the folder is a destructive action, +# Takes an options object of the form: +# - folder: The {Folder} or {Folder} IDs to move to +# - threads: An array of {Thread}s or {Thread} IDs +# - threads: An array of {Message}s or {Message} IDs +# - undoData: Since changing the folder is a destructive action, # undo tasks need to store the configuration of what folders messages # were in. When creating an undo task, we fill this parameter with # that configuration diff --git a/src/flux/tasks/change-labels-task.coffee b/src/flux/tasks/change-labels-task.coffee index 4363a75d5..ba425747f 100644 --- a/src/flux/tasks/change-labels-task.coffee +++ b/src/flux/tasks/change-labels-task.coffee @@ -9,11 +9,11 @@ SyncbackCategoryTask = require './syncback-category-task' # Public: Create a new task to apply labels to a message or thread. # -# Takes an options array of the form: -# - `labelsToAdd` An {Array} of {Label}s or {Label} ids to add -# - `labelsToRemove` An {Array} of {Label}s or {Label} ids to remove -# - `threads` An {Array} of {Thread}s or {Thread} ids -# - `messages` An {Array} of {Message}s or {Message} ids +# Takes an options object of the form: +# - labelsToAdd: An {Array} of {Label}s or {Label} ids to add +# - labelsToRemove: An {Array} of {Label}s or {Label} ids to remove +# - threads: An {Array} of {Thread}s or {Thread} ids +# - messages: An {Array} of {Message}s or {Message} ids class ChangeLabelsTask extends ChangeMailTask constructor: ({@labelsToAdd, @labelsToRemove}={}) -> diff --git a/src/flux/tasks/task.coffee b/src/flux/tasks/task.coffee index e9d7f6909..3ed6e8961 100644 --- a/src/flux/tasks/task.coffee +++ b/src/flux/tasks/task.coffee @@ -20,23 +20,23 @@ TaskStatus = # tried multiple times to succeed in case of network issues. # # performRemote must return a {Promise}, and it should always resolve with -# Task.Status.Finished or Task.Status.Retry. Rejections are considered +# `Task.Status.Finished` or `Task.Status.Retry`. Rejections are considered # exception cases and are logged to our server. # -# Returning Task.Status.Retry will cause the TaskQueue to leave your task -# on the queue and run it again later. You should only return Task.Status.Retry +# Returning `Task.Status.Retry` will cause the `TaskQueue` to leave your task +# on the queue and run it again later. You should only return `Task.Status.Retry` # if your task encountered a transient error (for example, a `0` but not a `400`). # # - shouldWaitForTask: # Tasks may be arbitrarily dependent on other tasks. To ensure that -# performRemote is called at the right time, subclasses should implement +# `performRemote` is called at the right time, subclasses should implement # `shouldWaitForTask(other)`. For example, the `SendDraft` task is dependent # on the draft's files' `UploadFile` tasks completing. # -# Tasks may also implement shouldDequeueOtherTask(other). Returning true +# Tasks may also implement `shouldDequeueOtherTask(other)`. Returning true # will cause the other event to be removed from the queue. This is useful in -# offline mode especially, when the user might Save,Save,Save,Save,Send. -# Each newly queued Save can cancel the (unstarted) save task in the queue. +# offline mode especially, when the user might `Save`,`Save`,`Save`,`Save`,`Send`. +# Each newly queued `Save` can cancel the (unstarted) save task in the queue. # # Tasks that need to support undo/redo should implement `canBeUndone`, `isUndo`, # `createUndoTask`, and `createIdenticalTask`.