Added "Raw text" button.

(cherry picked from commit 00cfcafc996c55afd069b665ad3875693e22d36d)

Conflicts:
	css/zerobin.css
	js/zerobin.js
	tpl/page.html
This commit is contained in:
Sebastien SAUVAGE 2013-02-24 16:29:13 +01:00 committed by El RIDO
parent 09bebae286
commit fdc87a7fcf
4 changed files with 22 additions and 4 deletions

View file

@ -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.
*/