Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (59 sloc) 1.35 KB
<!doctype html>
<html>
<head>
<title>CodeMirror 2: Overlay Parser Demo</title>
<link rel="stylesheet" href="../lib/codemirror.css">
<link rel="stylesheet" href="../theme/default.css">
<link rel="stylesheet" href="../css/docs.css">
<script src="../lib/codemirror.js"></script>
<script src="../lib/overlay.js"></script>
<script src="../mode/xml/xml.js"></script>
<script src="lib/underscore.js"></script>
<script src="lib/underscore.utils.js"></script>
<script src="ca/contentAssistXmlModel.js"></script>
<script src="xml-placeholders.js"></script>
<style type="text/css">
.CodeMirror {
border: 1px solid black;
}
.cm-xml-attr-placeholder {
color: #0ca;
}
.ca-href {
background:yellow;
}
.ca-attr {
background:red;
}
</style>
</head>
<body>
<h1>CodeMirror 2: Overlay Parser Demo</h1>
<form>
<textarea id="code" name="code">
<html>
<body>
<a href="hello.html">Href example</a>
<div>
<p class="sdf">"These are links to {{things}}:</p>
</div>
</body>
</html>
</textarea>
</form>
<script>
contentAssistXmlModel.add({
token: 'attribute-value',
attrName: 'href',
returnToken: 'ca-href'
});
contentAssistXmlModel.add({
token: 'attribute',
returnToken: 'ca-attr'
});
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode : "xml-placeholders"
});
</script>
</body>
</html>