diff --git a/static/application.css b/static/application.css index 70458c0..c2155b1 100644 --- a/static/application.css +++ b/static/application.css @@ -25,7 +25,7 @@ textarea { #linenos { color: #7d7d7d; - z-index: -1000; + /*z-index: -1000;*/ position: absolute; top: 20px; left: 0px; @@ -40,9 +40,9 @@ textarea { /* display: block;*/ } -.line:hover { +/*.line:hover { background-color: #cbd387; -} +}*/ .lineHighlight { background-color: yellow; diff --git a/static/application.js b/static/application.js index d951f92..58774d2 100644 --- a/static/application.js +++ b/static/application.js @@ -42,17 +42,17 @@ haste_document.prototype.load = function(key, callback, lang) { } var currentLine = i + 1; + var spanClass = ""; if ( currentLine >= selectedLines.startLine && currentLine <= selectedLines.endLine ) { - highlighted = - "" + highlighted + ""; + spanClass = "lineHighlight"; } - highlighted = "" + highlighted + ""; + highlighted = "" + highlighted + ""; high.value += highlighted + "\n"; } - // scroll to position in document after ensuring components h"ve had time to render + //// scroll to position in document after ensuring components h"ve had time to render setTimeout(function() { // show current line and the one before it if (selectedLines.startLine >= 3) { @@ -217,11 +217,11 @@ haste.prototype.lookupTypeByExtension = function(ext) { }; // Add line numbers to the document -// For the specified number of lines +// For the specified number of lines, each with a class and id haste.prototype.addLineNumbers = function(lineCount) { var h = ''; for (var i = 0; i < lineCount; i++) { - h += (i + 1).toString() + '
'; + h += '' + (i + 1) + '
'; } $('#linenos').html(h); }; diff --git a/static/index.html b/static/index.html index 59988bb..fce2b27 100644 --- a/static/index.html +++ b/static/index.html @@ -15,8 +15,16 @@