[Bps-public-commit] rt-extension-quoteselection branch, master, updated. 1.00-3-gfd02242

? sunnavy sunnavy at bestpractical.com
Wed Nov 4 15:11:11 EST 2015


The branch, master has been updated
       via  fd02242eadc35d29c20fd532aa5180d33550e50c (commit)
       via  833991094b724712018ccaf1a69c92232924d1e2 (commit)
      from  4ab67ffb7d37a91796d6775fa5a74f2ed13a8b8e (commit)

Summary of changes:
 static/js/RTx-QuoteSelection.js | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 833991094b724712018ccaf1a69c92232924d1e2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 5 03:49:49 2015 +0800

    use <br> as line separator for richtext box
    
    otherwise "foo\nbar" will look like "> foo > bar"
    
    see also https://rt.cpan.org/Ticket/Display.html?id=108401

diff --git a/static/js/RTx-QuoteSelection.js b/static/js/RTx-QuoteSelection.js
index f0ee846..ee8bd3e 100644
--- a/static/js/RTx-QuoteSelection.js
+++ b/static/js/RTx-QuoteSelection.js
@@ -18,7 +18,13 @@ jQuery(function() {
 
         // TODO: wrap long lines before quoting
         selection = selection.replace(/^/gm, "> ");
-        selection = selection.concat("\n\n");
+        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);
 
         link.attr("href", link.attr("href").concat("&UpdateContent=" + selection));

commit fd02242eadc35d29c20fd532aa5180d33550e50c
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 5 03:56:06 2015 +0800

    append only one UpdateContent to urls
    
    otherwise RT could get confused and show ARRAY(...)

diff --git a/static/js/RTx-QuoteSelection.js b/static/js/RTx-QuoteSelection.js
index ee8bd3e..ec24679 100644
--- a/static/js/RTx-QuoteSelection.js
+++ b/static/js/RTx-QuoteSelection.js
@@ -27,7 +27,10 @@ jQuery(function() {
         }
         selection = encodeURIComponent(selection);
 
-        link.attr("href", link.attr("href").concat("&UpdateContent=" + 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() {

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


More information about the Bps-public-commit mailing list