• Stars
    star
    143
  • Rank 256,064 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple UI for the CodeMirror text editor.

CodeMirror UI

CodeMirrorUI is a simple interface written by Jeremy Green to act as a wrapper around the CodeMirror text editor widget by Marijn Haverbeke. CodeMirror is a syntax highlighter and formatter that makes it much easier to edit source code in a browser. CodeMirrorUI is a wrapper that adds interface functionality for many functions that are already built into CodeMirror itself. Functionality includes undo, redo, jump to line, reindent selection, and reindent entire document. Two options for find/replace are also available. It is based on the MirrorFrame example that Marijn included with CodeMirror.

Code Climate

Demo

http://jagthedrummer.github.io/codemirror-ui/

Upgrading

Note Starting with version 0.0.17 CodeMirror-UI upgraded to CodeMirror-2.3. The find and replace functionality relies on the searchcursor add-on for CodeMirror. Make sure to add the searchcursor line from the installation instructions if the search/replace is not working.

Easily Configurable

It's easy to configure an editor with something like this:

//first set up some variables
var textarea = document.getElementById('code1');
var uiOptions = { path : 'js/', searchMode: 'popup' }
var codeMirrorOptions = {
    mode: "javascript" // all your normal CodeMirror options go here
}

//then create the editor
var editor = new CodeMirrorUI(textarea,uiOptions,codeMirrorOptions);

Installation

// First the CodeMirror stuff
<script src="lib/CodeMirror-2.3/lib/codemirror.js" type="text/javascript"></script>
<script src="lib/CodeMirror-2.3/lib/util/searchcursor.js" type="text/javascript"></script>
<link rel="stylesheet" href="lib/CodeMirror-2.3/lib/codemirror.css">
<script src="lib/CodeMirror-2.3/mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="lib/CodeMirror-2.3/mode/javascript/javascript.css">

//Then the CodeMirrorUI stuff
<script src="js/codemirror-ui.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/codemirror-ui.css" type="text/css" media="screen" />

You'll probably need to adjust the paths to fit your situation.

Please see index.html for examples and many additional details.

Acknowledgements

Thanks to Marijn Haverbeke for creating and releasing CodeMirror in the first place.
Without his excellent contribution to the community this project would have no reason to exist.

Thanks to Mark James of famfamfam.com for his Silk Icons.

License

CodeMirror UI is provided under the MIT License. See the LICENSE file for full details.

More Repositories

1

canary-ember

An ember front end to data produced by canary.io
JavaScript
16
star
2

serverlessDynamoCrudExample

An example of doing RESTful CRUD on AWS Api-Gateway, Lambda, and DynamoDB with the serverless project
JavaScript
15
star
3

so_auth

A Rails Engine for turning any Rails app into a client for so_auth_provider
Ruby
13
star
4

so_auth_provider

An example of an OAuth provider in Rails.
Ruby
11
star
5

so_auth_client

An example client that uses the so_auth gem to authenticate with so_auth_provider.
Ruby
8
star
6

payola_spy

A quick and dirty Rails engine for watching Payola payment activity. (Currently only shows subscription and webhook activity.)
Ruby
7
star
7

trace_graph

Get visibility into the control flow within your ruby application
Ruby
6
star
8

polaris_view_helpers

Rails view helpers for Shopify Polaris
HTML
4
star
9

FancyForm

FancyForm replaces HTML checkboxes and radio buttons with image based variants.
JavaScript
4
star
10

handmirror

A plugin for TinyMCE that allows source view editing with codemirror-ui.
JavaScript
3
star
11

fancy-tabs

A tab system for scriptaculous and prototype.js
JavaScript
3
star
12

ember-cli-deploy-github-pages

A plugin for ember-cli-deploy that allow for deployment to github pages.
JavaScript
2
star
13

lightwindow

An updated version of Lightwindow 2.0 from stickmanlabs
JavaScript
2
star
14

serverless-dynamo-crud-example

An Ember app to drive a serverless REST api
JavaScript
2
star
15

lightbox3

An updated version of Lightbox2 from Lokesh Dhaka
JavaScript
2
star
16

FancyFormPrototype

A port of the FancyForm javascript library to run on Prototype instead of MooTools.
JavaScript
2
star
17

yahooweather

A fork of the yahoo weather project to allow parsing of weather data via FasterXMLSimple.
Ruby
1
star
18

slownatra

Sinatra. Only the slow jams.
HTML
1
star
19

phocoder-rails

A rails plugin for phocoder.
Ruby
1
star
20

background_smackdown

Ruby
1
star
21

phocoder-rb-rails-example

An example of using the phocoder-rb gem in a rails project
Ruby
1
star
22

CamanJS-CompositeOps

A collection of additional layer blending modes for CamanJS
JavaScript
1
star
23

going_serverless

1
star
24

phocoder-rb

The ruby client for the phocoder.com API
Ruby
1
star
25

accordion

accorion.js is a javascript file to provide animated accordions using prototype and scriptaculous.
JavaScript
1
star
26

ember-cli-bootstrap-sass

A demonstration of using bootstrap-sass-official with ember-cli and broccoli.
JavaScript
1
star
27

sls-kinesis-test

A small serverless project for testing AWS Kinesis + Lambda
JavaScript
1
star
28

jeweler-test-gem

Just a test
Ruby
1
star