Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13992743
D14814.id35817.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
13 KB
Referenced Files
None
Subscribers
None
D14814.id35817.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,8 +7,8 @@
*/
return array(
'names' => array(
- 'core.pkg.css' => '8378907a',
- 'core.pkg.js' => '5058979d',
+ 'core.pkg.css' => 'cc8abd0e',
+ 'core.pkg.js' => 'e0379ae5',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '2de124c9',
'differential.pkg.js' => '6223dd9d',
@@ -132,7 +132,7 @@
'rsrc/css/phui/phui-feed-story.css' => 'b7b26d23',
'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
'rsrc/css/phui/phui-form-view.css' => 'cf7da606',
- 'rsrc/css/phui/phui-form.css' => 'afdb2c6e',
+ 'rsrc/css/phui/phui-form.css' => '0b98e572',
'rsrc/css/phui/phui-header-view.css' => '55bb32dd',
'rsrc/css/phui/phui-icon.css' => 'b0a6b1b6',
'rsrc/css/phui/phui-image-mask.css' => '5a8b09c8',
@@ -244,7 +244,7 @@
'rsrc/externals/javelin/lib/__tests__/URI.js' => '1e45fda9',
'rsrc/externals/javelin/lib/__tests__/behavior.js' => '1ea62783',
'rsrc/externals/javelin/lib/behavior.js' => '61cbc29a',
- 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => 'c431f925',
+ 'rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js' => '8d3bc1b2',
'rsrc/externals/javelin/lib/control/typeahead/Typeahead.js' => '70baed2f',
'rsrc/externals/javelin/lib/control/typeahead/normalizer/TypeaheadNormalizer.js' => 'e6e25838',
'rsrc/externals/javelin/lib/control/typeahead/source/TypeaheadCompositeSource.js' => '503e17fd',
@@ -415,7 +415,7 @@
'rsrc/js/application/phortune/behavior-stripe-payment-form.js' => '3f5d6dbf',
'rsrc/js/application/phortune/behavior-test-payment-form.js' => 'fc91ab6c',
'rsrc/js/application/phortune/phortune-credit-card-form.js' => '2290aeef',
- 'rsrc/js/application/policy/behavior-policy-control.js' => '7d470398',
+ 'rsrc/js/application/policy/behavior-policy-control.js' => 'ae45872f',
'rsrc/js/application/policy/behavior-policy-rule-editor.js' => '5e9f347c',
'rsrc/js/application/projects/behavior-project-boards.js' => 'ba4fa35c',
'rsrc/js/application/projects/behavior-project-create.js' => '065227cc',
@@ -456,7 +456,7 @@
'rsrc/js/core/KeyboardShortcutManager.js' => 'c1700f6f',
'rsrc/js/core/MultirowRowManager.js' => 'b5d57730',
'rsrc/js/core/Notification.js' => 'ccf1cbf8',
- 'rsrc/js/core/Prefab.js' => 'be38fe4e',
+ 'rsrc/js/core/Prefab.js' => '666c80c5',
'rsrc/js/core/ShapedRequest.js' => '7cbe244b',
'rsrc/js/core/TextAreaUtils.js' => '5c93c52c',
'rsrc/js/core/Title.js' => 'df5e11d2',
@@ -486,7 +486,7 @@
'rsrc/js/core/behavior-object-selector.js' => '49b73b36',
'rsrc/js/core/behavior-oncopy.js' => '2926fff2',
'rsrc/js/core/behavior-phabricator-nav.js' => '56a1ca03',
- 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'eeaa9e5a',
+ 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'c14b5995',
'rsrc/js/core/behavior-refresh-csrf.js' => 'ab2f381b',
'rsrc/js/core/behavior-remarkup-preview.js' => 'f7379f45',
'rsrc/js/core/behavior-reorder-applications.js' => '76b9fc3e',
@@ -639,7 +639,7 @@
'javelin-behavior-phabricator-notification-example' => '8ce821c5',
'javelin-behavior-phabricator-object-selector' => '49b73b36',
'javelin-behavior-phabricator-oncopy' => '2926fff2',
- 'javelin-behavior-phabricator-remarkup-assist' => 'eeaa9e5a',
+ 'javelin-behavior-phabricator-remarkup-assist' => 'c14b5995',
'javelin-behavior-phabricator-reveal-content' => '60821bc7',
'javelin-behavior-phabricator-search-typeahead' => '048330fa',
'javelin-behavior-phabricator-show-older-transactions' => 'dbbf48b6',
@@ -651,7 +651,7 @@
'javelin-behavior-pholio-mock-view' => 'fbe497e7',
'javelin-behavior-phui-dropdown-menu' => '54733475',
'javelin-behavior-phui-object-box-tabs' => '2bfa2836',
- 'javelin-behavior-policy-control' => '7d470398',
+ 'javelin-behavior-policy-control' => 'ae45872f',
'javelin-behavior-policy-rule-editor' => '5e9f347c',
'javelin-behavior-project-boards' => 'ba4fa35c',
'javelin-behavior-project-create' => '065227cc',
@@ -702,7 +702,7 @@
'javelin-scrollbar' => '087e919c',
'javelin-sound' => '949c0fe5',
'javelin-stratcom' => '6c53634d',
- 'javelin-tokenizer' => 'c431f925',
+ 'javelin-tokenizer' => '8d3bc1b2',
'javelin-typeahead' => '70baed2f',
'javelin-typeahead-composite-source' => '503e17fd',
'javelin-typeahead-normalizer' => 'e6e25838',
@@ -757,7 +757,7 @@
'phabricator-notification-menu-css' => 'f31c0bde',
'phabricator-object-selector-css' => '85ee8ce6',
'phabricator-phtize' => 'd254d646',
- 'phabricator-prefab' => 'be38fe4e',
+ 'phabricator-prefab' => '666c80c5',
'phabricator-remarkup-css' => '275e362f',
'phabricator-search-results-css' => '7dea472c',
'phabricator-shaped-request' => '7cbe244b',
@@ -804,7 +804,7 @@
'phui-feed-story-css' => 'b7b26d23',
'phui-font-icon-base-css' => 'ecbbb4c2',
'phui-fontkit-css' => '9cda225e',
- 'phui-form-css' => 'afdb2c6e',
+ 'phui-form-css' => '0b98e572',
'phui-form-view-css' => 'cf7da606',
'phui-header-view-css' => '55bb32dd',
'phui-icon-view-css' => 'b0a6b1b6',
@@ -1293,6 +1293,18 @@
'javelin-vector',
'differential-inline-comment-editor',
),
+ '666c80c5' => array(
+ 'javelin-install',
+ 'javelin-util',
+ 'javelin-dom',
+ 'javelin-typeahead',
+ 'javelin-tokenizer',
+ 'javelin-typeahead-preloaded-source',
+ 'javelin-typeahead-ondemand-source',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-util',
+ ),
'6882e80a' => array(
'javelin-dom',
),
@@ -1391,15 +1403,6 @@
'javelin-request',
'javelin-router',
),
- '7d470398' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-util',
- 'phuix-dropdown-menu',
- 'phuix-action-list-view',
- 'phuix-action-view',
- 'javelin-workflow',
- ),
'7e41274a' => array(
'javelin-install',
),
@@ -1496,6 +1499,12 @@
'javelin-dom',
'javelin-util',
),
+ '8d3bc1b2' => array(
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-install',
+ ),
'8ef9ab58' => array(
'javelin-behavior',
'javelin-dom',
@@ -1645,6 +1654,15 @@
'javelin-uri',
'phabricator-file-upload',
),
+ 'ae45872f' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-util',
+ 'phuix-dropdown-menu',
+ 'phuix-action-list-view',
+ 'phuix-action-view',
+ 'javelin-workflow',
+ ),
'b064af76' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1741,21 +1759,18 @@
'javelin-util',
'javelin-request',
),
- 'be38fe4e' => array(
+ 'bff6884b' => array(
'javelin-install',
- 'javelin-util',
- 'javelin-dom',
- 'javelin-typeahead',
- 'javelin-tokenizer',
- 'javelin-typeahead-preloaded-source',
- 'javelin-typeahead-ondemand-source',
'javelin-dom',
- 'javelin-stratcom',
- 'javelin-util',
),
- 'bff6884b' => array(
- 'javelin-install',
+ 'c14b5995' => array(
+ 'javelin-behavior',
+ 'javelin-stratcom',
'javelin-dom',
+ 'phabricator-phtize',
+ 'phabricator-textareautils',
+ 'javelin-workflow',
+ 'javelin-vector',
),
'c1700f6f' => array(
'javelin-install',
@@ -1764,12 +1779,6 @@
'javelin-dom',
'javelin-vector',
),
- 'c431f925' => array(
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-install',
- ),
'c72aa091' => array(
'javelin-behavior',
'javelin-dom',
@@ -1961,15 +1970,6 @@
'javelin-behavior',
'javelin-uri',
),
- 'eeaa9e5a' => array(
- 'javelin-behavior',
- 'javelin-stratcom',
- 'javelin-dom',
- 'phabricator-phtize',
- 'phabricator-textareautils',
- 'javelin-workflow',
- 'javelin-vector',
- ),
'efe49472' => array(
'javelin-install',
'javelin-util',
diff --git a/src/view/form/control/AphrontFormPolicyControl.php b/src/view/form/control/AphrontFormPolicyControl.php
--- a/src/view/form/control/AphrontFormPolicyControl.php
+++ b/src/view/form/control/AphrontFormPolicyControl.php
@@ -272,6 +272,7 @@
'capability' => $this->capability,
'editURI' => '/policy/edit/'.$context_path,
'customPlaceholder' => $this->getCustomPolicyPlaceholder(),
+ 'disabled' => $this->getDisabled(),
));
$selected = idx($flat_options, $this->getValue(), array());
@@ -350,6 +351,7 @@
$viewer,
$space_phid),
array(
+ 'disabled' => $this->getDisabled(),
'name' => 'spacePHID',
'class' => 'aphront-space-select-control-knob',
));
diff --git a/src/view/form/control/AphrontFormTokenizerControl.php b/src/view/form/control/AphrontFormTokenizerControl.php
--- a/src/view/form/control/AphrontFormTokenizerControl.php
+++ b/src/view/form/control/AphrontFormTokenizerControl.php
@@ -112,6 +112,7 @@
'username' => $username,
'placeholder' => $placeholder,
'browseURI' => $browse_uri,
+ 'disabled' => $this->getDisabled(),
));
}
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
@@ -31,14 +31,16 @@
// currently ship JS or CSS.
require_celerity_resource('lightbox-attachment-css');
- Javelin::initBehavior(
- 'aphront-drag-and-drop-textarea',
- array(
- 'target' => $id,
- 'activatedClass' => 'aphront-textarea-drag-and-drop',
- 'uri' => '/file/dropupload/',
- 'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(),
- ));
+ if (!$this->getDisabled()) {
+ Javelin::initBehavior(
+ 'aphront-drag-and-drop-textarea',
+ array(
+ 'target' => $id,
+ 'activatedClass' => 'aphront-textarea-drag-and-drop',
+ 'uri' => '/file/dropupload/',
+ 'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(),
+ ));
+ }
Javelin::initBehavior(
'phabricator-remarkup-assist',
@@ -53,6 +55,7 @@
'name' => pht('name'),
'URL' => pht('URL'),
),
+ 'disabled' => $this->getDisabled(),
));
Javelin::initBehavior('phabricator-tooltips', array());
@@ -175,12 +178,18 @@
$tip);
}
+ $sigils = array();
+ $sigils[] = 'remarkup-assist';
+ if (!$this->getDisabled()) {
+ $sigils[] = 'has-tooltip';
+ }
+
$buttons[] = javelin_tag(
'a',
array(
'class' => implode(' ', $classes),
'href' => $href,
- 'sigil' => 'remarkup-assist has-tooltip',
+ 'sigil' => implode(' ', $sigils),
'meta' => $meta,
'mustcapture' => $mustcapture,
'target' => $target,
@@ -220,6 +229,7 @@
'div',
array(
'sigil' => 'remarkup-assist-control',
+ 'class' => $this->getDisabled() ? 'disabled-control' : null,
),
array(
$buttons,
diff --git a/webroot/rsrc/css/phui/phui-form.css b/webroot/rsrc/css/phui/phui-form.css
--- a/webroot/rsrc/css/phui/phui-form.css
+++ b/webroot/rsrc/css/phui/phui-form.css
@@ -142,7 +142,9 @@
}
select[disabled],
-input[disabled] {
+input[disabled],
+textarea[disabled],
+.disabled-control {
opacity: 0.5;
}
diff --git a/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js b/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js
--- a/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js
+++ b/webroot/rsrc/externals/javelin/lib/control/tokenizer/Tokenizer.js
@@ -46,7 +46,8 @@
properties : {
limit : null,
renderTokenCallback : null,
- browseURI: null
+ browseURI: null,
+ disabled: false
},
members : {
@@ -65,6 +66,11 @@
_placeholder : null,
start : function() {
+ if (this.getDisabled()) {
+ JX.DOM.alterClass(this._containerNode, 'disabled-control', true);
+ return;
+ }
+
if (__DEV__) {
if (!this._typeahead) {
throw new Error(
diff --git a/webroot/rsrc/js/application/policy/behavior-policy-control.js b/webroot/rsrc/js/application/policy/behavior-policy-control.js
--- a/webroot/rsrc/js/application/policy/behavior-policy-control.js
+++ b/webroot/rsrc/js/application/policy/behavior-policy-control.js
@@ -14,6 +14,14 @@
var input = JX.$(config.inputID);
var value = config.value;
+ if (config.disabled) {
+ JX.DOM.alterClass(control, 'disabled-control', true);
+ JX.DOM.listen(control, 'click', null, function(e) {
+ e.kill();
+ });
+ return;
+ }
+
var menu = new JX.PHUIXDropdownMenu(control)
.setWidth(260)
.setAlign('left');
diff --git a/webroot/rsrc/js/core/Prefab.js b/webroot/rsrc/js/core/Prefab.js
--- a/webroot/rsrc/js/core/Prefab.js
+++ b/webroot/rsrc/js/core/Prefab.js
@@ -240,6 +240,10 @@
tokenizer.setBrowseURI(config.browseURI);
}
+ if (config.disabled) {
+ tokenizer.setDisabled(true);
+ }
+
JX.Stratcom.addData(root, {'tokenizer' : tokenizer});
return {
diff --git a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
--- a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
+++ b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js
@@ -196,6 +196,10 @@
e.kill();
+ if (config.disabled) {
+ return;
+ }
+
var root = e.getNode('remarkup-assist-control');
var area = JX.DOM.find(root, 'textarea');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 23, 6:32 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711369
Default Alt Text
D14814.id35817.diff (13 KB)
Attached To
Mode
D14814: Give custom controls passable disabled states
Attached
Detach File
Event Timeline
Log In to Comment