Caret/js
Thomas Wilburn 74d33a4238 Use the just-loaded project settings for blacklist generation instead of relying on Settings.
This fixes #470, or at least makes it less ambiguous. It's not entirely clear where the race condition
was causing the settings to contain bad results, but this fixes the problem.
2015-11-07 17:54:10 -08:00
..
ace Update Ace to 1.2.0 2015-10-21 19:13:50 -07:00
lib Update ES6 Promise shim (currently unused) 2014-09-04 15:35:16 -07:00
sessions Read-only search tabs, cb() from openFile, bug fix 2015-10-27 23:30:15 -06:00
storage Switch to reStructuredText for documentation. 2014-09-05 08:41:16 -07:00
ui Use the just-loaded project settings for blacklist generation instead of relying on Settings. 2015-11-07 17:54:10 -08:00
util Switch to reStructuredText for documentation. 2014-09-05 08:41:16 -07:00
aceBindings.js Set Ctrl-D to act more like Sublime Text where it will select the current word if none is selected or select the next matching selection if a selection exists 2015-01-20 12:14:57 -06:00
api.js Cleanup on API messages 2015-02-21 14:27:05 -08:00
command.js Add the ability to grab commands from CustomEvents dispatched via DOM. Helpful for components with Shadow DOM 2014-07-22 11:51:29 -07:00
editor.js Allow custom cursor styles. 2015-09-03 09:05:48 -07:00
fileManager.js Add option to disable live reload 2015-03-17 15:58:58 -07:00
main.js Adding twilight theme 2015-10-25 20:31:37 -06:00
readme.rst Switch to reStructuredText for documentation. 2014-09-05 08:41:16 -07:00
sessions.js Make sure to initialize syntax dropdown before setting syntax mode 2014-07-20 10:16:57 -07:00
settings.js Code cleanup and commenting. 2014-02-26 22:34:02 -08:00
tab.js Read-only search tabs, cb() from openFile, bug fix 2015-10-27 23:30:15 -06:00

Module descriptions - core
==========================

This document serves as basic documentation for Caret's AMD modules.
It's not exhaustive, but it will serve as a starting place for anyone
wanting to dive in a little deeper.

Caret's execution starts in main.js, which mostly serves as bootstrap
for the other modules. It also registers command listeners for the UI
themes, various window events, and app-level commands like
``app:check-for-updates``. After that, we really get down to business.

In addition to the module folders, which contain their own readme files,
there are also folders for the current Ace build (ace) and any external
libraries used by Caret, such as the ES6 Promises shim (lib).

aceBindings.js
--------------

Takes care of any messiness between Caret and Ace APIs. Registers the
``ace:command`` listener, as well as a bunch of Sublime emulation
commands. Exposes no external methods or data.

api.js
------

Registers for chrome.runtime.onMessageExternal events, patching them
into the command module, and dispatches messages from ``api:execute``
commands. Exposes no external methods or data.

command.js
----------

Serves as a messaging buffer between modules, and from declarative DOM
attributes to modules. Exposes three properties: ``fire()`` for sending
commands, ``on()`` for subscribing to them, and an array called ``list``
that can be used to add palette-only items at runtime.

editor.js
---------

Sets up the Ace editor and registers for events in the ``editor:*``
namespace. Returns the Ace object.

fileManager.js
--------------

Handles opening files from launch data, retained handles, and user
commands. Exposes no external methods or data.

sessions.js
-----------

Manages Caret's tabs, including all UI interaction with the tab bar and
the process of adding or removing tabs. Exposes a number of methods and
manipulating the tab structure. Most of the actual session code is
loaded from the ``/sessions`` folder, to make the file more manageable.

settings.js
-----------

Runs as a RequireJS plugin, so that dependent modules can rely on having
settings available on startup, but actually just returns the same
singleton as ``storage/settingsProvider``.

tab.js
------

Exposes a Tab constructor to dependents, which is an augmented Ace
EditorSession. Tabs do additional setup work to support Caret, as well
as adding methods for saving files and dropping retained file handles.