diff --git a/css/zerobin.css b/css/zerobin.css index ec1b951..d2ea804 100644 --- a/css/zerobin.css +++ b/css/zerobin.css @@ -178,7 +178,7 @@ button img { top: 2px; } -#expiration, #burnafterreadingoption, #opendisc { +#expiration, #rawtextbutton, #burnafterreadingoption, #opendisc { background-color: #414d5a; padding: 6px 8px; margin: 0 5px 0 0; @@ -198,6 +198,10 @@ button img { background: #414d5a; } +#rawtextbutton img { + padding: 1px 0 1px 0; +} + #remainingtime { color: #94a3b4; display: inline; diff --git a/img/icon_raw.png b/img/icon_raw.png new file mode 100644 index 0000000..162a6a7 Binary files /dev/null and b/img/icon_raw.png differ diff --git a/js/zerobin.js b/js/zerobin.js index f858842..a8b0671 100644 --- a/js/zerobin.js +++ b/js/zerobin.js @@ -381,6 +381,7 @@ function selectText(element) { function stateNewPaste() { $('button#sendbutton').removeClass('hidden'); $('button#clonebutton').addClass('hidden'); + $('button#rawtextbutton').addClass('hidden'); $('div#expiration').removeClass('hidden'); $('div#remainingtime').addClass('hidden'); $('div#burnafterreadingoption').removeClass('hidden'); @@ -408,6 +409,7 @@ function stateExistingPaste() { else { $('button#clonebutton').removeClass('hidden'); } + $('button#rawtextbutton').show(); $('div#expiration').addClass('hidden'); $('div#burnafterreadingoption').addClass('hidden'); @@ -419,6 +421,17 @@ function stateExistingPaste() { $('div#prettymessage').removeClass('hidden'); } +/** Return raw text + */ +function rawText() +{ + history.replaceState(document.title, document.title, 'document.txt'); + var paste = $('div#cleartext').text(); + var newDoc = document.open('text/plain', 'replace'); + newDoc.write(paste); + newDoc.close(); +} + /** * Clone the current paste. */ diff --git a/tpl/page.html b/tpl/page.html index 2cecb2a..c278b43 100644 --- a/tpl/page.html +++ b/tpl/page.html @@ -46,9 +46,10 @@
{$STATUS|htmlspecialchars}
- - - + + + +