Added support for raw button

This commit is contained in:
John Crepezzi 2012-01-10 23:06:44 -05:00
parent b251978422
commit 844a2efb02
4 changed files with 17 additions and 6 deletions

View File

@ -140,9 +140,9 @@ textarea {
#box2 .function.enabled.duplicate { background-position: -79px center; } #box2 .function.enabled.duplicate { background-position: -79px center; }
#box2 .function.enabled.duplicate:hover { background-position: -79px bottom; } #box2 .function.enabled.duplicate:hover { background-position: -79px bottom; }
#box2 .function.link { background-position: -116px top; } #box2 .function.raw { background-position: -116px top; }
#box2 .function.enabled.link { background-position: -116px center; } #box2 .function.enabled.raw { background-position: -116px center; }
#box2 .function.enabled.link:hover { background-position: -116px bottom; } #box2 .function.enabled.raw:hover { background-position: -116px bottom; }
#box2 .function.twitter { background-position: -153px top; } #box2 .function.twitter { background-position: -153px top; }
#box2 .function.enabled.twitter { background-position: -153px center; } #box2 .function.enabled.twitter { background-position: -153px center; }

View File

@ -88,7 +88,6 @@ haste_document.prototype.save = function(data, callback) {
var haste = function(appName, options) { var haste = function(appName, options) {
this.appName = appName; this.appName = appName;
this.baseUrl = window.location.href; // since this is loaded first
this.$textarea = $('textarea'); this.$textarea = $('textarea');
this.$box = $('#box'); this.$box = $('#box');
this.$code = $('#box code'); this.$code = $('#box code');
@ -124,7 +123,7 @@ haste.prototype.lightKey = function() {
// Show the full key // Show the full key
haste.prototype.fullKey = function() { haste.prototype.fullKey = function() {
this.configureKey(['new', 'duplicate', 'twitter', 'link']); this.configureKey(['new', 'duplicate', 'twitter', 'raw']);
}; };
// Set the key up for certain things to be enabled // Set the key up for certain things to be enabled
@ -293,6 +292,17 @@ haste.prototype.configureButtons = function() {
_this.duplicateDocument(); _this.duplicateDocument();
} }
}, },
{
$where: $('#box2 .raw'),
label: 'Just Text',
shortcut: function(evt) {
return evt.ctrlKey && evt.shiftKey && evt.keyCode === 82;
},
shortcutDescription: 'control + shift + r',
action: function() {
window.open('/raw/' + _this.doc.key);
}
},
{ {
$where: $('#box2 .twitter'), $where: $('#box2 .twitter'),
label: 'Twitter', label: 'Twitter',

File diff suppressed because one or more lines are too long

View File

@ -50,6 +50,7 @@
<div class="save function"></div> <div class="save function"></div>
<div class="new function"></div> <div class="new function"></div>
<div class="duplicate function"></div> <div class="duplicate function"></div>
<div class="raw function"></div>
<div class="twitter function"></div> <div class="twitter function"></div>
</div> </div>
<div id="box3" style="display:none;"> <div id="box3" style="display:none;">