mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-12-24 02:56:59 +00:00
Added support for raw button
This commit is contained in:
parent
b251978422
commit
844a2efb02
4 changed files with 17 additions and 6 deletions
|
@ -140,9 +140,9 @@ textarea {
|
|||
#box2 .function.enabled.duplicate { background-position: -79px center; }
|
||||
#box2 .function.enabled.duplicate:hover { background-position: -79px bottom; }
|
||||
|
||||
#box2 .function.link { background-position: -116px top; }
|
||||
#box2 .function.enabled.link { background-position: -116px center; }
|
||||
#box2 .function.enabled.link:hover { background-position: -116px bottom; }
|
||||
#box2 .function.raw { background-position: -116px top; }
|
||||
#box2 .function.enabled.raw { background-position: -116px center; }
|
||||
#box2 .function.enabled.raw:hover { background-position: -116px bottom; }
|
||||
|
||||
#box2 .function.twitter { background-position: -153px top; }
|
||||
#box2 .function.enabled.twitter { background-position: -153px center; }
|
||||
|
|
|
@ -88,7 +88,6 @@ haste_document.prototype.save = function(data, callback) {
|
|||
|
||||
var haste = function(appName, options) {
|
||||
this.appName = appName;
|
||||
this.baseUrl = window.location.href; // since this is loaded first
|
||||
this.$textarea = $('textarea');
|
||||
this.$box = $('#box');
|
||||
this.$code = $('#box code');
|
||||
|
@ -124,7 +123,7 @@ haste.prototype.lightKey = function() {
|
|||
|
||||
// Show the full key
|
||||
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
|
||||
|
@ -293,6 +292,17 @@ haste.prototype.configureButtons = function() {
|
|||
_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'),
|
||||
label: 'Twitter',
|
||||
|
|
2
static/application.min.js
vendored
2
static/application.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -50,6 +50,7 @@
|
|||
<div class="save function"></div>
|
||||
<div class="new function"></div>
|
||||
<div class="duplicate function"></div>
|
||||
<div class="raw function"></div>
|
||||
<div class="twitter function"></div>
|
||||
</div>
|
||||
<div id="box3" style="display:none;">
|
||||
|
|
Loading…
Reference in a new issue