mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 02:32:42 +01:00
Quoted text remarkup should be smart enough to know when to add a '>' and when to add '> '
Summary: Fixes T8565, Quoted text remarkup should be smart enough to know when to add a '>' and when to add '> ' Test Plan: Open an object with remarkup comments, add 'quote', select that text click the quote button in the remarkup menu, text should become '> quote'. Select and click again, text should become '>> quote'. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T8565 Differential Revision: https://secure.phabricator.com/D13334
This commit is contained in:
parent
e270157fcb
commit
46a225c7b1
2 changed files with 28 additions and 16 deletions
|
@ -8,7 +8,7 @@
|
|||
return array(
|
||||
'names' => array(
|
||||
'core.pkg.css' => 'd7ecac6d',
|
||||
'core.pkg.js' => '288f6571',
|
||||
'core.pkg.js' => 'e0117d99',
|
||||
'darkconsole.pkg.js' => 'e7393ebb',
|
||||
'differential.pkg.css' => '02273347',
|
||||
'differential.pkg.js' => 'ebef29b1',
|
||||
|
@ -460,7 +460,7 @@ return array(
|
|||
'rsrc/js/core/behavior-object-selector.js' => '49b73b36',
|
||||
'rsrc/js/core/behavior-oncopy.js' => '2926fff2',
|
||||
'rsrc/js/core/behavior-phabricator-nav.js' => '14d7a8b8',
|
||||
'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => '095ed313',
|
||||
'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'eeaa9e5a',
|
||||
'rsrc/js/core/behavior-refresh-csrf.js' => '7814b593',
|
||||
'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45',
|
||||
'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e',
|
||||
|
@ -611,7 +611,7 @@ return array(
|
|||
'javelin-behavior-phabricator-notification-example' => '8ce821c5',
|
||||
'javelin-behavior-phabricator-object-selector' => '49b73b36',
|
||||
'javelin-behavior-phabricator-oncopy' => '2926fff2',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => '095ed313',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => 'eeaa9e5a',
|
||||
'javelin-behavior-phabricator-reveal-content' => '60821bc7',
|
||||
'javelin-behavior-phabricator-search-typeahead' => '048330fa',
|
||||
'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6',
|
||||
|
@ -885,15 +885,6 @@ return array(
|
|||
'javelin-stratcom',
|
||||
'javelin-vector',
|
||||
),
|
||||
'095ed313' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
'javelin-dom',
|
||||
'phabricator-phtize',
|
||||
'phabricator-textareautils',
|
||||
'javelin-workflow',
|
||||
'javelin-vector',
|
||||
),
|
||||
'0a3f3021' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
|
@ -1948,6 +1939,15 @@ return array(
|
|||
'phabricator-phtize',
|
||||
'javelin-dom',
|
||||
),
|
||||
'eeaa9e5a' => array(
|
||||
'javelin-behavior',
|
||||
'javelin-stratcom',
|
||||
'javelin-dom',
|
||||
'phabricator-phtize',
|
||||
'phabricator-textareautils',
|
||||
'javelin-workflow',
|
||||
'javelin-vector',
|
||||
),
|
||||
'efe49472' => array(
|
||||
'javelin-install',
|
||||
'javelin-util',
|
||||
|
|
|
@ -99,8 +99,20 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
|
|||
} else {
|
||||
sel = [def];
|
||||
}
|
||||
sel = sel.join('\n' + ch);
|
||||
return sel;
|
||||
|
||||
if (ch === '>') {
|
||||
for(var i=0; i < sel.length; i++) {
|
||||
if (sel[i][0] === '>') {
|
||||
ch = '>';
|
||||
} else {
|
||||
ch = '> ';
|
||||
}
|
||||
sel[i] = ch + sel[i];
|
||||
}
|
||||
return sel.join('\n');
|
||||
}
|
||||
|
||||
return sel.join('\n' + ch);
|
||||
}
|
||||
|
||||
function assist(area, action, root) {
|
||||
|
@ -143,7 +155,7 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
|
|||
case 'fa-quote-right':
|
||||
ch = '>';
|
||||
sel = prepend_char_to_lines(ch, sel, pht('Quoted Text'));
|
||||
update(area, ((r.start === 0) ? '' : '\n\n') + ch, sel, '\n\n');
|
||||
update(area, ((r.start === 0) ? '' : '\n\n'), sel, '\n\n');
|
||||
break;
|
||||
case 'fa-table':
|
||||
var table_prefix = (r.start === 0 ? '' : '\n\n');
|
||||
|
|
Loading…
Reference in a new issue