From 011b1b863e9be71c658ddcfeee204c3007cae5d4 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Dec 01 2016 11:12:12 +0000 Subject: Add button to use quick replies --- diff --git a/pagure/static/quick_reply.js b/pagure/static/quick_reply.js new file mode 100644 index 0000000..6546c96 --- /dev/null +++ b/pagure/static/quick_reply.js @@ -0,0 +1,14 @@ +$(document).ready(function() { + $('.qr-reply').on('click', function (e) { + let tgt = $('#comment'); + if (!tgt.val()) { + tgt.val($(this).attr('data-qr')); + } + $('.qr .dropdown-toggle').dropdown('toggle'); + return false; + }); + // Disable selecting replies when in preview mode. + $('#previewinmarkdown').on('click', function () { + $('.qr-btn').toggleClass('disabled'); + }); +}); diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index 46bf5fb..4b25403 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -81,6 +81,9 @@ aria-pressed="false" id="previewinmarkdown">Preview + {% if repo.quick_replies %} + {% include "quick_reply.html" %} + {% endif %} @@ -904,4 +907,9 @@ $( document ).ready(function() { }); + +{% if repo.quick_replies %} + +{% endif %} + {% endblock %} diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index 7f9b6e4..601ebf2 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -588,6 +588,9 @@ aria-pressed="false" id="previewinmarkdown">Preview + {% if repo.quick_replies %} + {% include "quick_reply.html" %} + {% endif %}
@@ -1385,4 +1388,8 @@ source.addEventListener('message', function(e) { {% endif %} +{% if repo.quick_replies %} + +{% endif %} + {% endblock %} diff --git a/pagure/templates/quick_reply.html b/pagure/templates/quick_reply.html new file mode 100644 index 0000000..b207de7 --- /dev/null +++ b/pagure/templates/quick_reply.html @@ -0,0 +1,12 @@ +
+ + +