From aa781957e879eb39067bd938220eb9110046bd09 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Thu, 27 Sep 2012 13:46:09 -0400 Subject: [PATCH 1/6] Update Copyright --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 13cd745..3b3d1b7 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,7 @@ John Crepezzi (The MIT License) -Copyright © 2011 John Crepezzi +Copyright © 2011-2012 John Crepezzi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in From 08d37cc7f7b013d8572dd4568583874578343957 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Mon, 22 Oct 2012 14:40:52 -0400 Subject: [PATCH 2/6] Added support section --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3b3d1b7..af482ab 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,14 @@ to do things like: which will output a URL to share containing the contents of `cat something`'s STDOUT. Check the README there for more details and usages. +## Support + +Please consider paying what you feel this project is worth: + + + Pay + + ## Tested Browsers * Firefox 8 From 54e55b1b0d4ebd5c3a1cc838f11046733483b19f Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Wed, 19 Dec 2012 08:12:08 -0500 Subject: [PATCH 3/6] Added JSON to extension map (JS) Closes #28 --- static/application.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/application.js b/static/application.js index 7afb014..9b26ee1 100644 --- a/static/application.js +++ b/static/application.js @@ -168,7 +168,7 @@ haste.extensionMap = { lua: 'lua', pas: 'delphi', java: 'java', cpp: 'cpp', cc: 'cpp', m: 'objectivec', vala: 'vala', cs: 'cs', sql: 'sql', sm: 'smalltalk', lisp: 'lisp', ini: 'ini', diff: 'diff', bash: 'bash', sh: 'bash', tex: 'tex', erl: 'erlang', hs: 'haskell', - md: 'markdown', txt: '', coffee: 'coffee' + md: 'markdown', txt: '', coffee: 'coffee', json: 'js' }; // Look up the extension preferred for a type From 46bdd2743151d9b44a53df1124fde3e4beea57ff Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Wed, 19 Dec 2012 08:17:52 -0500 Subject: [PATCH 4/6] Fix for type name ;) Closes #28 --- static/application.js | 2 +- static/application.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/application.js b/static/application.js index 9b26ee1..37f7757 100644 --- a/static/application.js +++ b/static/application.js @@ -168,7 +168,7 @@ haste.extensionMap = { lua: 'lua', pas: 'delphi', java: 'java', cpp: 'cpp', cc: 'cpp', m: 'objectivec', vala: 'vala', cs: 'cs', sql: 'sql', sm: 'smalltalk', lisp: 'lisp', ini: 'ini', diff: 'diff', bash: 'bash', sh: 'bash', tex: 'tex', erl: 'erlang', hs: 'haskell', - md: 'markdown', txt: '', coffee: 'coffee', json: 'js' + md: 'markdown', txt: '', coffee: 'coffee', json: 'javascript' }; // Look up the extension preferred for a type diff --git a/static/application.min.js b/static/application.min.js index 30e33d9..048851b 100644 --- a/static/application.min.js +++ b/static/application.min.js @@ -1 +1 @@ -var haste_document=function(){this.locked=!1};haste_document.prototype.htmlEscape=function(e){return e.replace(/&/g,"&").replace(/>/g,">").replace(/'+e+"");$("#messages").prepend(n),setTimeout(function(){n.slideUp("fast",function(){$(this).remove()})},3e3)},haste.prototype.lightKey=function(){this.configureKey(["new","save"])},haste.prototype.fullKey=function(){this.configureKey(["new","duplicate","twitter","raw"])},haste.prototype.configureKey=function(e){var t,n=0;$("#box2 .function").each(function(){t=$(this);for(n=0;n";$("#linenos").html(t)},haste.prototype.removeLineNumbers=function(){$("#linenos").html(">")},haste.prototype.loadDocument=function(e){var t=e.split(".",2),n=this;n.doc=new haste_document,n.doc.load(t[0],function(e){e?(n.$code.html(e.value),n.setTitle(e.key),n.fullKey(),n.$textarea.val("").hide(),n.$box.show().focus(),n.addLineNumbers(e.lineCount)):n.newDocument()},this.lookupTypeByExtension(t[1]))},haste.prototype.duplicateDocument=function(){if(this.doc.locked){var e=this.doc.data;this.newDocument(),this.$textarea.val(e)}},haste.prototype.lockDocument=function(){var e=this;this.doc.save(this.$textarea.val(),function(t,n){if(t)e.showMessage(t.message,"error");else if(n){e.$code.html(n.value),e.setTitle(n.key);var r="/"+n.key;n.language&&(r+="."+e.lookupExtensionByType(n.language)),window.history.pushState(null,e.appName+"-"+n.key,r),e.fullKey(),e.$textarea.val("").hide(),e.$box.show().focus(),e.addLineNumbers(n.lineCount)}})},haste.prototype.configureButtons=function(){var e=this;this.buttons=[{$where:$("#box2 .save"),label:"Save",shortcutDescription:"control + s",shortcut:function(e){return e.ctrlKey&&e.keyCode===83},action:function(){e.$textarea.val().replace(/^\s+|\s+$/g,"")!==""&&e.lockDocument()}},{$where:$("#box2 .new"),label:"New",shortcut:function(e){return e.ctrlKey&&e.keyCode===78},shortcutDescription:"control + n",action:function(){e.newDocument(!e.doc.key)}},{$where:$("#box2 .duplicate"),label:"Duplicate & Edit",shortcut:function(t){return e.doc.locked&&t.ctrlKey&&t.keyCode===68},shortcutDescription:"control + d",action:function(){e.duplicateDocument()}},{$where:$("#box2 .raw"),label:"Just Text",shortcut:function(e){return e.ctrlKey&&e.shiftKey&&e.keyCode===82},shortcutDescription:"control + shift + r",action:function(){window.location.href="/raw/"+e.doc.key}},{$where:$("#box2 .twitter"),label:"Twitter",shortcut:function(t){return e.options.twitter&&e.doc.locked&&t.ctrlKey&&t.keyCode==84},shortcutDescription:"control + t",action:function(){window.open("https://twitter.com/share?url="+encodeURI(window.location.href))}}];for(var t=0;t/g,">").replace(/'+e+"");$("#messages").prepend(n),setTimeout(function(){n.slideUp("fast",function(){$(this).remove()})},3e3)},haste.prototype.lightKey=function(){this.configureKey(["new","save"])},haste.prototype.fullKey=function(){this.configureKey(["new","duplicate","twitter","raw"])},haste.prototype.configureKey=function(e){var t,n=0;$("#box2 .function").each(function(){t=$(this);for(n=0;n";$("#linenos").html(t)},haste.prototype.removeLineNumbers=function(){$("#linenos").html(">")},haste.prototype.loadDocument=function(e){var t=e.split(".",2),n=this;n.doc=new haste_document,n.doc.load(t[0],function(e){e?(n.$code.html(e.value),n.setTitle(e.key),n.fullKey(),n.$textarea.val("").hide(),n.$box.show().focus(),n.addLineNumbers(e.lineCount)):n.newDocument()},this.lookupTypeByExtension(t[1]))},haste.prototype.duplicateDocument=function(){if(this.doc.locked){var e=this.doc.data;this.newDocument(),this.$textarea.val(e)}},haste.prototype.lockDocument=function(){var e=this;this.doc.save(this.$textarea.val(),function(t,n){if(t)e.showMessage(t.message,"error");else if(n){e.$code.html(n.value),e.setTitle(n.key);var r="/"+n.key;n.language&&(r+="."+e.lookupExtensionByType(n.language)),window.history.pushState(null,e.appName+"-"+n.key,r),e.fullKey(),e.$textarea.val("").hide(),e.$box.show().focus(),e.addLineNumbers(n.lineCount)}})},haste.prototype.configureButtons=function(){var e=this;this.buttons=[{$where:$("#box2 .save"),label:"Save",shortcutDescription:"control + s",shortcut:function(e){return e.ctrlKey&&e.keyCode===83},action:function(){e.$textarea.val().replace(/^\s+|\s+$/g,"")!==""&&e.lockDocument()}},{$where:$("#box2 .new"),label:"New",shortcut:function(e){return e.ctrlKey&&e.keyCode===78},shortcutDescription:"control + n",action:function(){e.newDocument(!e.doc.key)}},{$where:$("#box2 .duplicate"),label:"Duplicate & Edit",shortcut:function(t){return e.doc.locked&&t.ctrlKey&&t.keyCode===68},shortcutDescription:"control + d",action:function(){e.duplicateDocument()}},{$where:$("#box2 .raw"),label:"Just Text",shortcut:function(e){return e.ctrlKey&&e.shiftKey&&e.keyCode===82},shortcutDescription:"control + shift + r",action:function(){window.location.href="/raw/"+e.doc.key}},{$where:$("#box2 .twitter"),label:"Twitter",shortcut:function(t){return e.options.twitter&&e.doc.locked&&t.ctrlKey&&t.keyCode==84},shortcutDescription:"control + t",action:function(){window.open("https://twitter.com/share?url="+encodeURI(window.location.href))}}];for(var t=0;t Date: Sun, 23 Dec 2012 10:53:53 -0500 Subject: [PATCH 5/6] Added shift modifier to twitter shortcut Closes #29 --- static/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/application.js b/static/application.js index 37f7757..c90648f 100644 --- a/static/application.js +++ b/static/application.js @@ -308,9 +308,9 @@ haste.prototype.configureButtons = function() { $where: $('#box2 .twitter'), label: 'Twitter', shortcut: function(evt) { - return _this.options.twitter && _this.doc.locked && evt.ctrlKey && evt.keyCode == 84; + return _this.options.twitter && _this.doc.locked && evt.shiftKey && evt.ctrlKey && evt.keyCode == 84; }, - shortcutDescription: 'control + t', + shortcutDescription: 'control + shift + t', action: function() { window.open('https://twitter.com/share?url=' + encodeURI(window.location.href)); } From e37c3cf1b9c5593985f11130267cfc8b1c17d839 Mon Sep 17 00:00:00 2001 From: naftis Date: Fri, 28 Dec 2012 16:11:21 +0200 Subject: [PATCH 6/6] Bugfix to solarized_dark.css Fixed bug with font-style: italic and WebKit. WebKit makes line-height bigger, when italic is used. --- static/solarized_dark.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/solarized_dark.css b/static/solarized_dark.css index 264be88..ffa070d 100644 --- a/static/solarized_dark.css +++ b/static/solarized_dark.css @@ -17,6 +17,8 @@ pre .lisp .string, pre .javadoc { color: #586e75; font-style: italic; + display: inline-block; + line-height: 1em; } pre .keyword,