diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php index a7c0c52d5..7444c9daa 100644 --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -1,177 +1,178 @@ <?php return array( 'javelin.pkg.js' => array( 'javelin-util', 'javelin-install', 'javelin-event', 'javelin-stratcom', 'javelin-behavior', 'javelin-resource', 'javelin-request', 'javelin-vector', 'javelin-dom', 'javelin-json', 'javelin-uri', 'javelin-workflow', 'javelin-mask', 'javelin-typeahead', 'javelin-typeahead-normalizer', 'javelin-typeahead-source', 'javelin-typeahead-preloaded-source', 'javelin-typeahead-ondemand-source', 'javelin-tokenizer', 'javelin-history', ), 'core.pkg.js' => array( 'javelin-behavior-aphront-basic-tokenizer', 'javelin-behavior-workflow', 'javelin-behavior-aphront-form-disable-on-submit', 'phabricator-keyboard-shortcut-manager', 'phabricator-keyboard-shortcut', 'javelin-behavior-phabricator-keyboard-shortcuts', 'javelin-behavior-refresh-csrf', 'javelin-behavior-phabricator-watch-anchor', 'javelin-behavior-phabricator-autofocus', - 'phabricator-menu-item', - 'phabricator-dropdown-menu', + 'phuix-dropdown-menu', + 'phuix-action-list-view', + 'phuix-action-view', 'phabricator-phtize', 'javelin-behavior-phabricator-oncopy', 'phabricator-tooltip', 'javelin-behavior-phabricator-tooltips', 'phabricator-prefab', 'javelin-behavior-device', 'javelin-behavior-toggle-class', 'javelin-behavior-lightbox-attachments', 'phabricator-busy', 'javelin-aphlict', 'phabricator-notification', 'javelin-behavior-aphlict-listen', 'javelin-behavior-phabricator-search-typeahead', 'javelin-behavior-konami', 'javelin-behavior-aphlict-dropdown', 'javelin-behavior-history-install', 'javelin-behavior-phabricator-gesture', 'javelin-behavior-phabricator-active-nav', 'javelin-behavior-phabricator-nav', 'javelin-behavior-phabricator-remarkup-assist', 'phabricator-textareautils', 'phabricator-file-upload', 'javelin-behavior-global-drag-and-drop', 'javelin-behavior-phabricator-reveal-content', 'phabricator-hovercard', 'javelin-behavior-phabricator-hovercards', 'javelin-color', 'javelin-fx', ), 'core.pkg.css' => array( 'phabricator-core-css', 'phabricator-zindex-css', 'phui-button-css', 'phabricator-standard-page-view', 'aphront-dialog-view-css', 'phui-form-view-css', 'aphront-panel-view-css', 'aphront-table-view-css', 'aphront-tokenizer-control-css', 'aphront-typeahead-control-css', 'aphront-list-filter-view-css', 'phabricator-jump-nav', 'phabricator-remarkup-css', 'syntax-highlighting-css', 'aphront-pager-view-css', 'phabricator-transaction-view-css', 'aphront-tooltip-css', 'phabricator-flag-css', 'aphront-error-view-css', 'sprite-icons-css', 'sprite-gradient-css', 'sprite-menu-css', 'sprite-apps-large-css', 'sprite-status-css', 'phabricator-main-menu-view', 'phabricator-notification-css', 'phabricator-notification-menu-css', 'lightbox-attachment-css', 'phui-header-view-css', 'phabricator-filetree-view-css', 'phabricator-nav-view-css', 'phabricator-side-menu-view-css', 'phabricator-crumbs-view-css', 'phui-object-item-list-view-css', 'global-drag-and-drop-css', 'phui-spacing-css', 'phui-form-css', 'phui-icon-view-css', 'phabricator-application-launch-view-css', 'phabricator-action-list-view-css', 'phui-property-list-view-css', 'phui-tag-view-css', 'phui-list-view-css', ), 'differential.pkg.css' => array( 'differential-core-view-css', 'differential-changeset-view-css', 'differential-results-table-css', 'differential-revision-history-css', 'differential-revision-list-css', 'differential-table-of-contents-css', 'differential-revision-comment-css', 'differential-revision-add-comment-css', 'phabricator-object-selector-css', 'phabricator-content-source-view-css', 'inline-comment-summary-css', ), 'differential.pkg.js' => array( 'phabricator-drag-and-drop-file-upload', 'phabricator-shaped-request', 'javelin-behavior-differential-feedback-preview', 'javelin-behavior-differential-edit-inline-comments', 'javelin-behavior-differential-populate', 'javelin-behavior-differential-show-more', 'javelin-behavior-differential-diff-radios', 'javelin-behavior-differential-comment-jump', 'javelin-behavior-differential-add-reviewers-and-ccs', 'javelin-behavior-differential-keyboard-navigation', 'javelin-behavior-aphront-drag-and-drop-textarea', 'javelin-behavior-phabricator-object-selector', 'javelin-behavior-repository-crossreference', 'javelin-behavior-load-blame', 'differential-inline-comment-editor', 'javelin-behavior-differential-dropdown-menus', 'javelin-behavior-differential-toggle-files', 'javelin-behavior-differential-user-select', ), 'diffusion.pkg.css' => array( 'diffusion-commit-view-css', 'diffusion-icons-css', ), 'diffusion.pkg.js' => array( 'javelin-behavior-diffusion-pull-lastmodified', 'javelin-behavior-diffusion-commit-graph', 'javelin-behavior-audit-preview', ), 'maniphest.pkg.css' => array( 'maniphest-task-summary-css', 'phabricator-project-tag-css', ), 'maniphest.pkg.js' => array( 'javelin-behavior-maniphest-batch-selector', 'javelin-behavior-maniphest-transaction-controls', 'javelin-behavior-maniphest-transaction-preview', 'javelin-behavior-maniphest-transaction-expand', 'javelin-behavior-maniphest-subpriority-editor', ), 'darkconsole.pkg.js' => array( 'javelin-behavior-dark-console', 'javelin-behavior-error-log', ), ); diff --git a/webroot/rsrc/css/core/z-index.css b/webroot/rsrc/css/core/z-index.css index 94d636298..1059d315d 100644 --- a/webroot/rsrc/css/core/z-index.css +++ b/webroot/rsrc/css/core/z-index.css @@ -1,155 +1,154 @@ /** * @provides phabricator-zindex-css */ .keyboard-focus-focus-reticle { z-index: 1; } .device-desktop .phui-timeline-minor-event .phui-timeline-image { z-index: 2; } .differential-reticle { z-index: 2; } .differential-changeset { z-index: 2; } .pholio-new-inline-comment { z-index: 2; } .slowvote-bar { z-index: 2; } .slowvote-above-the-bar { z-index: 3; } .phui-timeline-icon-fill { z-index: 3; } .phabricator-nav-column-background { z-index: 3; } .phabricator-crumbs-view { z-index: 3; } .phabricator-nav-local { z-index: 4; } .conpherence-layout .conpherence-no-threads { z-index: 4; } .conpherence-menu-pane { z-index: 4; } .phabricator-nav-drag { z-index: 4; } .loading .messages-loading-mask, .loading .widgets-loading-mask { z-index: 5; } .dark-console { z-index: 5; } .drag-dragging { z-index: 5; } .phui-calendar-date-number { z-index: 5; } .phabricator-main-menu { z-index: 6; } .setup-warning-callout, .aphront-developer-error-callout { z-index: 6; } .jx-notification-container { z-index: 7; } .fancy-datepicker { z-index: 7; } .calendar-button { z-index: 8; } div.jx-typeahead-results { z-index: 8; } .differential-haunt-mode-1 .differential-add-comment-panel, .differential-haunt-mode-2 .differential-add-comment-panel { z-index: 8; } .device-desktop .phabricator-notification-menu { z-index: 9; } .jx-mask { z-index: 10; } .phabricator-global-upload-instructions { z-index: 11; } .lightbox-attachment { z-index: 12; } .jx-client-dialog { z-index: 14; } .jx-hovercard-container { z-index: 16; } .pholio-device-lightbox { z-index: 20; } -.dropdown-menu-frame, .phuix-dropdown-menu { z-index: 32; } .busy { z-index: 40; } .remarkup-control-fullscreen-mode { z-index: 50; } .jx-tooltip-container { z-index: 51; } .audible .aural-only { z-index: 100; } diff --git a/webroot/rsrc/css/phui/phui-button.css b/webroot/rsrc/css/phui/phui-button.css index a504457b3..7a5a048be 100644 --- a/webroot/rsrc/css/phui/phui-button.css +++ b/webroot/rsrc/css/phui/phui-button.css @@ -1,363 +1,332 @@ /** * @provides phui-button-css */ button, a.button { font: 13px/1.231 'Helvetica Neue', Helvetica, Arial, sans-serif; } button, a.button, a.button:visited, input[type="submit"] { background-color: #3477ad; color: white; text-shadow: 0 -1px rgba(0,0,0,0.75); border: 1px solid #19558D; cursor: pointer; font-weight: bold; font-size: 13px; display: inline-block; padding: 3px 10px 4px; text-align: center; white-space: nowrap; border-radius: 3px; background-image: linear-gradient(to bottom, #3b86c4, #2b628f); background-image: -webkit-linear-gradient(top, #3b86c4, #2b628f); } /* Buttons with images (full size only) */ button.icon, a.icon, a.icon:visited { padding-left: 0; position: relative; text-indent: 29px; } button.black, a.black, a.black:visited { background-color: #383838; background-image: linear-gradient(to bottom, #505d65, #2d373c); background-image: -webkit-linear-gradient(top, #505d65, #2d373c); border: 1px solid {$darkgreytext}; border-bottom-color: #000; } button.green, a.green, a.green:visited { background-color: #348e20; background-image: linear-gradient(to bottom, #4e9b33, #158009); background-image: -webkit-linear-gradient(top, #4e9b33, #158009); border: 1px solid #3b6e22; border-bottom-color: #2c5a15; } button.grey, input[type="submit"].grey, a.grey, a.grey:visited { background-color: {$lightgreybackground}; background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); border-color: {$lightgreyborder}; color: {$darkgreytext}; border-bottom-color: {$greyborder}; text-shadow: none; } button.simple, input[type="submit"].simple, a.simple, a.simple:visited { background-color: transparent; background-image: none; border: 1px solid transparent; color: {$bluetext}; text-shadow: 0 1px #fff; } a.disabled, button.disabled, button[disabled] { filter:alpha(opacity=50); -moz-opacity: 0.5; -khtml-opacity: 0.5; opacity: 0.5; } body button:active, body a.button:active { box-shadow: inset 0 0 8px rgba(0,0,0,.6); } button.grey:active, a.grey:active, button.grey_active, a.button.dropdown-open { background-color: #7d7d7d; box-shadow: inset 0 0 4px rgba(0,0,0,.2); } a.dropdown-open { color: {$greytext}; } a.button:hover, button:hover { text-decoration: none; box-shadow: inset 0 0 5px rgba(0,0,0,.4); } a.button.simple:hover, button.simple:hover { background-color: #fff; border: 1px solid {$lightgreyborder}; background-image: none; border-bottom: 1px solid {$greyborder}; text-shadow: none; box-shadow: none; } a.button.grey:hover, button.grey:hover { text-decoration: none; box-shadow: inset 0 0 4px rgba(0,0,0,.2); } body a.button.disabled:hover, body button.disabled:hover, body a.button.disabled:active, body button.disabled:active { box-shadow: none; } button.small, a.small, a.small:visited { padding: 2px 7px; height: auto; font-size: 11px; line-height: 16px; } button.link { display: inline; border: none; background: transparent; font-weight: normal; padding: 0; margin: 0; font-size: inherit; border-bottom: none; text-decoration: none; text-shadow: none; color: #19558D; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } button.link:hover { text-decoration: underline; } -.dropdown-menu-frame, .phuix-dropdown-menu { position: absolute; width: 240px; background: #fff; margin-top: -1px; padding: 5px 0; box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3); border: 1px solid {$lightgreyborder}; border-bottom-color: {$greyborder}; } -.dropdown-menu-frame .dropdown-menu-item { - display: block; - padding: 2px 10px; - clear: both; - line-height: 20px; - color: {$darkgreytext}; - white-space: nowrap; -} - -.dropdown-menu-frame .dropdown-menu-item-disabled { - color: {$lightgreytext}; -} - -.dropdown-menu-frame .phui-icon-view { - display: inline-block; - padding: 0; - margin: 2px 6px -2px 4px; -} - a.policy-control { width: 240px; text-align: left; } a.policy-control .caret { float: right; } a.policy-control span.phui-icon-view { /* NOTE: Nudge these icons a little bit. Should this be for all dropdown buttons? */ top: 4px; left: 7px; } -.dropdown-menu-frame .dropdown-menu-item-selected { - background: {$lightblue}; -} - -.dropdown-menu-frame a:hover { - background: {$blue}; - color: white; - cursor: pointer; - text-decoration: none; -} - a.toggle { display: inline-block; padding: 4px 8px; font-size: 12px; font-weight: bold; color: #555; text-decoration: none; white-space: nowrap; vertical-align: baseline; background-color: {$lightgreybackground}; margin: 0 6px 0 0; border-radius: 3px; box-shadow: inset 0 0 3px rgba(0,0,0,.4); } a.toggle:hover { background-color: #14568e; color: #fff } a.toggle-selected { background-color: #14568e; color: #fff } a.toggle-fixed { cursor: default; } .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-top: 5px solid #fff; border-right: 5px solid transparent; border-left: 5px solid transparent; content: ""; } .caret-right { display: inline-block; width: 0; height: 0; vertical-align: middle; border-left: 7px solid {$greytext}; border-top: 5px solid transparent; border-bottom: 5px solid transparent; content: ""; margin-bottom: 4px; } .caret-left { display: inline-block; width: 0; height: 0; vertical-align: middle; border-right: 7px solid {$greytext}; border-bottom: 5px solid transparent; border-top: 5px solid transparent; content: ""; margin-bottom: 4px; } .dropdown .caret { margin-top: 7px; margin-left: 4px; } .small.dropdown .caret { margin-top: 6px; } .grey.dropdown .caret { border-top-color: #000; } /* Icons */ .button.has-icon { position: relative; } .button .phui-icon-view { display: inline-block; position: absolute; top: 5px; left: 8px; } .button.has-icon .phui-button-text { margin-left: 16px; } /* Login Buttons */ .button.big.has-icon { padding: 6px 20px 6px 12px; border-radius: 4px; text-align: left; } .button.big.has-icon .phui-button-text { margin-left: 36px; font-size: 14px; display: block; } .button.big.has-icon .phui-button-subtext { color: {$lightgreytext}; font-size: 12px; line-height: 15px; font-weight: normal; } /* PHUI Button Bar */ .phui-button-bar a.button { display: inline-block; height: 16px; width: 12px; } .phui-button-bar .phui-button-bar-first { border-top-right-radius: 0px; border-bottom-right-radius: 0px; } .phui-button-bar .phui-button-bar-middle { border-radius: 0; border-left: none; } .phui-button-bar .phui-button-bar-last { border-left: none; border-top-left-radius: 0px; border-bottom-left-radius: 0px; } diff --git a/webroot/rsrc/js/core/DropdownMenu.js b/webroot/rsrc/js/core/DropdownMenu.js deleted file mode 100644 index 490e92e22..000000000 --- a/webroot/rsrc/js/core/DropdownMenu.js +++ /dev/null @@ -1,192 +0,0 @@ -/** - * @requires javelin-install - * javelin-util - * javelin-dom - * javelin-vector - * javelin-stratcom - * phabricator-menu-item - * @provides phabricator-dropdown-menu - * @javelin - */ - -JX.install('PhabricatorDropdownMenu', { - - construct : function(node) { - this._node = node; - this._items = []; - this._menu = JX.$N('div', { className : 'dropdown-menu-frame' }); - - JX.DOM.listen( - this._node, - 'click', - null, - JX.bind(this, this._onclick)); - - JX.DOM.listen( - this._menu, - 'click', - null, - JX.bind(this, this._onclickitem)); - - JX.Stratcom.listen( - 'mousedown', - null, - JX.bind(this, this._onclickglobal)); - - JX.Stratcom.listen( - 'resize', - null, - JX.bind(this, this._onresize)); - - JX.PhabricatorDropdownMenu.listen( - 'open', - JX.bind(this, this.close)); - }, - - events : ['open'], - - properties : { - width : null - }, - - members : { - _node : null, - _menu : null, - _open : false, - _items : null, - _alignRight : true, - - // By default, the dropdown will have its right edge aligned with the - // right edge of _node. Making this false does left edge alignment - toggleAlignDropdownRight : function (bool) { - this._alignRight = bool; - }, - - open : function() { - if (this._open) { - return; - } - - this.invoke('open'); - - var menu_items = []; - for (var ii = 0; ii < this._items.length; ii++) { - menu_items.push(this._items[ii].render()); - } - JX.DOM.setContent(this._menu, menu_items); - - this._open = true; - this._show(); - - return this; - }, - - close : function() { - if (!this._open) { - return; - } - this._open = false; - this._hide(); - - return this; - }, - - clear : function() { - this._items = []; - return this; - }, - - addItem : function(item) { - if (__DEV__) { - if (!(item instanceof JX.PhabricatorMenuItem)) { - JX.$E( - 'JX.DropdownMenu.addItem(<junk>): ' + - 'item must be a JX.PhabricatorMenuItem.'); - } - } - this._items.push(item); - return this; - }, - - _onclick : function(e) { - if (this._open) { - this.close(); - } else { - this.open(); - } - e.prevent(); - }, - - _onclickitem : function(e) { - var item = JX.Stratcom.getData(e.getTarget()).item; - if (!item) { - return; - } - - if (item.getDisabled()) { - e.prevent(); - return; - } - - item.select(); - e.prevent(); - this.close(); - }, - - _onclickglobal : function(e) { - if (!this._open) { - return; - } - - if (JX.Stratcom.pass(e)) { - return; - } - - var t = e.getTarget(); - while (t) { - if (t == this._menu || t == this._node) { - return; - } - t = t.parentNode; - } - - this.close(); - }, - - _show : function() { - document.body.appendChild(this._menu); - - if (this.getWidth()) { - new JX.Vector(this.getWidth(), null).setDim(this._menu); - } - - this._onresize(); - - JX.DOM.alterClass(this._node, 'dropdown-open', true); - }, - - _onresize : function() { - if (!this._open) { - return; - } - - var m = JX.Vector.getDim(this._menu); - - var v = JX.$V(this._node); - var d = JX.Vector.getDim(this._node); - if (this._alignRight) { - v = v.add(d) - .add(JX.$V(-m.x, 0)); - } else { - v = v.add(0, d.y); - } - v.setPos(this._menu); - }, - - _hide : function() { - JX.DOM.remove(this._menu); - JX.DOM.alterClass(this._node, 'dropdown-open', false); - } - - } -}); diff --git a/webroot/rsrc/js/core/DropdownMenuItem.js b/webroot/rsrc/js/core/DropdownMenuItem.js deleted file mode 100644 index ab6c4f587..000000000 --- a/webroot/rsrc/js/core/DropdownMenuItem.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @requires javelin-install - * javelin-dom - * @provides phabricator-menu-item - * @javelin - */ - -JX.install('PhabricatorMenuItem', { - - construct : function(name, action, href) { - this.setName(name); - this.setHref(href || '#'); - this._action = action; - }, - - members : { - _action : null, - - render : function() { - var classes = []; - classes.push('dropdown-menu-item'); - - if (this.getSelected()) { - classes.push('dropdown-menu-item-selected'); - } - - if (this.getDisabled()) { - classes.push('dropdown-menu-item-disabled'); - } - - var attrs = { - href: this.getHref(), - meta: { item: this }, - className: classes.join(' ') - }; - - if (this.getDisabled()) { - return JX.$N('span', attrs, this.getName()); - } else { - return JX.$N('a', attrs, this.getName()); - } - }, - - select : function() { - this._action(); - } - }, - - properties : { - name: '', - href: '', - disabled: false, - selected: false - } - -});