-
Notifications
You must be signed in to change notification settings - Fork 0
/
myEditor.html
77 lines (64 loc) · 2.61 KB
/
myEditor.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CodeMirror: Search/Replace Demo</title>
<link rel="stylesheet" href="http://codemirror.net//lib/codemirror.css">
<script src="http://codemirror.net//lib/codemirror.js"></script>
<script src="http://codemirror.net//mode/xml/xml.js"></script>
<script src="http://codemirror.net//addon/dialog/dialog.js"></script>
<link rel="stylesheet" href="http://codemirror.net//addon/dialog/dialog.css">
<script src="http://codemirror.net//addon/search/searchcursor.js"></script>
<script src="http://codemirror.net//addon/search/search.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/arta.min.css">
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
<script>
function MainCTRL($scope) {
$scope.dirs = [{ name: "app", type: "dir", items: ["a_file.rb"]}]
$scope.file_contents = {
"a_file.rb": "<html>\n\n\n\n<head>"
}
$scope.current_contents = $scope.file_contents["a_file.rb"]
$scope.editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "text/html", lineNumbers: true});
$scope.editor.setValue($scope.current_contents)
}
</script>
</head>
<style type="text/css">
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
dt {font-family: monospace; color: #666;}
</style>
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<a class="brand" href="#">RapidEdit</a>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</div>
<div ng-app>
<div ng-controller="MainCTRL">
<div class="span2">
<div ng-repeat="dir in dirs">
<i ng-show="dir.type == 'dir'" class="icon-folder-close"></i>
{{dir.name}}
<div style="margin-left: 20px" ng-repeat="item in dir.items">
{{item}}
</div>
</div>
</div>
<div class="span9">
<form><textarea id="code" name="code"></textarea></form>
</div>
</div>
</div>
</body>
</html>