Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>CodeMirror 2: Breakpoint Demo</title> | ||
<link rel="stylesheet" href="../lib/codemirror.css"> | ||
<script src="../lib/codemirror.js"></script> | ||
<link rel="stylesheet" href="../mode/javascript/javascript.css"> | ||
<script src="../mode/javascript/javascript.js"></script> | ||
|
||
<style type="text/css"> | ||
.CodeMirror-gutter { | ||
width: 3em; | ||
background: white; | ||
} | ||
.CodeMirror { | ||
border: 1px solid #aaa; | ||
} | ||
</style> | ||
</head> | ||
<body style="max-width: 70em; margin-left: 2em; font-family: tahoma, arial, sans-serif;"> | ||
<h1>CodeMirror 2: Breakpoint demo</h1> | ||
|
||
<form><textarea id="code" name="code"> | ||
CodeMirror.fromTextArea(document.getElementById("code"), { | ||
lineNumbers: true, | ||
onGutterClick: function(cm, n) { | ||
var info = cm.lineInfo(n); | ||
if (info.markerText) | ||
cm.clearMarker(n); | ||
else | ||
cm.setMarker(n, "<span style=\"color: #900\">●</span> %N%"); | ||
} | ||
}); | ||
</textarea></form> | ||
|
||
<p>Click the line-number gutter to add or remove 'breakpoints'.</p> | ||
|
||
<script> | ||
CodeMirror.fromTextArea(document.getElementById("code"), { | ||
lineNumbers: true, | ||
onGutterClick: function(cm, n) { | ||
var info = cm.lineInfo(n); | ||
if (info.markerText) | ||
cm.clearMarker(n); | ||
else | ||
cm.setMarker(n, "<span style=\"color: #900\">●</span> %N%"); | ||
} | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |