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

@ -178,7 +178,7 @@ button img {
top: 2px; top: 2px;
} }
#expiration, #burnafterreadingoption, #opendisc { #expiration, #rawtextbutton, #burnafterreadingoption, #opendisc {
background-color: #414d5a; background-color: #414d5a;
padding: 6px 8px; padding: 6px 8px;
margin: 0 5px 0 0; margin: 0 5px 0 0;
@ -198,6 +198,10 @@ button img {
background: #414d5a; background: #414d5a;
} }
#rawtextbutton img {
padding: 1px 0 1px 0;
}
#remainingtime { #remainingtime {
color: #94a3b4; color: #94a3b4;
display: inline; display: inline;

BIN
img/icon_raw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

View File

@ -381,6 +381,7 @@ function selectText(element) {
function stateNewPaste() { function stateNewPaste() {
$('button#sendbutton').removeClass('hidden'); $('button#sendbutton').removeClass('hidden');
$('button#clonebutton').addClass('hidden'); $('button#clonebutton').addClass('hidden');
$('button#rawtextbutton').addClass('hidden');
$('div#expiration').removeClass('hidden'); $('div#expiration').removeClass('hidden');
$('div#remainingtime').addClass('hidden'); $('div#remainingtime').addClass('hidden');
$('div#burnafterreadingoption').removeClass('hidden'); $('div#burnafterreadingoption').removeClass('hidden');
@ -408,6 +409,7 @@ function stateExistingPaste() {
else { else {
$('button#clonebutton').removeClass('hidden'); $('button#clonebutton').removeClass('hidden');
} }
$('button#rawtextbutton').show();
$('div#expiration').addClass('hidden'); $('div#expiration').addClass('hidden');
$('div#burnafterreadingoption').addClass('hidden'); $('div#burnafterreadingoption').addClass('hidden');
@ -419,6 +421,17 @@ function stateExistingPaste() {
$('div#prettymessage').removeClass('hidden'); $('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. * Clone the current paste.
*/ */

View File

@ -46,9 +46,10 @@
<div id="status">{$STATUS|htmlspecialchars}</div> <div id="status">{$STATUS|htmlspecialchars}</div>
<div id="errormessage" class="hidden">{$ERROR|htmlspecialchars}</div> <div id="errormessage" class="hidden">{$ERROR|htmlspecialchars}</div>
<div id="toolbar"> <div id="toolbar">
<button id="newbutton" onclick="window.location.href=scriptLocation();return false;" class="hidden"><img src="img/icon_new.png#" width="11" height="15" alt="" />New</button> <button id="newbutton" onclick="window.location.href=scriptLocation();return false;" class="hidden"><img src="img/icon_new.png" width="11" height="15" alt="" />New</button>
<button id="sendbutton" onclick="send_data();return false;" class="hidden"><img src="img/icon_send.png#" width="18" height="15" alt="" />Send</button> <button id="sendbutton" onclick="send_data();return false;" class="hidden"><img src="img/icon_send.png" width="18" height="15" alt="" />Send</button>
<button id="clonebutton" onclick="clonePaste();return false;" class="hidden"><img src="img/icon_clone.png#" width="15" height="17" alt="" />Clone</button> <button id="clonebutton" onclick="clonePaste();return false;" class="hidden"><img src="img/icon_clone.png" width="15" height="17" alt="" />Clone</button>
<button id="rawtextbutton" onclick="rawText();return false;" class="hidden"><img src="img/icon_raw.png" width="15" height="15" alt="" />Raw text</button>
<div id="expiration" class="hidden">Expires: <div id="expiration" class="hidden">Expires:
<select id="pasteExpiration" name="pasteExpiration"> <select id="pasteExpiration" name="pasteExpiration">
{loop="EXPIRE"} {loop="EXPIRE"}