Explorar el Código

Clear discussion if new/clone paste clicked

Haocen Xu hace 7 años
padre
commit
71931b0f18
Se han modificado 3 ficheros con 11 adiciones y 5 borrados
  1. 9 3
      js/privatebin.js
  2. 1 1
      tpl/bootstrap.php
  3. 1 1
      tpl/page.php

+ 9 - 3
js/privatebin.js

@@ -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();
         };
 
         /**

+ 1 - 1
tpl/bootstrap.php

@@ -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]-->

+ 1 - 1
tpl/page.php

@@ -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]-->