Loading static/application.js +7 −6 Original line number Diff line number Diff line ///// represents a single document // TODO change name to haste var heist_document = function() { this.locked = false; }; Loading Loading @@ -130,12 +132,14 @@ heist.prototype.lockDocument = function() { // Configure keyboard shortcuts for the textarea heist.prototype.configureShortcuts = function() { var _this = this; this.$textarea.keyup(function(evt) { $('body').keyup(function(evt) { // ^L or ^S for lock if (evt.ctrlKey && (evt.keyCode === 76 || evt.keyCode === 83)) { if (_this.$textarea.val().replace(/^\s+|\s+$/g, '') !== '') { evt.preventDefault(); _this.lockDocument(); } } // ^N for new document else if (evt.ctrlKey && evt.keyCode === 78) { evt.preventDefault(); Loading @@ -149,9 +153,6 @@ heist.prototype.configureShortcuts = function() { }); }; // TODO refuse to lock empty documents ///// Tab behavior in the textarea - 2 spaces per tab $(function() { Loading Loading
static/application.js +7 −6 Original line number Diff line number Diff line ///// represents a single document // TODO change name to haste var heist_document = function() { this.locked = false; }; Loading Loading @@ -130,12 +132,14 @@ heist.prototype.lockDocument = function() { // Configure keyboard shortcuts for the textarea heist.prototype.configureShortcuts = function() { var _this = this; this.$textarea.keyup(function(evt) { $('body').keyup(function(evt) { // ^L or ^S for lock if (evt.ctrlKey && (evt.keyCode === 76 || evt.keyCode === 83)) { if (_this.$textarea.val().replace(/^\s+|\s+$/g, '') !== '') { evt.preventDefault(); _this.lockDocument(); } } // ^N for new document else if (evt.ctrlKey && evt.keyCode === 78) { evt.preventDefault(); Loading @@ -149,9 +153,6 @@ heist.prototype.configureShortcuts = function() { }); }; // TODO refuse to lock empty documents ///// Tab behavior in the textarea - 2 spaces per tab $(function() { Loading