aboutsummaryrefslogtreecommitdiff
path: root/public/js/gogs.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r--public/js/gogs.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js
index 4ac0013b..1c6f3ade 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -101,6 +101,16 @@ function initRepository() {
$('#add-deploy-key-panel').show();
});
}
+
+ // Pull request
+ if ($('.repository.compare.pull').length > 0) {
+ $('.choose.branch .dropdown').dropdown({
+ fullTextSearch: true,
+ onChange: function (text, value, $choice) {
+ window.location.href = $choice.data('url');
+ }
+ });
+ }
};
$(document).ready(function () {
@@ -121,6 +131,26 @@ $(document).ready(function () {
});
$('.poping.up').popup();
+ // Comment form
+ $('.comment.form .tabular.menu .item').tab();
+ $('.comment.form .tabular.menu .item[data-tab="preview"]').click(function () {
+ var $this = $(this);
+ console.log($('.comment.form .tab.segment[data-tab="write"] textarea').val())
+ console.log($('.comment.form .tab.segment[data-tab="preview"]').html())
+ $.post($this.data('url'), {
+ "_csrf": csrf,
+ "mode": "gfm",
+ "context": $this.data('context'),
+ "text": $('.comment.form .tab.segment[data-tab="write"] textarea').val()
+ },
+ function (data) {
+ console.log(data)
+ $('.comment.form .tab.segment[data-tab="preview"]').html(data);
+ }
+ )
+ ;
+ })
+
// Helpers.
$('.delete-button').click(function () {
var $this = $(this);