2014-06-24 00:01:19 +04:00
# Bramble is based on Brackets
2012-03-22 05:19:23 +04:00
2014-10-29 23:38:24 +03:00
Brackets is a modern open-source code editor for HTML, CSS
2017-04-23 20:36:13 +03:00
and JavaScript that is *built* in HTML, CSS and JavaScript.
2011-12-08 01:20:16 +04:00
2014-06-24 00:01:19 +04:00
Brackets is at 1.0 and we're not stopping there. We have many feature ideas on our
2014-10-29 23:38:24 +03:00
[trello board ](http://bit.ly/BracketsTrelloBoard ) that we're anxious to add and other
2015-08-08 00:13:17 +03:00
innovative web development workflows that we're planning to build into Brackets.
So take Brackets out for a spin and let us know how we can make it your favorite editor.
2014-10-29 23:38:24 +03:00
2015-08-08 00:13:17 +03:00
You can see some
2012-05-02 23:28:49 +04:00
[screenshots of Brackets ](https://github.com/adobe/brackets/wiki/Brackets-Screenshots )
2013-07-25 05:15:46 +04:00
on the wiki, [intro videos ](http://www.youtube.com/user/CodeBrackets ) on YouTube, and news on the [Brackets blog ](http://blog.brackets.io/ ).
2012-05-02 23:28:49 +04:00
2015-08-08 00:13:17 +03:00
The text editor inside Brackets is based on
2014-10-02 22:57:15 +04:00
[CodeMirror ](http://github.com/codemirror/CodeMirror )— thanks to Marijn for
2015-08-08 00:13:17 +03:00
taking our pull requests, implementing feature requests and fixing bugs! See
2013-07-01 16:08:20 +04:00
[Notes on CodeMirror ](https://github.com/adobe/brackets/wiki/Notes-on-CodeMirror )
for info on how we're using CodeMirror.
2014-06-24 00:01:19 +04:00
# How to setup Bramble (Brackets) in your local machine
2016-02-20 00:56:22 +03:00
Step 1: Make sure you fork and clone [Bramble ](https://github.com/mozilla/brackets ).
2014-06-24 00:01:19 +04:00
```
$ git clone https://github.com/[yourusername]/brackets --recursive
```
2015-08-08 00:13:17 +03:00
Step 2: Install its dependencies
2014-06-24 00:01:19 +04:00
2015-08-08 00:13:17 +03:00
Navigate to the root of the directory you cloned and run:
2014-06-24 00:01:19 +04:00
```
$ npm install
```
2013-07-01 16:08:20 +04:00
2017-03-13 22:30:14 +03:00
NOTE: if you are running on Windows, and experience a build error with the `iltorb` package,
consider adding the `--no-optional` flag to have npm skip installing `iltorb` , which is optional
and requires python, gyp and a working c++ build environment.
See comment in https://github.com/mozilla/brackets/pull/588#issuecomment-280438175
2015-08-08 00:13:17 +03:00
Step 3: run the build
2016-01-19 02:57:22 +03:00
You can build Bramble by running the npm build task:
2015-08-08 00:13:17 +03:00
2014-06-24 00:01:19 +04:00
```
2016-01-19 02:57:22 +03:00
$ npm run build
2014-06-24 00:01:19 +04:00
```
2012-04-25 21:03:26 +04:00
2015-08-08 00:13:17 +03:00
Step 4: Run Bramble:
The easiest way to run Bramble is to simply use:
2014-06-24 00:01:19 +04:00
```
2015-08-08 00:13:17 +03:00
$ npm start
2014-06-24 00:01:19 +04:00
```
2012-04-25 21:03:26 +04:00
2017-06-15 20:15:33 +03:00
This will generate the strings needed for localization in your `src/nls` folder and allow you to access Bramble on `localhost:8000` (NOTE: you need npm version 5 for the cleanup step to run properly; if it doesn't, use `npm run unlocalize` to restore the files in `src/nls/**/*` ). It will also build the Bramble iframe API in dist/ if necessary. You can terminate the server with `Ctrl+C` which will also clean up the strings that were generated in your `src/nls` folder.
2017-04-17 18:19:25 +03:00
If you want to simply run the server without the localized strings, run:
```
$ npm run server
```
2013-05-16 00:49:50 +04:00
2015-08-08 00:13:17 +03:00
However, if you wish to run your own static server, there are several options available:
2014-06-24 00:01:19 +04:00
* [Apache Webserver ](http://www.apache.org/ )
* Host on [github pages ](https://help.github.com/articles/what-are-github-pages )
* [Python WebServer ](https://docs.python.org/2/library/simplehttpserver.html )
2013-05-16 00:49:50 +04:00
2015-08-11 02:34:17 +03:00
Assuming you have Bramble running on port `8000` . Now you can visit [http://localhost:8000/src ](http://localhost:8000/src ).
2013-05-16 00:49:50 +04:00
2016-03-01 21:03:48 +03:00
**NOTE 1:** Bramble expects to be run in an iframe, which hosts its filesystem. For local
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
development, use `src/hosted.html` instead of `src/index.html` . To see how the remote end
should host Bramble's iframe, see `src/hosted.js` .
2016-03-01 21:03:48 +03:00
**NOTE 2:** Using `npm run build` will overwrite contents in the `src/nls` folder. These changes are necessary if you access Bramble using [http://localhost:8000/src ](http://localhost:8000/src ). After using Bramble, you can undo the changes by running `npm run unlocalize` .
**NOTE 3:** To use Bramble in a production setting locally, you can run `npm run production` and access Bramble at [http://localhost:8000/dist ](http://localhost:8000/dist )
2017-04-06 22:07:16 +03:00
# Extension Loading
Bramble loads a set of extensions defined in `src/extensions/bramble-extensions.json` . You can
2017-04-07 18:28:13 +03:00
alter which extensions Bramble loads by adding or removing items from this list. You can also
temporarily disable extensions by using `?disableExtensions` . For example: to disable QuickView
and CSSCodeHints, load Bramble with `?disableExtensions=QuickView,CSSCodeHints` on the URL.
2015-05-13 21:12:56 +03:00
2014-06-24 00:01:19 +04:00
--------------
2012-04-25 21:03:26 +04:00
2014-06-24 00:01:19 +04:00
## After installation
2015-05-21 17:34:46 +03:00
2015-08-11 02:34:17 +03:00
After you have everything setup, you can now run the server you chose in the root of your local Bramble directory and see it in action by visiting [http://localhost:8000/src ](http://localhost:8000/src ).
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
# Bramble IFrame API
2017-04-08 22:41:07 +03:00
Bramble is designed to be run in an iframe, and the hosting web app to communicate with it
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
via `postMessage` and `MessageChannel` . In order to simplify this, a convenience API exists
for creating and managing the iframe, as well as providing JavaScript functions for interacting
with the editor, preview, etc.
## Loading the API
The hosting app must include the Bramble IFrame API (i.e., `dist/bramble.js` ). Note: in
development you can use `src/hosted.html` , which does this). This script can either be used as
an AMD module, or as a browser global:
```html
< script src = "bramble.js" > < / script >
< script >
// Option 1: AMD loading, assumes requirejs is loaded already
require(["bramble"], function(Bramble) {
...
});
// Option 2: Browser global
var Bramble = window.Bramble;
< / script >
```
## Bramble
The Bramble module has a number of methods, properties, and events. During its lifetime,
Bramble goes through a number of states, including:
* `Bramble.ERROR` - Bramble is in an error state
* `Bramble.NOT_LOADED` - Initial state, `Bramble.load()` has not been called
* `Bramble.LOADING` - `Bramble.load()` has been called, loading resources has begun
* `Bramble.MOUNTABLE` - Loading is done and `Bramble.mount()` can be begin, or is safe to start
* `Bramble.MOUNTING` - `Bramble.mount()` is being called, mounting is in process
* `Bramble.READY` - `Bramble.mount()` has finished, Bramble is fully ready
The current state of Bramble can be obtained by calling `Bramble.getReadyState()` . There are
also a number of events you can listen for (i.e., `Bramble` is an [`EventEmitter` ](https://github.com/Wolfy87/EventEmitter/ )):
```js
Bramble.once("ready", function(bramble) {
// bramble is the Bramble proxy instance, see below.
});
Bramble.on("error", function(err) {
// Bramble is in an error state, and `err` is the error.
})
Bramble.on("readyStateChange", function(previous, current) {
// Bramble's readyState changed from `previous` to `current`
});
```
2015-09-03 00:56:47 +03:00
NOTE: in some browsers (e.g., Firefox) when the user is in "Private Browsing"
mode, the filesystem (i.e., IndexedDB) will be inaccessible, and an error
will be sent via the `error` event (i.e., `err.code === "EFILESYSTEMERROR"` ). This
is the same error that occurs when the filesystem is corrupt (see `autoRecoverFileSystem` below).
2017-04-05 17:43:14 +03:00
## Bramble Offline Support
The Bramble code is offline capable, and will indicate, via events, when it is ready to be used offline, as well as
when there are updates available for existing offline cached resources. These events are triggered on `Bramble` vs.
the `bramble` instance. The offline related events include:
* `"offlineReady"` - triggered when Bramble has been fully cached for offline use. Users can safely work without network.
* `"updatesAvailable"` - triggered when new or updated Bramble resources have been cached and are available for use. You might use this to indicate to the user that they should refresh the page to begin using the updates.
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
## Bramble.getFileSystem()
The FileSystem is owned by the hosting application, and can be obtained at any time by calling:
```js
var fs = Bramble.getFileSystem();
```
This `fs` instance can be used to setup the filesystem for the Bramble editor prior to
loading. You can access things like `Path` and `Buffer` via `Bramble.Filer.*` .
2015-08-15 23:01:33 +03:00
## Bramble.formatFileSystem(callback)
WARNING: this **will** destroy data, and is meant to be used in the case that
the filesystem is corrupted (`err.code === "EFILESYSTEMERROR"`), or for when an
app wants to allow a user to wipe their disk.
```js
Bramble.on("error", function(err) {
if(err.code === "EFILESYSTEMERROR") {
Bramble.formatFileSystem(function(err) {
if(err) {
// Unable to create filesystem, fatal (and highly unlikely) error
} else {
// filesystem is now clean and empty, use Bramble.getFileSystem() to obtain instance
}
});
}
});
```
NOTE: you can turn this recovery behaviour on automatically by passing `autoRecoverFileSystem: true`
in the options to `Bramble.load()` .
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
## Bramble.load(elem[, options])
Once you have a reference to the `Bramble` object, you use it to starting loading the editor:
```js
// Start loading Bramble
Bramble.load("#webmaker-bramble");
Bramble.once("error", function(err) {
console.error("Bramble error", err);
});
```
The `elem` argument specifies which element in the DOM should be used to hold the iframe.
This element's contents will be replaced by the iframe. You can pass a selector, a reference
to an actual DOM element, or leave it blank, and `document.body` will be used.
The `options` object allows you to configure Bramble:
* `url` : `<String>` a URL to use when loading the Bramble iframe (defaults to prod)
* `locale` : `<String>` the locale Brackets should use
* `useLocationSearch` : `<Boolean>` whether to copy the window's location.search string to the iframe's url
* `extensions:` `<Object>` with the following optional properties
* `enable` : `<Array(String)>` a list of extensions to enable
* `disable` : `<Array(String)>` a list of extensions to disable
* `hideUntilReady` : `<Boolean>` whether to hide Bramble until it's fully loaded.
2015-06-23 21:56:58 +03:00
* `disableUIState` : `<Boolean>` by default, UI state is kept between sessions. This disables it (and clears old values), and uses the defaults from Bramble.
2015-08-15 23:01:33 +03:00
* `autoRecoverFileSystem` : `<Boolean>` whether to try and autorecover the filesystem on failure (see `Bramble.formatFileSystem` above).
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
* `debug` : `<Boolean>` whether to log debug info.
2017-06-08 17:40:56 +03:00
* `zipFilenamePrefix` : `<String>` the prefix name to use for project zip files, or `"thimble-project"` by default.
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
## Bramble.mount(root[, filename])
After calling `Bramble.load()` , you can tell Bramble which project root directory
to open, and which file to load into the editor. NOTE: the optional `filename` argument,
if provided, should be a relative path within the project root. Bramble will use this information
2015-08-08 00:13:17 +03:00
when it is ready to mount the filesystem. Use the `"ready"` event to get access to the
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
`bramble` instance:
```js
// Setup the filesystem while Bramble is loading
var fs = Bramble.getFileSystem();
Bramble.once("ready", function(bramble) {
// The bramble instance is now usable, see below.
});
fs.mkdir("/project", function(err) {
// If we run this multiple times, the dir will already exist
if (err & & err.code !== "EEXIST") {
throw err;
}
var html = "" +
"< html > \n" +
" < head > \n" +
" < title > Bramble</ title > \n" +
" </ head > \n" +
" < body > \n" +
" < p > Hello World</ p > \n" +
" </ body > \n" +
"< / html > ";
fs.writeFile("/project/index.html", html, function(err) {
if (err) {
throw err;
}
// Now that fs is setup, tell Bramble which root dir to mount
// and which file within that root to open on startup.
Bramble.mount("/project", "index.html");
});
});
```
## Bramble Instance Getters
Once the Bramble instance is created (e.g., via `ready` event or `Bramble.mount()` callback),
a number of read-only getters are available in order to access state information in the Bramble editor:
* `getID()` - returns the iframe element's `id` in the DOM
* `getIFrame()` - returns a reference to the iframe that hosts Bramble
* `getFullPath()` - returns the absolute path of the file currently being edited
* `getFilename()` - returns the filename portion (i.e., no dir info) of the file currently being edited
* `getPreviewMode()` - returns one of `"mobile"` or `"desktop"` , depending on current preview mode
* `getSidebarVisible()` - returns `true` or `false` depending on whether the sidebar (file tree) is visible
* `getLayout()` - returns an `Object` with three integer properties: `sidebarWidth` , `firstPaneWidth` , `secondPaneWidth` . The `firstPaneWidth` refers to the editor, where `secondPaneWidth` is the preview.
2015-08-06 17:14:15 +03:00
* `getRootDir()` - returns the project root directory to which Bramble is mounted
2015-06-23 21:56:58 +03:00
* `getTheme()` - returns the name of the current theme.
* `getFontSize()` - returns the current font size as a string (e.g., `"12px"` ).
2015-07-03 19:14:36 +03:00
* `getWordWrap()` - returns the current word wrap setting as a `Boolean` (i.e., enabled or disabled).
2017-04-08 22:41:07 +03:00
* `getAllowJavaScript()` - returns the current allow javascript setting as a `Boolean` (i.e., enabled or disabled).
2017-04-06 16:13:59 +03:00
* `getAutocomplete()` - returns the current autocomplete settings as a `Boolean` (i.e., enabled or disabled).
2017-02-22 02:02:14 +03:00
* `getAutoCloseTags()` - returns the current close tags setting as an `Object` with three properties: `whenOpening` a boolean that determines whether opening tags are closed upon typing ">", `whenClosing` a boolean that determines whether closing tags are closed upon typing "/", and an array of tags `indentTags` , that when opened, has a blank line. These values default to, respectively: `true` , `true` , and an empty array.
2015-07-23 22:15:53 +03:00
* `getTutorialExists()` - returns `true` or `false` depending on whether or not there is a tutorial in the project (i.e., if `tutorial.html` is present)
* `getTutorialVisible()` - returns `true` or `false` depending on whether or not the preview browser is showing a tutorial or not.
2017-02-28 08:18:03 +03:00
* `getAutoUpdate()` - returns `true` or `false` depending on whether or not the auto update preference is enabled or not.
2017-04-13 17:13:17 +03:00
* `getTotalProjectSize()` - returns the current project size in bytes.
* `hasIndexFile()` - returns `true` or `false` depending on whether or not there is an `"index.html"` file.
* `getFileCount()` - returns total file count.
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
**NOTE**: calling these getters before the `ready()` callback on the bramble instance
won't do what you want.
## Bramble Instance Methods
The Bramble instance has a number of methods you can call in order to interact with the
2015-07-02 23:21:45 +03:00
Bramble editor and preview, all of which take an optional `callback` argument if you want
to be notified when the action completes:
* `undo([callback])` - undo the last operation in the editor (waits for focus)
* `redo([callback])` - redo the last operation that was undone in the editor (waits for focus)
* `increaseFontSize([callback])` - increases the editor's font size
2017-04-08 22:41:07 +03:00
* `decreaseFontSize([callback])` - decreases the editor's font size
2015-07-02 23:21:45 +03:00
* `restoreFontSize([callback])` - restores the editor's font size to normal
* `save([callback])` - saves the current document
* `saveAll([callback])` - saves all "dirty" documents
* `useHorizontalSplitView([callback])` - splits the editor and preview horizontally
* `useVerticalSplitView([callback])` - splits the editor and preview vertically (default)
* `find([callback])` - opens the Find dialog to search within the current document
* `findInFiles([callback])` - opens the Find in Files dialog to search in all project files
* `replace([callback])` - opens the Replace dialog to replace text in the current document
* `replaceInFiles([callback])` - opens the Replace In Files dialog to replace text in all project files
* `useLightTheme([callback])` - sets the editor to use the light theme (default)
* `useDarkTheme([callback])` - sets the editor to use the dark theme
* `showSidebar([callback])` - opens the file tree sidebar
2017-03-20 23:53:19 +03:00
* `hideSidebar([callback])` - hides the file tree sidebar
2015-07-02 23:21:45 +03:00
* `showStatusbar([callback])` - enables and shows the statusbar
* `hideStatusbar([callback])` - disables and hides the statusbar
* `refreshPreview([callback])` - reloads the preview with the latest content in the editor and filesystem
* `useMobilePreview([callback])` - uses a Mobile view in the preview, as it would look on a smartphone
* `useDesktopPreview([callback])` - uses a Desktop view in the preview, as it would look on a desktop computer (default)
2015-11-20 22:20:47 +03:00
* `enableFullscreenPreview([callback])` - shows a fullscreen preview of the current file
2017-04-08 22:41:07 +03:00
* `disableFullscreenPreview([callback])` - turns off the fullscreen preview of the current file
2016-04-07 22:13:18 +03:00
* `enableAutoUpdate([callback])` - turns on auto-update for the preview (default)
2017-03-20 23:53:19 +03:00
* `disableAutoUpdate([callback])` - turns off auto-update for the preview (manual reloads still work)
2015-07-02 23:21:45 +03:00
* `enableJavaScript([callback])` - turns on JavaScript execution for the preview (default)
* `disableJavaScript([callback])` - turns off JavaScript execution for the preview
2015-11-26 17:39:12 +03:00
* `enableInspector([callback])` - turns on the preview inspector (shows code for hovered/clicked element)
* `disableInspector([callback])` - turns off the preview inspector (default)
2015-07-03 19:14:36 +03:00
* `enableWordWrap([callback])` - turns on word wrap for the editor (default)
* `disableWordWrap([callback])` - turns off word wrap for the editor
2017-02-22 02:02:14 +03:00
* `configureAutoCloseTags(options, [callback])` - enables/disables close tags for the editor using the provided options which consists of an `Object` that includes three properties: `whenOpening` a boolean, `whenClosing` a boolean, and an array `indentTags` .
2015-07-23 22:15:53 +03:00
* `showTutorial([callback])` - shows tutorial (i.e., tutorial.html) vs editor contents in preview
* `hideTutorial([callback])` - stops showing tutorial (i.e., tutorial.html) and uses editor contents in preview
2015-07-28 18:49:52 +03:00
* `showUploadFilesDialog([callback])` - shows the Upload Files dialog, allowing users to drag-and-drop, upload a file, or take a selfie.
2015-11-03 20:28:03 +03:00
* `addNewFile([options, callback])` - adds a new text file, using the provided options, which can include: `filename` a `String` with the complete filename to use; `contents` a `String` with the new text file's data; `ext` a `String` with the new file's extension; `basenamePrefix` a `String` with the basename to use when generating a new filename. NOTE: if you provide `filename` , `basenamePrefix` and `ext` are ignored.
2015-07-30 22:25:07 +03:00
* `addNewFolder([callback])` - adds a new folder.
2015-08-09 00:17:21 +03:00
* `export([callback])` - creates an archive `.zip` file of the entire project's filesystem, and downloads it to the browser.
2017-02-09 21:46:24 +03:00
* `addCodeSnippet(snippet, [callback])` - adds a new code `snippet` to the editor (if it is in focus) at the current cursor position. One required parameter (`snippet`) needs to be passed in which needs to be a `String` .
2017-04-11 22:33:41 +03:00
* `openSVGasXML([callback])` - treats `.svg` files as XML and shows them in the text editor.
* `openSVGasImage([callback])` - treats `.svg` files as Images and shows them in image viewer.
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
## Bramble Instance Events
The Bramble instance is also an [`EventEmitter` ](https://github.com/Wolfy87/EventEmitter/ ) and raises
the following events:
2017-04-08 22:41:07 +03:00
* `"layout"` - triggered whenever the sidebar, editor, or preview panes are changed. It includes an `Object` that returns the same information as the `getLayout()` getter: : `sidebarWidth` , `firstPaneWidth` , `secondPathWidth`
2015-11-26 17:39:12 +03:00
* `"activeEditorChange"` - triggered whenever the editor changes from one file to another. It includes an `Object` with the current file's `fullPath` and `filename` .
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
* `"previewModeChange"` - triggered whenever the preview mode is changed. It includes an `Object` with the new `mode`
* `"sidebarChange"` - triggered whenever the sidebar is hidden or shown. It includes an `Object` with a `visible` property set to `true` or `false`
2017-04-08 22:41:07 +03:00
* `"themeChange"` - triggered whenever the theme changes. It includes an `Object` with a `theme` property that indicates the new theme
2015-06-23 21:56:58 +03:00
* `"fontSizeChange"` - triggered whenever the font size changes. It includes an `Object` with a `fontSize` property that indicates the new size (e.g., `"12px"` ).
2015-07-03 19:14:36 +03:00
* `"wordWrapChange"` - triggered whenever the word wrap value changes. It includes an `Object` with a `wordWrap` property that indicates the new value (e.g., `true` or `false` ).
2017-04-08 22:41:07 +03:00
* `"allowJavaScriptChange"` - triggered whenever the allow javascript value changes. It includes an `Object` with a `allowJavaScript` property that indicates the new value (e.g., `true` or `false` ).
2017-02-22 02:02:14 +03:00
* `"autoCloseTagsChange"` - triggered whenever the close tag value changes. It includes an `Object` with a `autoCloseTags` property that indicates the new value
2015-07-23 22:15:53 +03:00
* `"tutorialAdded"` - triggered when a new tutorial is added to the project
* `"tutorialRemoved"` - triggered when an existing tutorial for the project is removed
* `"tutorialVisibilityChange"` - triggered when the tutorial preview is turned on or off. It includes an `Object` with a `visibility` property that indicates whether the tutorial is visible.
2015-11-26 17:39:12 +03:00
* `"inspectorChange"` - triggered whenever the inspector changes from enabled to disabled, or vice versa. It includes an `Object` with an `enabled` property set to `true` or `false` .
2017-02-28 08:18:03 +03:00
* `"autoUpdateChange"` - triggered whenever the auto update preference changes from enabled to disabled, or vice versa. It includes an `Object` with a `autoUpdate` property set to `true` or `false`
2017-03-20 19:03:58 +03:00
* `"projectDirty"` - triggered when one of the files in the project has been edited and those changes haven't been saved yet. It includes an `Object` with the `path` to the current file.
* `"projectSaved"` - triggered whenever the changes are saved to the filesystem in the browser are completed.
2017-05-31 19:02:07 +03:00
* `"dialogOpened"` - triggered whenever a modal dialog opens, like when a user is deleting a file.
* `"dialogClosed"` - triggered whenever a modal dialog closes.
2015-06-23 21:56:58 +03:00
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
There are also high-level events for changes to files:
* `"fileChange"` - triggered whenever a file is created or updated within the project root. It includes the `filename` of the file that changed.
* `"fileDelete"` - triggered whenever a file is deleted within the project root. It includes the `filename` of the file that was deleted.
* `"fileRename"` - triggered whenever a file is renamed within the project root. It includes the `oldFilename` and the `newFilename` of the file that was renamed.
2016-07-13 18:59:27 +03:00
* `"folderRename"` - triggered whenever a folder is renamed within the project root. It includes an object that looks something like this:
```js
{
oldPath: "/path/before/rename",
newPath: "/path/after/rename",
// Paths to all files contained inside the folder being renamed
children: [ "relativeFilePath1", "relativeFilePath2", ... ]
}
```
Remote MessageChannel filesystem working everywhere but Firefox
Trying to get Firefox to work, not there yet
Firefox working
Always call port.start() when using addEventListener
Everything working well for binary and utf8 data across browsers
Removed kamino.js, which we don't use for our MessageChannel shim.
Update README for hosted.html details
Use minified Filer in hosted.js
Use transferable, except in Blink
Add test for safe transfer of ArrayBuffer over MessageChannel (buggy in Chrome, possibly IE, Safari)
Fixes for jshint
Add fs.unlink and fs.rmdir, fix use of stats.isDirectory()
Rework remote callbacks for watch events
Go back to async blob url management
Remove debugger statement in BlobUtils
Break up BracketsFiler into RemoteFiler for circular ref fix (Path loading still wrong), mostly working
Working
Fix ownership of Path and Buffer, move to FilerUtils.js
Cache CSS files
Fix circular ref between BlobUtils and Handlers, move caching to FilerFileSystem
Fix small typos
Go back to async blob url management
Working iframe api
Make URL configurable, default to prod
Pass provider to Filer correctly
Add remote command layer
JSHint fixes after rebase
Hook-up mobile and desktop preview modes
Add stand-alone build step for bramble iframe api
Fix jshint for almond.js
Add some other common methods, add async handling for focus change
s/createInstance/getInstance/
Added docs to README on iframe api
Fixup styling in README
Update README for fs vs. fs()
Add showStatusbar() and hideStatusbar() with statusbar off by default
Fix review issues: option for using location.search from host, removed mime arg in HTMLRewriter
Don't try to minify node_modules in extensions/extra (breaking Jordan's build with MDNDocs)
Fix grunt/jshint/requirejs bugs related to build-browser, add loading spinner
Fix to README for dist/ method of using Bramble
Fix DOMContentLoaded issue and document.readyState
API state and events working
Updated docs, extra getters on API
Remove reference to passing provider to getInstance()
Reworking API for .load() and .mount(), sort of working
Everything working with load() and mount()
Update docs for load() and mount()
Fix typos in readme
Update docs, change readyState management, deal with rel/abs paths to mount()
Fix typo, update hosted.html to work with new api
Show sidebar if project file count > 1
Add fileChange, fileRename, and fileDelete events on bramble
Make sure first-pane has focus on startup, so text size +/- commands work
Missing semicolon
Get rid of callbacks on Bramble.mount()
Fix startup order so secondPaneWidth is known on ready, fix typo in README
jshint fix
2015-05-27 23:09:31 +03:00
2015-08-11 02:34:17 +03:00
NOTE: if you want to receive generic events for file system events, especially events across windows using the same file system, use [fs.watch() ](https://github.com/filerjs/filer#watch ) instead.