mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-02 19:46:09 -04:00
"Burn after reading" as a checkbox
"Burn after reading" option has been moved out of Expiration combo to a separate checkbox. Reason is: You can prevent a read-once paste to be available ad vitam eternam on the net. (cherry picked from commit 190b278402c086ebc4d1a78aae27d1e2666e3e7a) Conflicts: css/zerobin.css index.php js/zerobin.js tpl/page.html
This commit is contained in:
parent
1b95d6fff7
commit
cff4d99f05
4 changed files with 43 additions and 25 deletions
|
@ -319,6 +319,7 @@ function send_data() {
|
|||
var cipherdata = zeroCipher(randomkey, $('textarea#message').val());
|
||||
var data_to_send = { data: cipherdata,
|
||||
expire: $('select#pasteExpiration').val(),
|
||||
burnafterreading: $('input#burnafterreading').is(':checked') ? 1 : 0,
|
||||
opendiscussion: $('input#opendiscussion').is(':checked') ? 1 : 0
|
||||
};
|
||||
$.post(scriptLocation(), data_to_send, 'json')
|
||||
|
@ -384,6 +385,7 @@ function stateNewPaste() {
|
|||
$('div#remainingtime').addClass('hidden');
|
||||
$('div#language').addClass('hidden'); // $('#language').removeClass('hidden');
|
||||
$('input#password').addClass('hidden'); //$('#password').removeClass('hidden');
|
||||
$('div#burnafterreadingoption').removeClass('hidden');
|
||||
$('div#opendisc').removeClass('hidden');
|
||||
$('button#newbutton').removeClass('hidden');
|
||||
$('div#pasteresult').addClass('hidden');
|
||||
|
@ -412,6 +414,7 @@ function stateExistingPaste() {
|
|||
$('div#expiration').addClass('hidden');
|
||||
$('div#language').addClass('hidden');
|
||||
$('input#password').addClass('hidden');
|
||||
$('div#burnafterreadingoption').addClass('hidden');
|
||||
$('div#opendisc').addClass('hidden');
|
||||
$('button#newbutton').removeClass('hidden');
|
||||
$('div#pasteresult').addClass('hidden');
|
||||
|
@ -523,9 +526,11 @@ $(function() {
|
|||
// hide "no javascript" message
|
||||
$('#noscript').hide();
|
||||
|
||||
$('select#pasteExpiration').change(function() {
|
||||
if ($(this).val() == 'burn') {
|
||||
// If "burn after reading" is checked, disable discussion.
|
||||
$('input#burnafterreading').change(function() {
|
||||
if ($(this).is(':checked') ) {
|
||||
$('div#opendisc').addClass('buttondisabled');
|
||||
$('input#opendiscussion').attr({checked: false});
|
||||
$('input#opendiscussion').attr('disabled',true);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue