@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.

Added placeholder support to custom text fields

Summary: placeholder text is pretty useful.

Test Plan: placeholder text is pretty useful. also fully supports not breaking everything.

Reviewers: chad, #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

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

authored by

Tal Shiri and committed by
epriestley
2133e610 3c8d88de

+35 -1
+2
src/docs/user/configuration/custom_fields.diviner
··· 103 103 type. See below. 104 104 - **instructions**: Optional block of remarkup text which will appear 105 105 above the control when rendered on the edit view. 106 + - **placeholder**: A placeholder text that appears on text boxes. Only 107 + supported in text, int and remarkup fields (optional). 106 108 107 109 The `strings` value supports different strings per control type. They are: 108 110
+6 -1
src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php
··· 215 215 return $this->getFieldConfigValue('instructions'); 216 216 } 217 217 218 + public function getPlaceholder() { 219 + return $this->getFieldConfigValue('placeholder', null); 220 + } 221 + 218 222 public function renderEditControl(array $handles) { 219 223 return id(new AphrontFormTextControl()) 220 224 ->setName($this->getFieldKey()) 221 225 ->setCaption($this->getCaption()) 222 226 ->setValue($this->getFieldValue()) 223 227 ->setError($this->getFieldError()) 224 - ->setLabel($this->getFieldName()); 228 + ->setLabel($this->getFieldName()) 229 + ->setPlaceholder($this->getPlaceholder()); 225 230 } 226 231 227 232 public function newStorageObject() {
+13
src/view/form/control/AphrontFormTextControl.php
··· 4 4 5 5 private $disableAutocomplete; 6 6 private $sigil; 7 + private $placeholder; 7 8 8 9 public function setDisableAutocomplete($disable) { 9 10 $this->disableAutocomplete = $disable; 10 11 return $this; 11 12 } 13 + 12 14 private function getDisableAutocomplete() { 13 15 return $this->disableAutocomplete; 14 16 } 15 17 18 + public function getPlaceholder() { 19 + return $this->placeholder; 20 + } 21 + 22 + public function setPlaceholder($placeholder) { 23 + $this->placeholder = $placeholder; 24 + return $this; 25 + } 26 + 16 27 public function getSigil() { 17 28 return $this->sigil; 18 29 } 30 + 19 31 public function setSigil($sigil) { 20 32 $this->sigil = $sigil; 21 33 return $this; ··· 36 48 'autocomplete' => $this->getDisableAutocomplete() ? 'off' : null, 37 49 'id' => $this->getID(), 38 50 'sigil' => $this->getSigil(), 51 + 'placeholder' => $this->getPlaceholder() 39 52 )); 40 53 } 41 54
+14
webroot/rsrc/css/phui/phui-form-view.css
··· 49 49 width: 100%; 50 50 } 51 51 52 + .aphront-form-input *::-webkit-input-placeholder { 53 + color:{$greytext} !important; 54 + } 55 + 56 + .aphront-form-input *::-moz-placeholder { 57 + color:{$greytext} !important; 58 + opacity: 1; /* Firefox nudges the opacity to 0.4 */ 59 + } 60 + 61 + .aphront-form-input *:-ms-input-placeholder { 62 + color:{$greytext} !important; 63 + } 64 + 65 + 52 66 .aphront-form-error { 53 67 width: 18%; 54 68 float: right;