[Rt-commit] rt branch, 4.6/core-rt-extension-quoteselection, created. rt-4.4.3-64-g5d0c2bce9

Maureen Mirville maureen at bestpractical.com
Mon Nov 26 10:01:08 EST 2018


The branch, 4.6/core-rt-extension-quoteselection has been created
        at  5d0c2bce9d45de888aa34a2cc4c8c8cd337ca7da (commit)

- Log -----------------------------------------------------------------
commit 67ef08ef40c21f4c60e7849142b4bae547f221b4
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Tue Nov 6 18:13:21 2018 -0500

    Core RT::Extension::QuoteSelection to 4.6

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index b85519d77..382b5de40 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -137,6 +137,7 @@ sub JSFiles {
       assets.js
       /static/RichText/ckeditor.js
       dropzone.min.js
+      quoteselection.js
       }, RT->Config->Get('JSFiles');
 }
 
diff --git a/share/static/js/quoteselection.js b/share/static/js/quoteselection.js
new file mode 100644
index 000000000..ec246790e
--- /dev/null
+++ b/share/static/js/quoteselection.js
@@ -0,0 +1,54 @@
+jQuery(function() {
+    var reply_from_selection = function(ev) {
+        var link = jQuery(this);
+
+        var selection;
+        if (window.getSelection)
+            selection = window.getSelection();
+        else if (document.getSelection)
+            selection = document.getSelection();
+        else if (document.selection)
+            selection = document.selection.createRange().text;
+
+        if (selection.toString)
+            selection = selection.toString();
+
+        if (typeof(selection) !== "string" || selection.length < 3)
+            return;
+
+        // TODO: wrap long lines before quoting
+        selection = selection.replace(/^/gm, "> ");
+        if ( RT.Config.MessageBoxRichText ) {
+            selection = selection.replace(/\r?\n/g, "<br>");
+            selection = selection.concat("<br><br>");
+        }
+        else {
+            selection = selection.concat("\n\n");
+        }
+        selection = encodeURIComponent(selection);
+
+        if ( !link.prop('data-href') ) {
+            link.prop('data-href', link.attr('href'));
+        }
+        link.attr("href", link.prop("data-href").concat("&UpdateContent=" + selection));
+    };
+
+    var apply_quote = function() {
+        var link = jQuery(this);
+        if (link.data("quote-selection"))
+            return;
+        link.data("quote-selection",true);
+        link.click(reply_from_selection);
+    };
+
+    jQuery(
+        ".reply-link, "         +
+        ".comment-link, "       +
+        "#page-actions-reply, " +
+        "#page-actions-comment"
+    ).each(apply_quote);
+
+    jQuery(document).ajaxComplete(function(ev){
+        jQuery(".reply-link, .comment-link").each(apply_quote);
+    });
+});

commit 5d0c2bce9d45de888aa34a2cc4c8c8cd337ca7da
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Mon Nov 26 10:00:26 2018 -0500

    Add docs on cored RT::Extension::QuoteSelection

diff --git a/docs/working_with_rt.pod b/docs/working_with_rt.pod
new file mode 100644
index 000000000..c94c2f1ae
--- /dev/null
+++ b/docs/working_with_rt.pod
@@ -0,0 +1,19 @@
+=head1 Working with RT
+
+Request Tracker (RT) has a number of use cases and features. In this guide, we will focus on working with RT in the user interface rather than working with RT via email.
+
+=head2 Creating a Ticket
+
+There are several ways to create a ticket in RT. From the homepage, "RT at a glance", you have a couple of options. The first, is to click on the "New ticket in" on the top right, selecting the desired queue from the dropdown. This will bring you to the Ticket Create page where you can add detailed information on the ticket, including a subject and a message. The available fields can be customized by your RT administrator. You can also add attachments to the ticket by either dragging and dropping or clicking to select a file from your computer. Another way tickets can be created is by using the "Quick ticket creation" portlet on "RT at a glance" (Note that this may not be available by default if your RT administrator removed it). Rather than jumping to an additional page, this portlet allows to add the most prominent information on a ticket without leaving your home page.
+
+With the proper rights, a ticket can also be created by emailing the corresponding email address set by an RT administrator.
+
+=head2 Actions
+
+=head3 Reply/Comment
+
+Users are able to either comment or reply on a ticket based on their needs. A comment is used to add a note to a ticket that is not sent out to the ticket Requestor. A reply however, is sent to the Requestor and triggers each correspondence scrip. To distinguish the two on the Ticket Update page, the message box for Comments, is yellow, whereas the message box for Replies, is red.
+
+In order to make it easier to reply/comment on a ticket, a feature as of 4.6 has been added that allows you to quote any text on the ticket display page into your comment or reply. To utilize this feature, simply highlight the content you would like inserted in you message, then click on Comment/Reply. You may click on Comment/Reply from either the Actions menu or directly on the transaction you'd like. This will bring you to the ticket update page and you will find you selected text already in the message box.
+
+##add images

-----------------------------------------------------------------------


More information about the rt-commit mailing list