-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirepad.html
More file actions
57 lines (47 loc) · 1.77 KB
/
firepad.html
File metadata and controls
57 lines (47 loc) · 1.77 KB
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
<!doctype html>
<!-- See http://www.firepad.io/docs/ for detailed embedding docs. -->
<html>
<head>
<meta charset="utf-8" />
<!-- Firebase -->
<script src="https://cdn.firebase.com/js/client/2.0.2/firebase.js"></script>
<!-- ACE and its JavaScript mode and theme files -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/theme-textmate.js"></script>
<!-- Firepad -->
<link rel="stylesheet" href="https://cdn.firebase.com/libs/firepad/1.1.0/firepad.css" />
<script src="https://cdn.firebase.com/libs/firepad/1.1.0/firepad.min.js"></script>
<style>
html { height: 100%; }
body { margin: 0; height: 100%; position: relative; }
/* Height / width / positioning can be customized for your use case.
For demo purposes, we make firepad fill the entire browser. */
#firepad-container {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="firepad-container"></div>
<script>
function init() {
//// Initialize Firebase.
var firepadRef = new Firebase('https://intense-torch-1276.firebaseio.com');
//// Create ACE
var editor = ace.edit("firepad-container");
editor.setTheme("ace/theme/textmate");
var session = editor.getSession();
session.setUseWrapMode(true);
session.setUseWorker(false);
session.setMode("ace/mode/java");
//// Create Firepad.
var firepad = Firepad.fromACE(firepadRef, editor, {
defaultText: 'public class Class {\n public static void main(String[] args) {\n\n}\n}'
});
}
window.onload = init;
</script>
</body>
</html>