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

Delete all old dropdown menu code

Summary: Everything is on PHUIX now, so get rid of the old stuff which had standalone CSS.

Test Plan: `grep`

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

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

+3 -282
+3 -2
resources/celerity/packages.php
··· 33 33 'javelin-behavior-refresh-csrf', 34 34 'javelin-behavior-phabricator-watch-anchor', 35 35 'javelin-behavior-phabricator-autofocus', 36 - 'phabricator-menu-item', 37 - 'phabricator-dropdown-menu', 36 + 'phuix-dropdown-menu', 37 + 'phuix-action-list-view', 38 + 'phuix-action-view', 38 39 'phabricator-phtize', 39 40 'javelin-behavior-phabricator-oncopy', 40 41 'phabricator-tooltip',
-1
webroot/rsrc/css/core/z-index.css
··· 133 133 z-index: 20; 134 134 } 135 135 136 - .dropdown-menu-frame, 137 136 .phuix-dropdown-menu { 138 137 z-index: 32; 139 138 }
-31
webroot/rsrc/css/phui/phui-button.css
··· 166 166 text-decoration: underline; 167 167 } 168 168 169 - .dropdown-menu-frame, 170 169 .phuix-dropdown-menu { 171 170 position: absolute; 172 171 width: 240px; ··· 178 177 border-bottom-color: {$greyborder}; 179 178 } 180 179 181 - .dropdown-menu-frame .dropdown-menu-item { 182 - display: block; 183 - padding: 2px 10px; 184 - clear: both; 185 - line-height: 20px; 186 - color: {$darkgreytext}; 187 - white-space: nowrap; 188 - } 189 - 190 - .dropdown-menu-frame .dropdown-menu-item-disabled { 191 - color: {$lightgreytext}; 192 - } 193 - 194 - .dropdown-menu-frame .phui-icon-view { 195 - display: inline-block; 196 - padding: 0; 197 - margin: 2px 6px -2px 4px; 198 - } 199 - 200 180 a.policy-control { 201 181 width: 240px; 202 182 text-align: left; ··· 211 191 dropdown buttons? */ 212 192 top: 4px; 213 193 left: 7px; 214 - } 215 - 216 - .dropdown-menu-frame .dropdown-menu-item-selected { 217 - background: {$lightblue}; 218 - } 219 - 220 - .dropdown-menu-frame a:hover { 221 - background: {$blue}; 222 - color: white; 223 - cursor: pointer; 224 - text-decoration: none; 225 194 } 226 195 227 196 a.toggle {
-192
webroot/rsrc/js/core/DropdownMenu.js
··· 1 - /** 2 - * @requires javelin-install 3 - * javelin-util 4 - * javelin-dom 5 - * javelin-vector 6 - * javelin-stratcom 7 - * phabricator-menu-item 8 - * @provides phabricator-dropdown-menu 9 - * @javelin 10 - */ 11 - 12 - JX.install('PhabricatorDropdownMenu', { 13 - 14 - construct : function(node) { 15 - this._node = node; 16 - this._items = []; 17 - this._menu = JX.$N('div', { className : 'dropdown-menu-frame' }); 18 - 19 - JX.DOM.listen( 20 - this._node, 21 - 'click', 22 - null, 23 - JX.bind(this, this._onclick)); 24 - 25 - JX.DOM.listen( 26 - this._menu, 27 - 'click', 28 - null, 29 - JX.bind(this, this._onclickitem)); 30 - 31 - JX.Stratcom.listen( 32 - 'mousedown', 33 - null, 34 - JX.bind(this, this._onclickglobal)); 35 - 36 - JX.Stratcom.listen( 37 - 'resize', 38 - null, 39 - JX.bind(this, this._onresize)); 40 - 41 - JX.PhabricatorDropdownMenu.listen( 42 - 'open', 43 - JX.bind(this, this.close)); 44 - }, 45 - 46 - events : ['open'], 47 - 48 - properties : { 49 - width : null 50 - }, 51 - 52 - members : { 53 - _node : null, 54 - _menu : null, 55 - _open : false, 56 - _items : null, 57 - _alignRight : true, 58 - 59 - // By default, the dropdown will have its right edge aligned with the 60 - // right edge of _node. Making this false does left edge alignment 61 - toggleAlignDropdownRight : function (bool) { 62 - this._alignRight = bool; 63 - }, 64 - 65 - open : function() { 66 - if (this._open) { 67 - return; 68 - } 69 - 70 - this.invoke('open'); 71 - 72 - var menu_items = []; 73 - for (var ii = 0; ii < this._items.length; ii++) { 74 - menu_items.push(this._items[ii].render()); 75 - } 76 - JX.DOM.setContent(this._menu, menu_items); 77 - 78 - this._open = true; 79 - this._show(); 80 - 81 - return this; 82 - }, 83 - 84 - close : function() { 85 - if (!this._open) { 86 - return; 87 - } 88 - this._open = false; 89 - this._hide(); 90 - 91 - return this; 92 - }, 93 - 94 - clear : function() { 95 - this._items = []; 96 - return this; 97 - }, 98 - 99 - addItem : function(item) { 100 - if (__DEV__) { 101 - if (!(item instanceof JX.PhabricatorMenuItem)) { 102 - JX.$E( 103 - 'JX.DropdownMenu.addItem(<junk>): ' + 104 - 'item must be a JX.PhabricatorMenuItem.'); 105 - } 106 - } 107 - this._items.push(item); 108 - return this; 109 - }, 110 - 111 - _onclick : function(e) { 112 - if (this._open) { 113 - this.close(); 114 - } else { 115 - this.open(); 116 - } 117 - e.prevent(); 118 - }, 119 - 120 - _onclickitem : function(e) { 121 - var item = JX.Stratcom.getData(e.getTarget()).item; 122 - if (!item) { 123 - return; 124 - } 125 - 126 - if (item.getDisabled()) { 127 - e.prevent(); 128 - return; 129 - } 130 - 131 - item.select(); 132 - e.prevent(); 133 - this.close(); 134 - }, 135 - 136 - _onclickglobal : function(e) { 137 - if (!this._open) { 138 - return; 139 - } 140 - 141 - if (JX.Stratcom.pass(e)) { 142 - return; 143 - } 144 - 145 - var t = e.getTarget(); 146 - while (t) { 147 - if (t == this._menu || t == this._node) { 148 - return; 149 - } 150 - t = t.parentNode; 151 - } 152 - 153 - this.close(); 154 - }, 155 - 156 - _show : function() { 157 - document.body.appendChild(this._menu); 158 - 159 - if (this.getWidth()) { 160 - new JX.Vector(this.getWidth(), null).setDim(this._menu); 161 - } 162 - 163 - this._onresize(); 164 - 165 - JX.DOM.alterClass(this._node, 'dropdown-open', true); 166 - }, 167 - 168 - _onresize : function() { 169 - if (!this._open) { 170 - return; 171 - } 172 - 173 - var m = JX.Vector.getDim(this._menu); 174 - 175 - var v = JX.$V(this._node); 176 - var d = JX.Vector.getDim(this._node); 177 - if (this._alignRight) { 178 - v = v.add(d) 179 - .add(JX.$V(-m.x, 0)); 180 - } else { 181 - v = v.add(0, d.y); 182 - } 183 - v.setPos(this._menu); 184 - }, 185 - 186 - _hide : function() { 187 - JX.DOM.remove(this._menu); 188 - JX.DOM.alterClass(this._node, 'dropdown-open', false); 189 - } 190 - 191 - } 192 - });
-56
webroot/rsrc/js/core/DropdownMenuItem.js
··· 1 - /** 2 - * @requires javelin-install 3 - * javelin-dom 4 - * @provides phabricator-menu-item 5 - * @javelin 6 - */ 7 - 8 - JX.install('PhabricatorMenuItem', { 9 - 10 - construct : function(name, action, href) { 11 - this.setName(name); 12 - this.setHref(href || '#'); 13 - this._action = action; 14 - }, 15 - 16 - members : { 17 - _action : null, 18 - 19 - render : function() { 20 - var classes = []; 21 - classes.push('dropdown-menu-item'); 22 - 23 - if (this.getSelected()) { 24 - classes.push('dropdown-menu-item-selected'); 25 - } 26 - 27 - if (this.getDisabled()) { 28 - classes.push('dropdown-menu-item-disabled'); 29 - } 30 - 31 - var attrs = { 32 - href: this.getHref(), 33 - meta: { item: this }, 34 - className: classes.join(' ') 35 - }; 36 - 37 - if (this.getDisabled()) { 38 - return JX.$N('span', attrs, this.getName()); 39 - } else { 40 - return JX.$N('a', attrs, this.getName()); 41 - } 42 - }, 43 - 44 - select : function() { 45 - this._action(); 46 - } 47 - }, 48 - 49 - properties : { 50 - name: '', 51 - href: '', 52 - disabled: false, 53 - selected: false 54 - } 55 - 56 - });