Created
June 10, 2016 10:30
-
-
Save Pan-Maciek/befaba870b2b6ed929edc4d0062b3452 to your computer and use it in GitHub Desktop.
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
var Editor = function(el){ | |
this.element = el | |
this.cursors = [] | |
this.lines = [] | |
this.creatLine = function (linenum){ | |
var that = this | |
var el = document.createElement("p") | |
el.addEventListener("click",function(){ | |
that.lines.push(el) | |
console.log(that.lines) | |
return that.lines | |
},true); | |
this.element.appendChild(el) | |
} | |
} | |
var edit | |
window.onload = function(){ | |
edit = new Editor(document.getElementsByClassName("editor")[0]) | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>edytor</title> | |
<link rel="stylesheet" href="style.css"> | |
<meta charset="utf-8"> | |
<script src="editor.js"></script> | |
</head> | |
<body> | |
<div class="editor"> | |
<p>abc</p> | |
</div> | |
</body> | |
</html> |
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
.editor { | |
background-color: #1f1f1f; | |
font-size: 25px; | |
color: #f1f1f1 | |
} | |
.editor p{ | |
min-height: 25px; | |
padding:0 2rem; | |
margin: 0; | |
} | |
body { | |
font-family: "consolas" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment