7ebce22300
Adding the ability to have syntax highlighted wiki (ie documentation) ex: <pre class="prettyprint"> int main() { cout << "test" << endl; } </pre>
11 lines
345 B
JavaScript
Executable File
11 lines
345 B
JavaScript
Executable File
$("textarea").keydown(function(e) {
|
|
var $this, end, start;
|
|
if (e.keyCode === 9) {
|
|
start = this.selectionStart;
|
|
end = this.selectionEnd;
|
|
$this = $(this);
|
|
$this.val($this.val().substring(0, start) + "\t" + $this.val().substring(end));
|
|
this.selectionStart = this.selectionEnd = start + 1;
|
|
return false;
|
|
}
|
|
}); |