This repository was archived by the owner on Mar 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathide.js
More file actions
42 lines (38 loc) · 1.47 KB
/
ide.js
File metadata and controls
42 lines (38 loc) · 1.47 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
// function newproject() {
// window.location.href = "createProject.html"
// }
// var chain;
// .on('value', function(snapshot) {
// var content = ""
// chain = snapshot.val()["chain"]
// console.log(chain)
// for (var i in snapshot.val()["chain"]) {
// content += snapshot.val()["dict"][snapshot.val()["chain"][i]]
// }
// document.getElementById("editor").value = content;
// })
// document.getElementById("editor").value = content;
// firebase.auth().onAuthStateChanged(function(user) {
// if (user) {
// });
// } else {
// window.location.href = "index.html";
// }
// });
// function ups(e) {
// var hashes = window.location.hash.substring(1).split("#");
// var keycode = e.keyCode;
// var valid =
// (keycode > 47 && keycode < 58) || // number keys
// keycode == 32 || keycode == 13 || // spacebar & return key(s) (if you want to allow carriage returns)
// (keycode > 64 && keycode < 91) || // letter keys
// (keycode > 95 && keycode < 112) || // numpad keys
// (keycode > 185 && keycode < 193) || // ;=,-./` (in order)
// (keycode > 218 && keycode < 223); // [\]' (in order)
//
// if (valid) {
// var selstart = document.getElementById("editor").selectionStart
// console.log(selstart)
// firebase.database().ref("users/"+firebase.auth().currentUser.uid + "/"+hashes[0]+"/"+hashes[1]+"/history").set(JSON.parse('{"()add'+chain[selstart-2]+' '+chain[selstart]+' '+e.key+'": true}'));
// }
// }