Merge branch 'patch-1' of https://github.com/r4sas/PrivateBin into r4sas-patch-1

This commit is contained in:
El RIDO 2017-02-06 19:55:07 +01:00
commit 2ca2309fc4
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
5 changed files with 60 additions and 3 deletions

View File

@ -153,5 +153,7 @@
"Decrypt": "Decrypt":
"Расшифровать", "Расшифровать",
"Enter password": "Enter password":
"Введите пароль" "Введите пароль",
"Uploading paste… Please wait.":
"Отправка записи... Пожалуйста подождите."
} }

View File

@ -1049,6 +1049,8 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
{ {
if(typeof FileReader === undefined) if(typeof FileReader === undefined)
{ {
// revert loading status…
this.stateNewPaste();
this.showError(i18n._('Your browser does not support uploading encrypted files. Please use a newer browser.')); this.showError(i18n._('Your browser does not support uploading encrypted files. Please use a newer browser.'));
return; return;
} }
@ -1142,16 +1144,22 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
} }
else if (data.status === 1) else if (data.status === 1)
{ {
// revert loading status…
controller.stateNewPaste();
controller.showError(i18n._('Could not create paste: %s', data.message)); controller.showError(i18n._('Could not create paste: %s', data.message));
} }
else else
{ {
// revert loading status…
controller.stateNewPaste();
controller.showError(i18n._('Could not create paste: %s', i18n._('unknown status'))); controller.showError(i18n._('Could not create paste: %s', i18n._('unknown status')));
} }
} }
}) })
.fail(function() .fail(function()
{ {
// revert loading status…
this.stateNewPaste();
controller.showError(i18n._('Could not create paste: %s', i18n._('server error or not responding'))); controller.showError(i18n._('Could not create paste: %s', i18n._('server error or not responding')));
}); });
}, },
@ -1192,6 +1200,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
this.clearText.addClass('hidden'); this.clearText.addClass('hidden');
this.discussion.addClass('hidden'); this.discussion.addClass('hidden');
this.prettyMessage.addClass('hidden'); this.prettyMessage.addClass('hidden');
this.loadingIndicator.addClass('hidden');
this.sendButton.removeClass('hidden'); this.sendButton.removeClass('hidden');
this.expiration.removeClass('hidden'); this.expiration.removeClass('hidden');
this.formatter.removeClass('hidden'); this.formatter.removeClass('hidden');
@ -1205,6 +1214,37 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
this.message.focus(); this.message.focus();
}, },
/**
* put the screen in mode after submitting a paste
*
* @name controller.stateSubmittingPaste
* @function
*/
stateSubmittingPaste: 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.newButton.addClass('hidden');
this.password.addClass('hidden');
this.attach.addClass('hidden');
this.message.addClass('hidden');
this.preview.addClass('hidden');
this.loadingIndicator.removeClass('hidden');
},
/** /**
* put the screen in "Existing paste" mode * put the screen in "Existing paste" mode
* *
@ -1243,6 +1283,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
this.message.addClass('hidden'); this.message.addClass('hidden');
this.clearText.addClass('hidden'); this.clearText.addClass('hidden');
this.prettyMessage.addClass('hidden'); this.prettyMessage.addClass('hidden');
this.loadingIndicator.addClass('hidden');
}, },
/** /**
@ -1677,6 +1718,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
this.fileWrap = $('#filewrap'); this.fileWrap = $('#filewrap');
this.formatter = $('#formatter'); this.formatter = $('#formatter');
this.image = $('#image'); this.image = $('#image');
this.loadingIndicator = $('#loadingindicator');
this.message = $('#message'); this.message = $('#message');
this.messageEdit = $('#messageedit'); this.messageEdit = $('#messageedit');
this.messagePreview = $('#messagepreview'); this.messagePreview = $('#messagepreview');

9
tpl/.editorconfig Normal file
View File

@ -0,0 +1,9 @@
# editorconfig.org
root = false
# special format for PHP templates
[*.php]
indent_style = tab
indent_size = 4

View File

@ -69,7 +69,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-bOZxf+ELU4lyYdlSIVM0z+GDBdeO1BZQvkr7HKPz89rmnw6x7w669QOsCOqLoNJ8vcIsFas288doubME9pSE4Q==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-t9Cu6FqbM6WD2Vc8iRxZtqwJdFaXTW85JdcBUpKRWioikGyBtNiT6R8E8imQQ6kakTI2gDU7GDsYfrz9vhuoVQ==" 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]-->
@ -120,6 +120,10 @@ endif;
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li id="loadingindicator" class="navbar-text hidden">
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span>
<?php echo I18n::_('Uploading paste… Please wait.'), PHP_EOL; ?>
</li>
<li> <li>
<?php <?php
if ($isPage): if ($isPage):

View File

@ -47,7 +47,7 @@ if ($MARKDOWN):
<?php <?php
endif; endif;
?> ?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-bOZxf+ELU4lyYdlSIVM0z+GDBdeO1BZQvkr7HKPz89rmnw6x7w669QOsCOqLoNJ8vcIsFas288doubME9pSE4Q==" crossorigin="anonymous"></script> <script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-t9Cu6FqbM6WD2Vc8iRxZtqwJdFaXTW85JdcBUpKRWioikGyBtNiT6R8E8imQQ6kakTI2gDU7GDsYfrz9vhuoVQ==" 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]-->