Clear discussion if new/clone paste clicked

pull/480/head
Haocen Xu 2019-08-14 20:36:44 -04:00
parent 1af7b536a5
commit 71931b0f18
No known key found for this signature in database
GPG Key ID: 3F0D955A0F6AD729
3 changed files with 11 additions and 5 deletions

View File

@ -1807,6 +1807,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// delete link
$('#deletelink').html('<a href="' + deleteUrl + '">' + I18n._('Delete data') + '</a>');
// enable shortener button
$shortenButton.removeClass('buttondisabled');
// show result
$pasteSuccess.removeClass('hidden');
// we pre-select the link so that the user only has to [Ctrl]+[c] the link
@ -4108,9 +4111,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
deleteUrl = baseUri + 'pasteid=' + data.id + '&deletetoken=' + data.deletetoken;
PasteStatus.createPasteNotification(url, deleteUrl);
// enable shortener button
$shortenButton.removeClass('buttondisabled');
// show new URL in browser bar
history.pushState({type: 'newpaste'}, document.title, url);
@ -4742,6 +4742,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
TopNav.showCreateButtons();
Alert.hideLoading();
history.pushState({type: 'create'}, document.title, Helper.baseUri());
// clear discussion
DiscussionViewer.prepareNewDiscussion();
};
/**
@ -4854,6 +4857,9 @@ jQuery.PrivateBin = (function($, RawDeflate) {
Editor.show();
TopNav.showCreateButtons();
// clear discussion
DiscussionViewer.prepareNewDiscussion();
};
/**

View File

@ -71,7 +71,7 @@ if ($MARKDOWN):
endif;
?>
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="+Wbo1knNxd7IM9J5YgoT6+Ai0eE7Cp8Kvj9yRvKPQQq3TeShaUxL8M1jsYC6yHRNl4eXyMdjO33+NeXeL7xtQA==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-kQMNNeXI+TANiKlYOXFhSIpjoNl8++VpBHLsXMlCH4GTBLFc3cWSGo9ZbOSzctTZn3HFlnAfbOjvuK/qmRbWDA==" crossorigin="anonymous"></script>
<!--[if IE]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
<![endif]-->

View File

@ -49,7 +49,7 @@ if ($MARKDOWN):
endif;
?>
<script type="text/javascript" data-cfasync="false" src="js/purify-1.0.11.js" integrity="sha512-p7UyJuyBkhMcMgE4mDsgK0Lz70OvetLefua1oXs1OujWv9gOxh4xy8InFux7bZ4/DAZsTmO4rgVwZW9BHKaTaw==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="+Wbo1knNxd7IM9J5YgoT6+Ai0eE7Cp8Kvj9yRvKPQQq3TeShaUxL8M1jsYC6yHRNl4eXyMdjO33+NeXeL7xtQA==" crossorigin="anonymous"></script>
<script type="text/javascript" data-cfasync="false" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-kQMNNeXI+TANiKlYOXFhSIpjoNl8++VpBHLsXMlCH4GTBLFc3cWSGo9ZbOSzctTZn3HFlnAfbOjvuK/qmRbWDA==" crossorigin="anonymous"></script>
<!--[if IE]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;}</style>
<![endif]-->