@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remarkup - add a quote button

Summary: Fixes T7696.

Test Plan: hit the quote button with no text - it worked. highlighted some text and hit the quote button - it worked. hit the list item button with no text - it worked. hit the list item button with text selected - it worked

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7696

Differential Revision: https://secure.phabricator.com/D13060

+34 -19
+12 -12
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '97a49e3e', 11 - 'core.pkg.js' => '0e261ea7', 11 + 'core.pkg.js' => 'a5ed8c89', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => '30602b8c', 14 14 'differential.pkg.js' => '8c98ce21', ··· 459 459 'rsrc/js/core/behavior-object-selector.js' => '49b73b36', 460 460 'rsrc/js/core/behavior-oncopy.js' => '2926fff2', 461 461 'rsrc/js/core/behavior-phabricator-nav.js' => '14d7a8b8', 462 - 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'e32d14ab', 462 + 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => '095ed313', 463 463 'rsrc/js/core/behavior-refresh-csrf.js' => '7814b593', 464 464 'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45', 465 465 'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e', ··· 610 610 'javelin-behavior-phabricator-notification-example' => '8ce821c5', 611 611 'javelin-behavior-phabricator-object-selector' => '49b73b36', 612 612 'javelin-behavior-phabricator-oncopy' => '2926fff2', 613 - 'javelin-behavior-phabricator-remarkup-assist' => 'e32d14ab', 613 + 'javelin-behavior-phabricator-remarkup-assist' => '095ed313', 614 614 'javelin-behavior-phabricator-reveal-content' => '60821bc7', 615 615 'javelin-behavior-phabricator-search-typeahead' => '048330fa', 616 616 'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6', ··· 881 881 'javelin-install', 882 882 'javelin-dom', 883 883 'javelin-stratcom', 884 + 'javelin-vector', 885 + ), 886 + '095ed313' => array( 887 + 'javelin-behavior', 888 + 'javelin-stratcom', 889 + 'javelin-dom', 890 + 'phabricator-phtize', 891 + 'phabricator-textareautils', 892 + 'javelin-workflow', 884 893 'javelin-vector', 885 894 ), 886 895 '0a3f3021' => array( ··· 1902 1911 ), 1903 1912 'e292eaf4' => array( 1904 1913 'javelin-install', 1905 - ), 1906 - 'e32d14ab' => array( 1907 - 'javelin-behavior', 1908 - 'javelin-stratcom', 1909 - 'javelin-dom', 1910 - 'phabricator-phtize', 1911 - 'phabricator-textareautils', 1912 - 'javelin-workflow', 1913 - 'javelin-vector', 1914 1914 ), 1915 1915 'e379b58e' => array( 1916 1916 'javelin-behavior',
+4
src/view/form/control/PhabricatorRemarkupControl.php
··· 48 48 'italic text' => pht('italic text'), 49 49 'monospaced text' => pht('monospaced text'), 50 50 'List Item' => pht('List Item'), 51 + 'Quoted Text' => pht('Quoted Text'), 51 52 'data' => pht('data'), 52 53 'name' => pht('name'), 53 54 'URL' => pht('URL'), ··· 79 80 ), 80 81 'fa-code' => array( 81 82 'tip' => pht('Code Block'), 83 + ), 84 + 'fa-quote-right' => array( 85 + 'tip' => pht('Quote'), 82 86 ), 83 87 'fa-table' => array( 84 88 'tip' => pht('Table'),
+18 -7
webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
··· 93 93 range.start + l.length + m.length); 94 94 } 95 95 96 + function prepend_char_to_lines(ch, sel, def) { 97 + if (sel) { 98 + sel = sel.split('\n'); 99 + } else { 100 + sel = [def]; 101 + } 102 + sel = sel.join('\n' + ch); 103 + return sel; 104 + } 105 + 96 106 function assist(area, action, root) { 97 107 // If the user has some text selected, we'll try to use that (for example, 98 108 // if they have a word selected and want to bold it). Otherwise we'll insert 99 109 // generic text. 100 110 var sel = JX.TextAreaUtils.getSelectionText(area); 101 111 var r = JX.TextAreaUtils.getSelectionRange(area); 112 + var ch; 102 113 103 114 switch (action) { 104 115 case 'fa-bold': ··· 120 131 break; 121 132 case 'fa-list-ul': 122 133 case 'fa-list-ol': 123 - var ch = (action == 'fa-list-ol') ? ' # ' : ' - '; 124 - if (sel) { 125 - sel = sel.split('\n'); 126 - } else { 127 - sel = [pht('List Item')]; 128 - } 129 - sel = sel.join('\n' + ch); 134 + ch = (action == 'fa-list-ol') ? ' # ' : ' - '; 135 + sel = prepend_char_to_lines(ch, sel, pht('List Item')); 130 136 update(area, ((r.start === 0) ? '' : '\n\n') + ch, sel, '\n\n'); 131 137 break; 132 138 case 'fa-code': 133 139 sel = sel || 'foreach ($list as $item) {\n work_miracles($item);\n}'; 134 140 var code_prefix = (r.start === 0) ? '' : '\n'; 135 141 update(area, code_prefix + '```\n', sel, '\n```'); 142 + break; 143 + case 'fa-quote-right': 144 + ch = '> '; 145 + sel = prepend_char_to_lines(ch, sel, pht('Quoted Text')); 146 + update(area, ((r.start === 0) ? '' : '\n\n') + ch, sel, '\n\n'); 136 147 break; 137 148 case 'fa-table': 138 149 var table_prefix = (r.start === 0 ? '' : '\n\n');