typos, documentation
This commit is contained in:
parent
2929d5c17a
commit
2d7996570e
@ -697,6 +697,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
* compress, then encrypt message with given key and password
|
* compress, then encrypt message with given key and password
|
||||||
*
|
*
|
||||||
* @name CryptTool.cipher
|
* @name CryptTool.cipher
|
||||||
|
* @async
|
||||||
* @function
|
* @function
|
||||||
* @param {string} key
|
* @param {string} key
|
||||||
* @param {string} password
|
* @param {string} password
|
||||||
@ -772,6 +773,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
* decrypt message with key, then decompress
|
* decrypt message with key, then decompress
|
||||||
*
|
*
|
||||||
* @name CryptTool.decipher
|
* @name CryptTool.decipher
|
||||||
|
* @async
|
||||||
* @function
|
* @function
|
||||||
* @param {string} key
|
* @param {string} key
|
||||||
* @param {string} password
|
* @param {string} password
|
||||||
@ -3952,8 +3954,8 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
/**
|
/**
|
||||||
* send a reply in a discussion
|
* send a reply in a discussion
|
||||||
*
|
*
|
||||||
* @async
|
|
||||||
* @name PasteEncrypter.sendComment
|
* @name PasteEncrypter.sendComment
|
||||||
|
* @async
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
me.sendComment = async function()
|
me.sendComment = async function()
|
||||||
@ -4027,8 +4029,8 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
/**
|
/**
|
||||||
* sends a new paste to server
|
* sends a new paste to server
|
||||||
*
|
*
|
||||||
* @async
|
|
||||||
* @name PasteEncrypter.sendPaste
|
* @name PasteEncrypter.sendPaste
|
||||||
|
* @async
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
me.sendPaste = async function()
|
me.sendPaste = async function()
|
||||||
@ -4141,7 +4143,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
async function decryptOrPromptPassword(key, password, cipherdata)
|
async function decryptOrPromptPassword(key, password, cipherdata)
|
||||||
{
|
{
|
||||||
// try decryption without password
|
// try decryption without password
|
||||||
var plaindata = await CryptTool.decipher(key, password, cipherdata);
|
const plaindata = await CryptTool.decipher(key, password, cipherdata);
|
||||||
|
|
||||||
// if it fails, request password
|
// if it fails, request password
|
||||||
if (plaindata.length === 0 && password.length === 0) {
|
if (plaindata.length === 0 && password.length === 0) {
|
||||||
@ -4212,8 +4214,8 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
*/
|
*/
|
||||||
async function decryptAttachment(paste, key, password)
|
async function decryptAttachment(paste, key, password)
|
||||||
{
|
{
|
||||||
let attachmentPromise = decryptOrPromptPassword(key, password, paste.attachment);
|
const attachmentPromise = decryptOrPromptPassword(key, password, paste.attachment),
|
||||||
let attachmentNamePromise = decryptOrPromptPassword(key, password, paste.attachmentname);
|
attachmentNamePromise = decryptOrPromptPassword(key, password, paste.attachmentname);
|
||||||
attachmentPromise.catch((err) => {
|
attachmentPromise.catch((err) => {
|
||||||
displayDecryptionError('failed to decipher attachment: ' + err);
|
displayDecryptionError('failed to decipher attachment: ' + err);
|
||||||
})
|
})
|
||||||
@ -4249,7 +4251,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
|
|
||||||
let commentDecryptionPromises = [];
|
let commentDecryptionPromises = [];
|
||||||
// iterate over comments
|
// iterate over comments
|
||||||
for (var i = 0; i < paste.comments.length; ++i) {
|
for (let i = 0; i < paste.comments.length; ++i) {
|
||||||
commentDecryptionPromises.push(
|
commentDecryptionPromises.push(
|
||||||
Promise.all([
|
Promise.all([
|
||||||
CryptTool.decipher(key, password, paste.comments[i].data),
|
CryptTool.decipher(key, password, paste.comments[i].data),
|
||||||
@ -4260,12 +4262,11 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Promise.all(commentDecryptionPromises).then((plaintexts) => {
|
return Promise.all(commentDecryptionPromises).then((plaintexts) => {
|
||||||
for (var i = 0; i < paste.comments.length; ++i) {
|
for (let i = 0; i < paste.comments.length; ++i) {
|
||||||
if (plaintexts[i][0].length === 0) {
|
if (plaintexts[i][0].length === 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var comment = paste.comments[i];
|
const comment = paste.comments[i];
|
||||||
console.log(plaintexts);
|
|
||||||
DiscussionViewer.addComment(
|
DiscussionViewer.addComment(
|
||||||
comment,
|
comment,
|
||||||
plaintexts[i][0],
|
plaintexts[i][0],
|
||||||
@ -4317,7 +4318,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
|
|
||||||
let key = Model.getPasteKey(),
|
let key = Model.getPasteKey(),
|
||||||
password = Prompt.getPassword(),
|
password = Prompt.getPassword(),
|
||||||
decrytionPromises = [];
|
decryptionPromises = [];
|
||||||
|
|
||||||
TopNav.setRetryCallback(function () {
|
TopNav.setRetryCallback(function () {
|
||||||
TopNav.hideRetryButton();
|
TopNav.hideRetryButton();
|
||||||
@ -4328,7 +4329,7 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
if (paste.attachment && AttachmentViewer.hasAttachmentData()) {
|
if (paste.attachment && AttachmentViewer.hasAttachmentData()) {
|
||||||
// try to decrypt paste and if it fails (because the password is
|
// try to decrypt paste and if it fails (because the password is
|
||||||
// missing) return to let JS continue and wait for user
|
// missing) return to let JS continue and wait for user
|
||||||
decrytionPromises.push(
|
decryptionPromises.push(
|
||||||
decryptAttachment(paste, key, password).then((attachementIsDecrypted) => {
|
decryptAttachment(paste, key, password).then((attachementIsDecrypted) => {
|
||||||
if (attachementIsDecrypted) {
|
if (attachementIsDecrypted) {
|
||||||
// ignore empty paste, as this is allowed when pasting attachments
|
// ignore empty paste, as this is allowed when pasting attachments
|
||||||
@ -4337,18 +4338,18 @@ jQuery.PrivateBin = (function($, sjcl, RawDeflate) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
decrytionPromises.push(decryptPaste(paste, key, password))
|
decryptionPromises.push(decryptPaste(paste, key, password))
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the discussion is opened on this paste, display it
|
// if the discussion is opened on this paste, display it
|
||||||
if (paste.meta.opendiscussion) {
|
if (paste.meta.opendiscussion) {
|
||||||
decrytionPromises.push(decryptComments(paste, key, password));
|
decryptionPromises.push(decryptComments(paste, key, password));
|
||||||
}
|
}
|
||||||
|
|
||||||
// shows the remaining time (until) deletion
|
// shows the remaining time (until) deletion
|
||||||
PasteStatus.showRemainingTime(paste.meta);
|
PasteStatus.showRemainingTime(paste.meta);
|
||||||
|
|
||||||
Promise.all(decrytionPromises).then(() => {
|
Promise.all(decryptionPromises).then(() => {
|
||||||
Alert.hideLoading();
|
Alert.hideLoading();
|
||||||
TopNav.showViewButtons();
|
TopNav.showViewButtons();
|
||||||
});
|
});
|
||||||
|
@ -71,7 +71,7 @@ if ($MARKDOWN):
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.7.js" integrity="sha512-VnKJHLosO8z2ojNvWk9BEKYqnhZyWK9rM90FgZUUEp/PRnUqR5OLLKE0a3BkVmn7YgB7LXRrjHgFHQYKd6DAIA==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.7.js" integrity="sha512-VnKJHLosO8z2ojNvWk9BEKYqnhZyWK9rM90FgZUUEp/PRnUqR5OLLKE0a3BkVmn7YgB7LXRrjHgFHQYKd6DAIA==" crossorigin="anonymous"></script>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-5FZ2MDJ7OkedQskCguHtqj0F0vORtORJgmGX+ydZt42MtNgdZhGcD0WTbGtAgYef4exG+MtGYQ81eB8dgqLnEg==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-PafknruMFPDL68jJqySKmRTlSjRuXMLb3OB6uFNeHcECvi8kaz2Amo5Dp+52xNBuSLCD8+MDrOBoNLa9vpmOMA==" 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]-->
|
||||||
|
@ -49,7 +49,7 @@ if ($MARKDOWN):
|
|||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.7.js" integrity="sha512-VnKJHLosO8z2ojNvWk9BEKYqnhZyWK9rM90FgZUUEp/PRnUqR5OLLKE0a3BkVmn7YgB7LXRrjHgFHQYKd6DAIA==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.7.js" integrity="sha512-VnKJHLosO8z2ojNvWk9BEKYqnhZyWK9rM90FgZUUEp/PRnUqR5OLLKE0a3BkVmn7YgB7LXRrjHgFHQYKd6DAIA==" crossorigin="anonymous"></script>
|
||||||
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-5FZ2MDJ7OkedQskCguHtqj0F0vORtORJgmGX+ydZt42MtNgdZhGcD0WTbGtAgYef4exG+MtGYQ81eB8dgqLnEg==" crossorigin="anonymous"></script>
|
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-PafknruMFPDL68jJqySKmRTlSjRuXMLb3OB6uFNeHcECvi8kaz2Amo5Dp+52xNBuSLCD8+MDrOBoNLa9vpmOMA==" 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…
Reference in New Issue
Block a user