Page MenuHomePhabricator

D14856.diff
No OneTemporary

D14856.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,7 +7,7 @@
*/
return array(
'names' => array(
- 'core.pkg.css' => '1a2d5480',
+ 'core.pkg.css' => '357b84b0',
'core.pkg.js' => 'cf262309',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
@@ -104,7 +104,7 @@
'rsrc/css/application/tokens/tokens.css' => '3d0f239e',
'rsrc/css/application/uiexample/example.css' => '528b19de',
'rsrc/css/core/core.css' => 'a76cefc9',
- 'rsrc/css/core/remarkup.css' => '72024fc6',
+ 'rsrc/css/core/remarkup.css' => '7afb543c',
'rsrc/css/core/syntax.css' => '9fd11da8',
'rsrc/css/core/z-index.css' => '57ddcaa2',
'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa',
@@ -427,7 +427,7 @@
'rsrc/js/application/repository/repository-crossreference.js' => 'e5339c43',
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f',
- 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'bb0d2d0c',
+ 'rsrc/js/application/transactions/behavior-comment-actions.js' => 'd885b622',
'rsrc/js/application/transactions/behavior-reorder-configs.js' => 'd7a74243',
'rsrc/js/application/transactions/behavior-reorder-fields.js' => 'b59e1e96',
'rsrc/js/application/transactions/behavior-show-older-transactions.js' => 'dbbf48b6',
@@ -572,7 +572,7 @@
'javelin-behavior-audit-preview' => 'd835b03a',
'javelin-behavior-bulk-job-reload' => 'edf8a145',
'javelin-behavior-choose-control' => 'dfaafb14',
- 'javelin-behavior-comment-actions' => 'bb0d2d0c',
+ 'javelin-behavior-comment-actions' => 'd885b622',
'javelin-behavior-config-reorder-fields' => 'b6993408',
'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a',
'javelin-behavior-conpherence-menu' => '1d45c74d',
@@ -759,7 +759,7 @@
'phabricator-object-selector-css' => '85ee8ce6',
'phabricator-phtize' => 'd254d646',
'phabricator-prefab' => '666c80c5',
- 'phabricator-remarkup-css' => '72024fc6',
+ 'phabricator-remarkup-css' => '7afb543c',
'phabricator-search-results-css' => '7dea472c',
'phabricator-shaped-request' => '7cbe244b',
'phabricator-side-menu-view-css' => 'bec2458e',
@@ -1740,14 +1740,6 @@
'javelin-workflow',
'phabricator-draggable-list',
),
- 'bb0d2d0c' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-dom',
- 'phuix-form-control-view',
- 'phuix-icon-view',
- ),
'bd4c8dca' => array(
'javelin-install',
'javelin-util',
@@ -1870,6 +1862,14 @@
'javelin-util',
'phabricator-shaped-request',
),
+ 'd885b622' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'javelin-dom',
+ 'phuix-form-control-view',
+ 'phuix-icon-view',
+ ),
'dbbf48b6' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php
--- a/src/view/form/control/PhabricatorRemarkupControl.php
+++ b/src/view/form/control/PhabricatorRemarkupControl.php
@@ -65,33 +65,43 @@
$actions = array(
'fa-bold' => array(
'tip' => pht('Bold'),
+ 'nodevice' => true,
),
'fa-italic' => array(
'tip' => pht('Italics'),
+ 'nodevice' => true,
),
'fa-text-width' => array(
'tip' => pht('Monospaced'),
+ 'nodevice' => true,
),
'fa-link' => array(
'tip' => pht('Link'),
+ 'nodevice' => true,
),
array(
'spacer' => true,
+ 'nodevice' => true,
),
'fa-list-ul' => array(
'tip' => pht('Bulleted List'),
+ 'nodevice' => true,
),
'fa-list-ol' => array(
'tip' => pht('Numbered List'),
+ 'nodevice' => true,
),
'fa-code' => array(
'tip' => pht('Code Block'),
+ 'nodevice' => true,
),
'fa-quote-right' => array(
'tip' => pht('Quote'),
+ 'nodevice' => true,
),
'fa-table' => array(
'tip' => pht('Table'),
+ 'nodevice' => true,
),
'fa-cloud-upload' => array(
'tip' => pht('Upload File'),
@@ -155,6 +165,10 @@
$classes[] = 'remarkup-assist-right';
}
+ if (idx($spec, 'nodevice')) {
+ $classes[] = 'remarkup-assist-nodevice';
+ }
+
if (idx($spec, 'spacer')) {
$classes[] = 'remarkup-assist-separator';
$buttons[] = phutil_tag(
diff --git a/webroot/rsrc/css/core/remarkup.css b/webroot/rsrc/css/core/remarkup.css
--- a/webroot/rsrc/css/core/remarkup.css
+++ b/webroot/rsrc/css/core/remarkup.css
@@ -556,3 +556,7 @@
.remarkup-assist-button.preview-active:hover .phui-icon-view {
color: {$lightsky};
}
+
+.device .remarkup-assist-nodevice {
+ display: none;
+}
diff --git a/webroot/rsrc/js/application/transactions/behavior-comment-actions.js b/webroot/rsrc/js/application/transactions/behavior-comment-actions.js
--- a/webroot/rsrc/js/application/transactions/behavior-comment-actions.js
+++ b/webroot/rsrc/js/application/transactions/behavior-comment-actions.js
@@ -115,6 +115,10 @@
}
function onresponse(response) {
+ if (JX.Device.getDevice() != 'desktop') {
+ return;
+ }
+
var panel = JX.$(config.panelID);
if (!response.xactions.length) {
JX.DOM.hide(panel);
@@ -152,7 +156,25 @@
JX.DOM.listen(form_node, 'shouldRefresh', null, always_trigger);
request.start();
+
+ var ondevicechange = function() {
+ var panel = JX.$(config.panelID);
+ if (JX.Device.getDevice() == 'desktop') {
+ request.setRateLimit(500);
+ always_trigger();
+ } else {
+ // On mobile, don't show live previews and only save drafts every
+ // 10 seconds.
+ request.setRateLimit(10000);
+ JX.DOM.hide(panel);
+ }
+ };
+
+ ondevicechange();
+
+ JX.Stratcom.listen('phabricator-device-change', null, ondevicechange);
}
restore_draft_actions(config.drafts || []);
+
});

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 4:21 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7366774
Default Alt Text
D14856.diff (6 KB)

Event Timeline