New state for "only new button"

Used when the message cannot be decrypted.
Fixes https://github.com/PrivateBin/PrivateBin/issues/126
pull/179/head
rugk 7 years ago
parent 5ad02a3d1c
commit 5130d9e2f3
No known key found for this signature in database
GPG Key ID: 05D40A636AFAB34D

@ -781,9 +781,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
} }
catch(err) catch(err)
{ {
this.clearText.addClass('hidden'); this.stateOnlyNewPaste();
this.prettyMessage.addClass('hidden');
this.cloneButton.addClass('hidden');
this.showError(i18n._('Could not decrypt data (Wrong key?)')); this.showError(i18n._('Could not decrypt data (Wrong key?)'));
return; return;
} }
@ -1253,6 +1251,38 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
this.loadingIndicator.removeClass('hidden'); this.loadingIndicator.removeClass('hidden');
}, },
/**
* put the screen in a state where the only option is to submit a
* new paste
*
* @name controller.stateOnlyNewPaste
* @function
*/
stateOnlyNewPaste: function()
{
this.message.text('');
this.attachment.addClass('hidden');
this.cloneButton.addClass('hidden');
this.rawTextButton.addClass('hidden');
this.remainingTime.addClass('hidden');
this.pasteResult.addClass('hidden');
this.clearText.addClass('hidden');
this.discussion.addClass('hidden');
this.prettyMessage.addClass('hidden');
this.sendButton.addClass('hidden');
this.expiration.addClass('hidden');
this.formatter.addClass('hidden');
this.burnAfterReadingOption.addClass('hidden');
this.openDisc.addClass('hidden');
this.password.addClass('hidden');
this.attach.addClass('hidden');
this.message.addClass('hidden');
this.preview.addClass('hidden');
this.loadingIndicator.addClass('hidden');
this.newButton.removeClass('hidden');
},
/** /**
* put the screen in "Existing paste" mode * put the screen in "Existing paste" mode
* *

@ -69,7 +69,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-IPs+RdBDoPCC1Hv7DJbOf157BjPm5Xr/j+01BnZ0ZnwxqyfyM9NIZZjrCKpCsLHSIostuHjCkW8XgoHTPVPOTw==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-CvVHawXqZ6ArGeNCmrYkd9brSbFtb73JfnMzj92d9NzNGRxc2O6nPm2d7CX8pgeughLQ45jfL9gidTktUNxvOQ==" crossorigin="anonymous"></script>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]--> <![endif]-->

@ -47,7 +47,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-IPs+RdBDoPCC1Hv7DJbOf157BjPm5Xr/j+01BnZ0ZnwxqyfyM9NIZZjrCKpCsLHSIostuHjCkW8XgoHTPVPOTw==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-CvVHawXqZ6ArGeNCmrYkd9brSbFtb73JfnMzj92d9NzNGRxc2O6nPm2d7CX8pgeughLQ45jfL9gidTktUNxvOQ==" crossorigin="anonymous"></script>
<!--[if lt IE 10]> <!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style> <style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]--> <![endif]-->

Loading…
Cancel
Save