Skip to content
Text recorder for textareas and text editors
JavaScript CSS
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
demo
dist
src
vendor/diff_patch Use uncompressed for build system
Makefile Makefile uses local path of Browserify and Watchify to avoid global i…
README.md
bower.json
package.json

README.md

recorder.js npm npm

A textual recorder for textareas and text editors

Usage

<script src="dist/recorder.min.js"></script>

Note: All recorder types are accessible via window.Recorder.

HTML Textarea

// Set up the recorder to track text changes
var recorder = new Recorder.TextAreaRecorder(HTMLTextAreaElement);

// Play the recording back into the supplied element (using 2x speed)
recorder.play(HTMLTextAreaElement, 2);

CodeMirror Editor

// editorInstance = CodeMirror(yourElement);

var recorder = new Recorder.CodeMirrorRecorder(editorInstance);

// Playback via another Codemirror instance or a textarea if you prefer (at 1x speed, by default)
recorder.play(anotherEditorInstance);

Ace Editor

// editorInstance = ace.edit(yourElement);

var recorder = new Recorder.AceRecorder(editorInstance);

// Playback via another Ace instance or a textarea if you prefer
recorder.play(anotherEditorInstance);

Additional commands

// Clear the last recording
recorder.clear()

// Get a JSON representation of the deltas
recorder.getRecording();

Contributing

This lib uses browserify to generate the browser bundle.

To get the environment set up:

  1. Fork this repo
  2. Run npm install within the root
  3. Run make to generate a distribution bundle and update the demo app demo/
  4. Run make watchify to have watchify rebundle the app while you write code

License

MIT

Something went wrong with that request. Please try again.