<commit_before>![](https://img.skitch.com/20110828-e6a2sk5mqewpfnxb3eeuef112d.png)

# Futuristic Text Editing

There are two things we are developing: a framework which lets you write Cocoa applications in CoffeeScript, HTML, and CSS utilizing the power of JSCocoa, and a highly extensible text editor built using that framework and Ace.

Let's call the framework "Radfish" and the text editor "Atomicity".


# Radfish

Our framework wraps the Cocoa APIs in idiomatic CoffeeScript using JSCocoa allowing you to write desktop applications using web technologies.

## Radfish Classes

**AtomApp** `Objective-C`

Handles delegation of Cocoa level details (intercepting events, creating `WebView`s). Event's are always send to the active `AtomWindowController`, inactive `AtomWindowController` don't get any messages.

**AtomWindowController** `Objective-C`

 Contains the `WebView` which `JSCocoa` uses. Each `AtomWindowController` has it's own instance of `Radfish`

**Radfish**

Holds all the information, keybindings, plugins. This is subclassed by your application.

**View**

Never used on it's own, a super class that contains code for specialized views.

**Pane extends View**

Has a position.

**Modal extends View**

Represents a Facebox.

**Plugin**

Modules with `startup` and `shutdown` functions. They can also have `description`, `url` properties, and `author` properties. The `url` property should point to the homepage, not an update url.

## Radfish Applications

A Radfish application is a subclass of `Radfish` that has two functions: `startup` and `shutdown`.

When a Radfish application starts up, plugins and keyboard bindings will be setup. It's up to you to create windows or do whatever.

Your `startup` function is executed in `JSCocoa`'s context, which is much more like a traditional browser environment: there's a `window` object, a `document` method, a DOM, etc. Normal web libraries such as jQuery work just fine in a `JSCocoa` context. Each `Radfish` instance is separate, they do not share the `window` object. In other words, traditional JavaScript globals are local to each `RadFish` instance.

Before shutting down, your application's `shutdown` method is called. The application won't shut down until this function returns.

Since we're developing these two products side by side, the `app` directory is our application. The `framework` directory is our Radfish source code.

# Atomicity

When Atomicity's `startup` function is called, it receives a `baseURL`. We check storage for positions and URLs of previous windows (based on the `baseURL`) then recreate them if any are found.

## Atomicity Classes

**App extends Ratfish**

Contains the `baseURL` and `openURLs`. The app handles most actions

* open
* close
* save

**Browser**

Represents a web page.

**Editor**

Represents text. Knows whether it uses tabs or spaces, and if spaces how many.

**Project**

Tree the represents `App`'s `baseURL` and `openURLs`

**Tabs**

Represents open buffers
<commit_msg>added basic API to readme<commit_after>![](https://img.skitch.com/20110828-e6a2sk5mqewpfnxb3eeuef112d.png)

# Futuristic Text Editing

There are two things we are developing: a framework which lets you write Cocoa applications in CoffeeScript, HTML, and CSS utilizing the power of JSCocoa, and a highly extensible text editor built using that framework and Ace.

Let's call the framework "Radfish" and the text editor "Atomicity".


# Radfish

Our framework wraps the Cocoa APIs in idiomatic CoffeeScript using JSCocoa allowing you to write desktop applications using web technologies.

## Radfish Classes

**AtomApp** `Objective-C`

Handles delegation of Cocoa level details (intercepting events, creating `WebView`s). Event's are always send to the active `AtomWindowController`, inactive `AtomWindowController` don't get any messages.

**AtomWindowController** `Objective-C`

 Contains the `WebView` which `JSCocoa` uses. Each `AtomWindowController` has it's own instance of `Radfish`

**Radfish**

Holds all the information, keybindings, plugins. This is subclassed by your application.

**View**

Never used on it's own, a super class that contains code for specialized views.

**Pane extends View**

Has a position.

**Modal extends View**

Represents a Facebox.

**Plugin**

Modules with `startup` and `shutdown` functions. They can also have `description`, `url` properties, and `author` properties. The `url` property should point to the homepage, not an update url.

## Radfish Applications

A Radfish application is a subclass of `Radfish` that has two functions: `startup` and `shutdown`.

When a Radfish application starts up, plugins and keyboard bindings will be setup. It's up to you to create windows or do whatever.

Your `startup` function is executed in `JSCocoa`'s context, which is much more like a traditional browser environment: there's a `window` object, a `document` method, a DOM, etc. Normal web libraries such as jQuery work just fine in a `JSCocoa` context. Each `Radfish` instance is separate, they do not share the `window` object. In other words, traditional JavaScript globals are local to each `RadFish` instance.

Before shutting down, your application's `shutdown` method is called. The application won't shut down until this function returns.

Since we're developing these two products side by side, the `app` directory is our application. The `framework` directory is our Radfish source code.

# Atomicity

When Atomicity's `startup` function is called, it receives a `baseURL`. We check storage for positions and URLs of previous windows (based on the `baseURL`) then recreate them if any are found.

## Atomicity Classes

**App extends Ratfish**

Contains the `baseURL` and `openURLs`. The app handles most actions

* open
* close
* save

**Browser**

Represents a web page.

**Editor**

Represents text. Knows whether it uses tabs or spaces, and if spaces how many.

**Tree**

Represents `App`'s `baseURL` and `openURLs`

**Tabs**

Represents `App`'s opened URLS


```coffeescript
# Radfish
class Radfish
  plugins: []
  keybindings: {}

class View =
  app: null

  html: ->
    # gets or creates the html for the view

class Pane extends View

class Modal extends View

class Plugin
  app: null

# Atomicity
class App extends Radfish
  baseURL: null
  openURLs: []

  startup: (@baseURL) ->

  shutdown: ->

  open: (path...) ->

  close: (paths...) ->

  save: (paths...) ->

class Editor
  pane: null
  app: null

class Tree
  pane: null
  app: null

class Tabs
  pane: null
  app: null
```
{'fraction_non_alphanumeric': 0.08033664881407804, 'fraction_numerical': 0.0045906656465187455, 'mean_word_length': 4.63448275862069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3461766', 'n_tokens_mistral': 1918, 'n_tokens_neox': 1817, 'n_words': 893}