Skip to content

Commit

Permalink
Merge branch 'release/0.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
jagthedrummer committed Apr 14, 2011
2 parents 1141ffa + 72d1f09 commit 9bcf2c9
Show file tree
Hide file tree
Showing 159 changed files with 7,315 additions and 21,746 deletions.
3 changes: 2 additions & 1 deletion VERSION
@@ -1,2 +1,3 @@
0.0.4
0.0.5


12 changes: 11 additions & 1 deletion css/handmirror.css
@@ -1,10 +1,19 @@
.codemirror-ui-button-frame input,.codemirror-ui-button-frame label{
font-size:1.1em;
font-size:1em;
}

.codemirror-ui-button-frame{

}

.codemirror-ui-button-frame input[type=button]{
}


.activeline {background: #e5ecf9 !important;}


/*
.CodeMirror-line-numbers{
margin: .4em;
margin-right:0px;
Expand All @@ -25,3 +34,4 @@
padding-left:5px;
padding-right:5px;
}
*/
26 changes: 21 additions & 5 deletions dialog.htm
Expand Up @@ -3,11 +3,27 @@
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Source View (CodeMirror UI)</title>
<script type="text/javascript" src="../../tiny_mce_popup.js"></script>



<link href="js/codemirror-ui/lib/CodeMirror-2.0/lib/codemirror.css" media="screen" rel="stylesheet" type="text/css" />
<link href="js/codemirror-ui/lib/CodeMirror-2.0/mode/xml/xml.css" media="screen" rel="stylesheet" type="text/css" />
<link href="js/codemirror-ui/lib/CodeMirror-2.0/mode/css/css.css" media="screen" rel="stylesheet" type="text/css" />
<link href="js/codemirror-ui/lib/CodeMirror-2.0/mode/javascript/javascript.css" media="screen" rel="stylesheet" type="text/css" />
<link href="js/codemirror-ui/css/codemirror-ui.css" media="screen" rel="stylesheet" type="text/css" />


<script src="js/codemirror-ui/lib/CodeMirror-2.0/lib/codemirror.js" type="text/javascript"></script>
<script src="js/codemirror-ui/lib/CodeMirror-2.0/mode/xml/xml.js" type="text/javascript"></script>
<script src="js/codemirror-ui/lib/CodeMirror-2.0/mode/javascript/javascript.js" type="text/javascript"></script>
<script src="js/codemirror-ui/lib/CodeMirror-2.0/mode/css/css.js" type="text/javascript"></script>
<script src="js/codemirror-ui/lib/CodeMirror-2.0/mode/htmlmixes/htmlmixed.js" type="text/javascript"></script>

<script src="js/codemirror-ui/js/codemirror-ui.js" type="text/javascript"></script>

<script type="text/javascript" src="js/handmirror.js"></script>
<script src="js/codemirror-ui/lib/CodeMirror-0.93/js/codemirror.js" type="text/javascript"></script>
<script src="js/codemirror-ui/js/codemirror-ui.js" type="text/javascript"></script>
<link rel="stylesheet" href="js/codemirror-ui/css/codemirror-ui.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/handmirror.css" type="text/css" media="screen" />
<link href="css/handmirror.css" media="screen" rel="stylesheet" type="text/css" />

</head>
<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
<form name="source" onsubmit="saveContent();return false;" action="#">
Expand All @@ -17,7 +33,7 @@


<div id="areaWrap">
<textarea name="htmlSource" id="htmlSource" rows="14" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
<textarea name="htmlSource" id="htmlSource" rows="14" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace;" dir="ltr" wrap="off" class="mceFocus"></textarea>
</div>

<div class="mceActionPanel">
Expand Down
35 changes: 18 additions & 17 deletions js/codemirror-ui/README.md
Expand Up @@ -19,27 +19,28 @@ 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/', quickSearch : false }
var codeMirrorOptions = {
height: "250px",
content: textarea.value,
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
stylesheet: "lib/CodeMirror-0.93/css/jscolors.css",
path: "lib/CodeMirror-0.93/js/",
autoMatchParens: true
}
//then create the editor
var editor = new CodeMirrorUI(textarea,uiOptions,codeMirrorOptions); </pre>
//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
--------------------

<script src="lib/CodeMirror-0.93/js/codemirror.js" type="text/javascript"></script>
<script src="js/codemirror-ui.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/codemirror-ui.css" type="text/css" media="screen" />
// First the CodeMirror stuff
<script src="lib/CodeMirror-2.0/lib/codemirror.js" type="text/javascript"></script>
<link rel="stylesheet" href="lib/CodeMirror-2.0/lib/codemirror.css">
<script src="lib/CodeMirror-2.0/mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="lib/CodeMirror-2.0/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.

Expand Down
3 changes: 2 additions & 1 deletion js/codemirror-ui/VERSION
@@ -1,2 +1,3 @@
0.0.7
0.0.11


2 changes: 1 addition & 1 deletion js/codemirror-ui/css/codemirror-ui.css
Expand Up @@ -93,7 +93,7 @@ iframe{
float:left;
}

.CodeMirror-wrapping{
.CodeMirror{
border:1px solid #ccc;
border-top:0px;
background:white;
Expand Down
114 changes: 79 additions & 35 deletions js/codemirror-ui/index.html
Expand Up @@ -5,10 +5,15 @@

<title>CodeMirror UI | Test Page</title>

<script src="lib/CodeMirror-0.93/js/codemirror.js" type="text/javascript"></script>
<script src="lib/CodeMirror-2.0/lib/codemirror.js" type="text/javascript"></script>
<link rel="stylesheet" href="lib/CodeMirror-2.0/lib/codemirror.css">
<script src="lib/CodeMirror-2.0/mode/javascript/javascript.js"></script>
<link rel="stylesheet" href="lib/CodeMirror-2.0/mode/javascript/javascript.css">


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

<style type="text/css">
body{
background:#0d4664;
Expand Down Expand Up @@ -45,6 +50,8 @@
color:white;
}
</style>


</head>
<body>

Expand All @@ -58,9 +65,38 @@ <h1>CodeMirror UI</h1>
ComeMirrorUI 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.
</p>
<p>
This editor is enabled with the pop up find/replace widget.
</p>
<!--
<textarea id="code0" cols="120" rows="20">
// Here you see some JavaScript code. Mess around with it to get
// acquainted with CodeMirror's features.
// Press enter inside the object and your new line will be suitably
// indented.
var keyBindings = {
enter: "newline-and-indent",
tab: "reindent-selection",
ctrl_z: "undo",
ctrl_y: "redo",
ctrl_backspace: "undo-for-safari (which blocks ctrl-z)",
ctrl_bracket: "highlight-brackets",
ctrl_shift_bracket: "jump-to-matching-bracket"
};
// Press tab on the next line and the wrong indentation will be fixed.
var regex = /foo|bar/i;
function example(x) {
// Local variables get a different colour than global ones.
var y = 44.4;
return x + y - z;
}
</textarea>
-->

<textarea id="code1" cols="120" rows="20">
// Here you see some JavaScript code. Mess around with it to get
// acquainted with CodeMirror's features.
Expand Down Expand Up @@ -97,14 +133,7 @@ <h2>Easily Configurable</h2>
//first set up some variables
var textarea = document.getElementById('code1');
var uiOptions = { path : 'js/', searchMode : 'popup' }
var codeMirrorOptions = {
height: "250px",
content: textarea.value,
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
stylesheet: "lib/CodeMirror-0.93/css/jscolors.css",
path: "lib/CodeMirror-0.93/js/",
autoMatchParens: true
}
var codeMirrorOptions = { mode: "javascript" }

//then create the editor
var editor = new CodeMirrorUI(textarea,uiOptions,codeMirrorOptions); </pre>
Expand All @@ -126,7 +155,7 @@ <h3>Params for new CodeMirrorUI()</h3>
path - String - The path to the codemirror-ui js directory (relative to the current document).
</li>
<li>
searchMode - String - Options are 'inline', 'popup', or 'dialog'
searchMode - String - Options are 'inline' or 'popup'
</li>
<li>
buttons - Array - An array of button names that should be included in the button bar.
Expand All @@ -147,10 +176,17 @@ <h2>Installing</h2>
Then include a link to the stylesheet and javascript files in your document. Something like this:
</p>

<pre>
&lt;script src="lib/CodeMirror-0.93/js/codemirror.js" type="text/javascript"&gt;&lt;/script&gt;
<pre class="code">
// First the CodeMirror stuff
&lt;script src="lib/CodeMirror-2.0/lib/codemirror.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="lib/CodeMirror-2.0/lib/codemirror.css"&gt;
&lt;script src="lib/CodeMirror-2.0/mode/javascript/javascript.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="lib/CodeMirror-2.0/mode/javascript/javascript.css"&gt;

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

<p>
From there you can create an editor as shown above. It is especially easy to replace any calls to
Expand Down Expand Up @@ -197,7 +233,7 @@ <h2>Another example</h2>
</p>


<pre>
<pre class="code">
var uiOptions = {
path : 'js/',
searchMode = 'inline',
Expand All @@ -209,12 +245,6 @@ <h2>Another example</h2>
View the source of this page to see the actual code used to get these editors in action.
</p>

<h2>Known Issues</h2>

<p>
Some browsers (at least Google Chrome) don't allow windows launched from a document hosted at a file:// URL to communicate with each other.
The pop up find/replace widget will seem to be broken if you're viewing this page (or any page with CodeMirrorUI) directly from your local disk.
</p>

<h2>Find the code @ Github</h2>
<a href="https://github.com/jagthedrummer/codemirror-ui">https://github.com/jagthedrummer/codemirror-ui</a>
Expand All @@ -227,7 +257,25 @@ <h3><a href="http://codemirror.net/">Marijn Haverbeke - CodeMirror</a></h3>
</p>

<h3><a href="http://www.famfamfam.com/lab/icons/silk/">Mark James - Silk Icons</a></h3>
<p>
I used the Silk icon set from Mark James of <a href="http://www.famfamfam.com/">famfamfam.com</a> fame.
</p>

<h2>Versions</h2>
<p>
All version up to and including 0.0.7 are based on CodeMirror 1.
</p>
<p>
Versions 0.0.8 and newer are based on CodeMirror 2.
</p>
<h2>Known Usage</h2>
<p>
The following sites/apps are using CodeMirrorUI.
Please let me know if you'd like to be added to this list.
</p>
<ul>
<li><a href="http://www.webapeel.com/">aPeel</a></li>
</ul>
</div>


Expand All @@ -239,38 +287,34 @@ <h3><a href="http://www.famfamfam.com/lab/icons/silk/">Mark James - Silk Icons</


<script type="text/javascript">

/*
var textarea = document.getElementById('code0');
var myCodeMirror = CodeMirror.fromTextArea(textarea, {mode: "javascript"} );
*/

var textarea = document.getElementById('code1');
var editor = new CodeMirrorUI(textarea,
{
path : 'js/',
searchMode : 'popup'
},
{
height: "250px",
content: textarea.value,
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
stylesheet: "lib/CodeMirror-0.93/css/jscolors.css",
path: "lib/CodeMirror-0.93/js/",
autoMatchParens: true
mode: "javascript"
});


var textarea2 = document.getElementById('code2');
//CodeMirror.replace(textarea);

var editor2 = new CodeMirrorUI(textarea2,
{
path : 'js/',
searchMode : 'inline',
buttons : ['undo','redo','jump','reindent','about']
searchMode : 'inline',
buttons : ['undo','redo','jump','reindent','about']
},
{
height: "250px",
content: textarea.value,
parserfile: ["tokenizejavascript.js", "parsejavascript.js"],
stylesheet: "lib/CodeMirror-0.93/css/jscolors.css",
path: "lib/CodeMirror-0.93/js/",
autoMatchParens: true
mode: "javascript"
});

</script>
Expand Down

0 comments on commit 9bcf2c9

Please sign in to comment.