diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,11 +9,11 @@ 'names' => array( 'conpherence.pkg.css' => 'ff161f2d', 'conpherence.pkg.js' => 'b5b51108', - 'core.pkg.css' => '525ecd1c', + 'core.pkg.css' => 'bb7f0446', 'core.pkg.js' => '1475bd91', 'darkconsole.pkg.js' => '1f9a31bc', - 'differential.pkg.css' => '7d4cfa59', - 'differential.pkg.js' => '1d120743', + 'differential.pkg.css' => '9ebe4f44', + 'differential.pkg.js' => '78b8497f', 'diffusion.pkg.css' => 'b93d9b8c', 'diffusion.pkg.js' => '84c8f8fd', 'favicon.ico' => '30672e08', @@ -64,7 +64,7 @@ 'rsrc/css/application/dashboard/dashboard.css' => 'fe5b1869', 'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a', 'rsrc/css/application/differential/add-comment.css' => 'c47f8c40', - 'rsrc/css/application/differential/changeset-view.css' => 'acfd58f6', + 'rsrc/css/application/differential/changeset-view.css' => '2971e2a2', 'rsrc/css/application/differential/core.css' => '5b7b8ff4', 'rsrc/css/application/differential/phui-inline-comment.css' => 'ffd1a542', 'rsrc/css/application/differential/revision-comment.css' => '14b8565a', @@ -117,7 +117,7 @@ 'rsrc/css/core/core.css' => '9f4cb463', 'rsrc/css/core/remarkup.css' => 'd1a5e11e', 'rsrc/css/core/syntax.css' => 'cae95e89', - 'rsrc/css/core/z-index.css' => '998f3ce1', + 'rsrc/css/core/z-index.css' => '9d8f7c4b', 'rsrc/css/diviner/diviner-shared.css' => '896f1d43', 'rsrc/css/font/font-awesome.css' => 'e838e088', 'rsrc/css/font/font-lato.css' => 'c7ccd872', @@ -391,15 +391,13 @@ 'rsrc/js/application/dashboard/behavior-dashboard-move-panels.js' => '408bf173', 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63', - 'rsrc/js/application/diff/DiffChangeset.js' => 'cf4e2140', - 'rsrc/js/application/diff/DiffChangesetList.js' => '7a184082', - 'rsrc/js/application/diff/DiffInline.js' => '19582231', - 'rsrc/js/application/diff/ScrollObjective.js' => '7e8877e7', - 'rsrc/js/application/diff/ScrollObjectiveList.js' => '6120e99a', + 'rsrc/js/application/diff/DiffChangeset.js' => '3359ad02', + 'rsrc/js/application/diff/DiffChangesetList.js' => '675f1ca3', + 'rsrc/js/application/diff/DiffInline.js' => '45d37835', 'rsrc/js/application/diff/behavior-preview-link.js' => '051c7832', 'rsrc/js/application/differential/behavior-comment-preview.js' => '51c5ad07', 'rsrc/js/application/differential/behavior-diff-radios.js' => 'e1ff79b1', - 'rsrc/js/application/differential/behavior-populate.js' => '1de8bf63', + 'rsrc/js/application/differential/behavior-populate.js' => '5e41c819', 'rsrc/js/application/differential/behavior-user-select.js' => 'a8d8459d', 'rsrc/js/application/diffusion/DiffusionLocateFileSource.js' => 'c93358e3', 'rsrc/js/application/diffusion/behavior-audit-preview.js' => 'd835b03a', @@ -568,7 +566,7 @@ 'conpherence-thread-manager' => '4d863052', 'conpherence-transaction-css' => '85129c68', 'd3' => 'a11a5ff2', - 'differential-changeset-view-css' => 'acfd58f6', + 'differential-changeset-view-css' => '2971e2a2', 'differential-core-view-css' => '5b7b8ff4', 'differential-revision-add-comment-css' => 'c47f8c40', 'differential-revision-comment-css' => '14b8565a', @@ -622,7 +620,7 @@ 'javelin-behavior-diff-preview-link' => '051c7832', 'javelin-behavior-differential-diff-radios' => 'e1ff79b1', 'javelin-behavior-differential-feedback-preview' => '51c5ad07', - 'javelin-behavior-differential-populate' => '1de8bf63', + 'javelin-behavior-differential-populate' => '5e41c819', 'javelin-behavior-differential-user-select' => 'a8d8459d', 'javelin-behavior-diffusion-browse-file' => '054a0f0b', 'javelin-behavior-diffusion-commit-branches' => 'bdaf4d04', @@ -779,9 +777,9 @@ 'phabricator-darklog' => 'c8e1ffe3', 'phabricator-darkmessage' => 'c48cccdd', 'phabricator-dashboard-css' => 'fe5b1869', - 'phabricator-diff-changeset' => 'cf4e2140', - 'phabricator-diff-changeset-list' => '7a184082', - 'phabricator-diff-inline' => '19582231', + 'phabricator-diff-changeset' => '3359ad02', + 'phabricator-diff-changeset-list' => '675f1ca3', + 'phabricator-diff-inline' => '45d37835', 'phabricator-drag-and-drop-file-upload' => '58dea2fa', 'phabricator-draggable-list' => 'bea6e7f4', 'phabricator-fatal-config-template-css' => '8f18fa41', @@ -801,8 +799,6 @@ 'phabricator-phtize' => 'd254d646', 'phabricator-prefab' => 'c5af80a2', 'phabricator-remarkup-css' => 'd1a5e11e', - 'phabricator-scroll-objective' => '7e8877e7', - 'phabricator-scroll-objective-list' => '6120e99a', 'phabricator-search-results-css' => '8f8e08ed', 'phabricator-shaped-request' => '7cbe244b', 'phabricator-slowvote-css' => 'a94b7230', @@ -822,7 +818,7 @@ 'phabricator-uiexample-reactor-select' => 'a155550f', 'phabricator-uiexample-reactor-sendclass' => '1def2711', 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', - 'phabricator-zindex-css' => '998f3ce1', + 'phabricator-zindex-css' => '9d8f7c4b', 'phame-css' => 'b3a0b3a3', 'pholio-css' => 'ca89d380', 'pholio-edit-css' => '07676f51', @@ -1002,9 +998,6 @@ '185bbd53' => array( 'javelin-install', ), - 19582231 => array( - 'javelin-dom', - ), '19f9369b' => array( 'phui-oi-list-view-css', ), @@ -1026,14 +1019,6 @@ 'javelin-request', 'javelin-uri', ), - '1de8bf63' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-stratcom', - 'phabricator-tooltip', - 'phabricator-diff-changeset-list', - 'phabricator-diff-changeset', - ), '1def2711' => array( 'javelin-install', 'javelin-dom', @@ -1087,6 +1072,9 @@ 'javelin-install', 'javelin-util', ), + '2971e2a2' => array( + 'phui-inline-comment-view-css', + ), '2ae077e1' => array( 'javelin-behavior', 'javelin-dom', @@ -1122,6 +1110,17 @@ 'javelin-dom', 'javelin-workflow', ), + '3359ad02' => array( + 'javelin-dom', + 'javelin-util', + 'javelin-stratcom', + 'javelin-install', + 'javelin-workflow', + 'javelin-router', + 'javelin-behavior-device', + 'javelin-vector', + 'phabricator-diff-inline', + ), '358b8c04' => array( 'javelin-install', 'javelin-util', @@ -1204,6 +1203,9 @@ 'javelin-behavior', 'javelin-dom', ), + '45d37835' => array( + 'javelin-dom', + ), '469c0d9e' => array( 'javelin-behavior', 'javelin-dom', @@ -1371,6 +1373,14 @@ 'phabricator-phtize', 'javelin-dom', ), + '5e41c819' => array( + 'javelin-behavior', + 'javelin-dom', + 'javelin-stratcom', + 'phabricator-tooltip', + 'phabricator-diff-changeset-list', + 'phabricator-diff-changeset', + ), '5e9f347c' => array( 'javelin-behavior', 'multirow-row-manager', @@ -1388,15 +1398,6 @@ 'javelin-stratcom', 'javelin-dom', ), - '6120e99a' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-workflow', - 'javelin-scrollbar', - 'phabricator-scroll-objective', - ), '61cbc29a' => array( 'javelin-magical-init', 'javelin-util', @@ -1411,6 +1412,9 @@ 'javelin-workflow', 'javelin-dom', ), + '675f1ca3' => array( + 'javelin-install', + ), '680ea2c8' => array( 'javelin-install', 'javelin-dom', @@ -1496,10 +1500,6 @@ 'javelin-behavior', 'javelin-quicksand', ), - '7a184082' => array( - 'javelin-install', - 'phabricator-scroll-objective-list', - ), '7a68dda3' => array( 'owners-path-editor', 'javelin-behavior', @@ -1513,13 +1513,6 @@ '7e41274a' => array( 'javelin-install', ), - '7e8877e7' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-workflow', - ), '7ebaeed3' => array( 'herald-rule-editor', 'javelin-behavior', @@ -1787,9 +1780,6 @@ 'phuix-autocomplete', 'javelin-mask', ), - 'acfd58f6' => array( - 'phui-inline-comment-view-css', - ), 'ae95d984' => array( 'javelin-behavior', 'javelin-stratcom', @@ -2002,17 +1992,6 @@ 'cd2b9b77' => array( 'phui-oi-list-view-css', ), - 'cf4e2140' => array( - 'javelin-dom', - 'javelin-util', - 'javelin-stratcom', - 'javelin-install', - 'javelin-workflow', - 'javelin-router', - 'javelin-behavior-device', - 'javelin-vector', - 'phabricator-diff-inline', - ), 'd0a99ab4' => array( 'javelin-behavior', 'javelin-typeahead-ondemand-source', @@ -2435,8 +2414,6 @@ 'javelin-behavior-load-blame', 'javelin-behavior-differential-user-select', 'javelin-behavior-aphront-more', - 'phabricator-scroll-objective', - 'phabricator-scroll-objective-list', 'phabricator-diff-inline', 'phabricator-diff-changeset', 'phabricator-diff-changeset-list', diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -203,9 +203,6 @@ 'javelin-behavior-differential-user-select', 'javelin-behavior-aphront-more', - 'phabricator-scroll-objective', - 'phabricator-scroll-objective-list', - 'phabricator-diff-inline', 'phabricator-diff-changeset', 'phabricator-diff-changeset-list', diff --git a/src/applications/differential/view/DifferentialChangesetDetailView.php b/src/applications/differential/view/DifferentialChangesetDetailView.php --- a/src/applications/differential/view/DifferentialChangesetDetailView.php +++ b/src/applications/differential/view/DifferentialChangesetDetailView.php @@ -204,7 +204,6 @@ 'loaded' => $this->getLoaded(), 'undoTemplates' => hsprintf('%s', $renderer->renderUndoTemplates()), 'displayPath' => hsprintf('%s', $display_parts), - 'objectiveName' => basename($display_filename), 'icon' => $display_icon, ), 'class' => $class, diff --git a/src/applications/differential/view/DifferentialChangesetListView.php b/src/applications/differential/view/DifferentialChangesetListView.php --- a/src/applications/differential/view/DifferentialChangesetListView.php +++ b/src/applications/differential/view/DifferentialChangesetListView.php @@ -203,15 +203,11 @@ $this->requireResource('aphront-tooltip-css'); - $show_objectives = - PhabricatorEnv::getEnvConfig('phabricator.show-prototypes'); - $this->initBehavior( 'differential-populate', array( 'changesetViewIDs' => $ids, 'inlineURI' => $this->inlineURI, - 'showObjectives' => $show_objectives, 'pht' => array( 'Open in Editor' => pht('Open in Editor'), 'Show All Context' => pht('Show All Context'), diff --git a/webroot/rsrc/css/application/differential/changeset-view.css b/webroot/rsrc/css/application/differential/changeset-view.css --- a/webroot/rsrc/css/application/differential/changeset-view.css +++ b/webroot/rsrc/css/application/differential/changeset-view.css @@ -408,37 +408,3 @@ .diff-banner-path { color: {$greytext}; } - -.scroll-objective-list { - position: fixed; - right: 0; - width: 24px; - top: 48px; - bottom: 48px; - background: rgba(255, 255, 255, 0.50); - border-style: solid; - border-color: rgba(255, 255, 255, 0.95); - border-width: 1px 0 1px 1px; - box-shadow: -1px 0 2px rgba(255, 255, 255, 0.10); - overflow: hidden; -} - -.scroll-objective-list.has-aesthetic-scrollbar { - /* For now, hide this element on systems with aesthetic scrollbars. */ - display: none; -} - -.scroll-objective { - display: block; - position: absolute; - box-sizing: border-box; - cursor: pointer; - text-align: middle; - left: 7px; -} - -.scroll-objective .phui-icon-view { - text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.25); - display: block; - height: 14px; -} diff --git a/webroot/rsrc/css/core/z-index.css b/webroot/rsrc/css/core/z-index.css --- a/webroot/rsrc/css/core/z-index.css +++ b/webroot/rsrc/css/core/z-index.css @@ -97,10 +97,6 @@ z-index: 6; } -.scroll-objective-list { - z-index: 6; -} - .conpherence-durable-column { z-index: 7; } diff --git a/webroot/rsrc/js/application/diff/DiffChangeset.js b/webroot/rsrc/js/application/diff/DiffChangeset.js --- a/webroot/rsrc/js/application/diff/DiffChangeset.js +++ b/webroot/rsrc/js/application/diff/DiffChangeset.js @@ -32,7 +32,6 @@ this._rightID = data.right; this._displayPath = JX.$H(data.displayPath); - this._objectiveName = data.objectiveName; this._icon = data.icon; this._inlines = []; @@ -62,8 +61,6 @@ _displayPath: null, _changesetList: null, - _objective: null, - _objectiveName: null, _icon: null, getLeftChangesetID: function() { @@ -76,23 +73,9 @@ setChangesetList: function(list) { this._changesetList = list; - - var objectives = list.getObjectives(); - this._objective = objectives.newObjective() - .setAnchor(this._node); - - this._updateObjective(); - return this; }, - _updateObjective: function() { - this._objective - .setIcon(this.getIcon()) - .setColor(this.getColor()) - .setTooltip(this.getObjectiveName()); - }, - getIcon: function() { if (!this._visible) { return 'fa-file-o'; @@ -109,10 +92,6 @@ return 'blue'; }, - getObjectiveName: function() { - return this._objectiveName; - }, - getChangesetList: function() { return this._changesetList; }, @@ -576,7 +555,6 @@ JX.Stratcom.invoke('differential-inline-comment-refresh'); - this._objective.show(); this._rebuildAllInlines(); JX.Stratcom.invoke('resize'); @@ -729,11 +707,6 @@ JX.DOM.appendContent(diff.parentNode, undo); } - this._updateObjective(); - for (var ii = 0; ii < this._inlines.length; ii++) { - this._inlines[ii].updateObjective(); - } - JX.Stratcom.invoke('resize'); }, diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js --- a/webroot/rsrc/js/application/diff/DiffChangesetList.js +++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js @@ -1,7 +1,6 @@ /** * @provides phabricator-diff-changeset-list * @requires javelin-install - * phabricator-scroll-objective-list * @javelin */ @@ -9,7 +8,6 @@ construct: function() { this._changesets = []; - this._objectives = new JX.ScrollObjectiveList(); var onload = JX.bind(this, this._ifawake, this._onload); JX.Stratcom.listen('click', 'differential-load', onload); @@ -102,7 +100,6 @@ _initialized: false, _asleep: true, _changesets: null, - _objectives: null, _cursorItem: null, @@ -120,7 +117,6 @@ _rangeTarget: null, _bannerNode: null, - _showObjectives: false, sleep: function() { this._asleep = true; @@ -128,8 +124,6 @@ this._redrawFocus(); this._redrawSelection(); this.resetHover(); - - this._objectives.hide(); }, wake: function() { @@ -138,10 +132,6 @@ this._redrawFocus(); this._redrawSelection(); - if (this._showObjectives) { - this._objectives.show(); - } - if (this._initialized) { return; } @@ -198,19 +188,10 @@ this._installKey('q', label, this._onkeyhide); }, - setShowObjectives: function(show) { - this._showObjectives = show; - return this; - }, - isAsleep: function() { return this._asleep; }, - getObjectives: function() { - return this._objectives; - }, - newChangesetForNode: function(node) { var changeset = JX.DiffChangeset.getForNode(node); @@ -538,24 +519,9 @@ }, _setSelectionState: function(item, manager) { - // If we had an inline selected before, we need to update it after - // changing our selection to clear the selected state. Then, update the - // new one to add the selected state. - var old_inline = this.getSelectedInline(); - this._cursorItem = item; this._redrawSelection(manager, true); - var new_inline = this.getSelectedInline(); - - if (old_inline) { - old_inline.updateObjective(); - } - - if (new_inline) { - new_inline.updateObjective(); - } - return this; }, diff --git a/webroot/rsrc/js/application/diff/DiffInline.js b/webroot/rsrc/js/application/diff/DiffInline.js --- a/webroot/rsrc/js/application/diff/DiffInline.js +++ b/webroot/rsrc/js/application/diff/DiffInline.js @@ -29,7 +29,6 @@ _isLoading: false, _changeset: null, - _objective: null, _isDraft: null, _isFixed: null, @@ -38,7 +37,6 @@ bindToRow: function(row) { this._row = row; - this._objective.setAnchor(this._row); var row_data = JX.Stratcom.getData(row); row_data.inline = this; @@ -80,8 +78,6 @@ this.setInvisible(false); - this.updateObjective(); - return this; }, @@ -171,14 +167,6 @@ setChangeset: function(changeset) { this._changeset = changeset; - - var objectives = changeset.getChangesetList().getObjectives(); - - // Create this inline's objective, but don't show it yet. - this._objective = objectives.newObjective() - .setCallback(JX.bind(this, this._onobjective)) - .hide(); - return this; }, @@ -188,84 +176,9 @@ setEditing: function(editing) { this._isEditing = editing; - this.updateObjective(); return this; }, - _onobjective: function() { - this.getChangeset().getChangesetList().selectInline(this); - }, - - updateObjective: function() { - var objective = this._objective; - - if (this.isHidden() || this._isDeleted) { - objective.hide(); - return; - } - - // If this is a new comment which we aren't editing, don't show anything: - // the use started a comment or reply, then cancelled it. - if (this._isNew && !this._isEditing) { - objective.hide(); - return; - } - - var changeset = this.getChangeset(); - if (!changeset.isVisible()) { - objective.hide(); - return; - } - - var pht = changeset.getChangesetList().getTranslations(); - - var icon = 'fa-comment'; - var color = 'bluegrey'; - var tooltip = this._snippet; - var anchor = this._row; - var should_stack = false; - - if (this._isEditing) { - icon = 'fa-star'; - color = 'pink'; - tooltip = pht('Editing Comment'); - - // If we're editing, anchor to the row with the editor instead of the - // actual comment row (which is invisible and can have a misleading - // position). - anchor = this._row.nextSibling; - } else if (this._isDraft) { - // This inline is an unsubmitted draft. - icon = 'fa-pencil'; - color = 'indigo'; - } else if (this._isFixed) { - // This inline has been marked done. - icon = 'fa-check'; - color = 'grey'; - } else if (this._isGhost) { - icon = 'fa-comment-o'; - color = 'grey'; - } else if (this._replyToCommentPHID) { - icon = 'fa-reply'; - should_stack = true; - } - - if (changeset.getChangesetList().getSelectedInline() === this) { - // TODO: Maybe add some other kind of effect here, since we're only - // using color to show this? - color = 'yellow'; - } - - - objective - .setAnchor(anchor) - .setIcon(icon) - .setColor(color) - .setTooltip(tooltip) - .setShouldStack(should_stack) - .show(); - }, - canReply: function() { if (!this._hasAction('reply')) { return false; @@ -316,7 +229,6 @@ JX.Stratcom.getData(row).inline = this; this._row = row; - this._objective.setAnchor(this._row); this._id = null; this._phid = null; @@ -759,8 +671,6 @@ this.getChangeset().getChangesetList().redrawPreview(); } - this.updateObjective(); - this.getChangeset().getChangesetList().redrawCursor(); this.getChangeset().getChangesetList().resetHover(); diff --git a/webroot/rsrc/js/application/diff/ScrollObjective.js b/webroot/rsrc/js/application/diff/ScrollObjective.js deleted file mode 100644 --- a/webroot/rsrc/js/application/diff/ScrollObjective.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * @provides phabricator-scroll-objective - * @requires javelin-dom - * javelin-util - * javelin-stratcom - * javelin-install - * javelin-workflow - * @javelin - */ - - -JX.install('ScrollObjective', { - - construct : function() { - var node = this.getNode(); - - var onclick = JX.bind(this, this._onclick); - JX.DOM.listen(node, 'click', null, onclick); - }, - - members: { - _list: null, - - _node: null, - _anchor: null, - - _visible: false, - _callback: false, - _stack: false, - - getNode: function() { - if (!this._node) { - var attributes = { - className: 'scroll-objective' - }; - - var content = this._getIconObject().getNode(); - - var node = JX.$N('div', attributes, content); - - this._node = node; - } - - return this._node; - }, - - setCallback: function(callback) { - this._callback = callback; - return this; - }, - - setObjectiveList: function(list) { - this._list = list; - return this; - }, - - _getIconObject: function() { - if (!this._iconObject) { - this._iconObject = new JX.PHUIXIconView(); - } - return this._iconObject; - }, - - _onclick: function(e) { - (this._callback && this._callback(e)); - - if (e.getPrevented()) { - return; - } - - e.kill(); - - // This is magic to account for the banner, and should probably be made - // less hard-coded. - var buffer = 48; - - JX.DOM.scrollToPosition(null, JX.$V(this.getAnchor()).y - buffer); - }, - - setAnchor: function(node) { - this._anchor = node; - return this; - }, - - getAnchor: function() { - return this._anchor; - }, - - setIcon: function(icon) { - this._getIconObject().setIcon(icon); - return this; - }, - - setColor: function(color) { - this._getIconObject().setColor(color); - return this; - }, - - setTooltip: function(tip) { - var node = this._getIconObject().getNode(); - JX.Stratcom.addSigil(node, 'has-tooltip'); - JX.Stratcom.getData(node).tip = tip; - JX.Stratcom.getData(node).align = 'W'; - JX.Stratcom.getData(node).size = 'auto'; - return this; - }, - - - /** - * Should this objective always stack immediately under the previous - * objective? - * - * This allows related objectives (like "comment, reply, reply") to be - * rendered in a tight sequence. - */ - setShouldStack: function(stack) { - this._stack = stack; - return this; - }, - - shouldStack: function() { - return this._stack; - }, - - show: function() { - this._visible = true; - return this; - }, - - hide: function() { - this._visible = false; - return this; - }, - - isVisible: function() { - return this._visible; - } - - } - -}); diff --git a/webroot/rsrc/js/application/diff/ScrollObjectiveList.js b/webroot/rsrc/js/application/diff/ScrollObjectiveList.js deleted file mode 100644 --- a/webroot/rsrc/js/application/diff/ScrollObjectiveList.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @provides phabricator-scroll-objective-list - * @requires javelin-dom - * javelin-util - * javelin-stratcom - * javelin-install - * javelin-workflow - * javelin-scrollbar - * phabricator-scroll-objective - * @javelin - */ - - -JX.install('ScrollObjectiveList', { - - construct : function() { - this._objectives = []; - - var onresize = JX.bind(this, this._dirty); - JX.Stratcom.listen('resize', null, onresize); - }, - - members: { - _objectives: null, - _visible: false, - _trigger: null, - - newObjective: function() { - var objective = new JX.ScrollObjective() - .setObjectiveList(this); - - this._objectives.push(objective); - this._getNode().appendChild(objective.getNode()); - - this._dirty(); - - return objective; - }, - - show: function() { - this._visible = true; - this._dirty(); - return this; - }, - - hide: function() { - this._visible = false; - this._dirty(); - return this; - }, - - _getNode: function() { - if (!this._node) { - var node = new JX.$N('div', {className: 'scroll-objective-list'}); - this._node = node; - } - return this._node; - }, - - _dirty: function() { - if (this._trigger !== null) { - return; - } - - this._trigger = setTimeout(JX.bind(this, this._redraw), 0); - }, - - _redraw: function() { - this._trigger = null; - - var node = this._getNode(); - - var is_visible = - (this._visible) && - (JX.Device.getDevice() == 'desktop') && - (this._objectives.length); - - if (!is_visible) { - JX.DOM.remove(node); - return; - } - - document.body.appendChild(node); - - // If we're on OSX without a mouse or some other system with zero-width - // trackpad-style scrollbars, adjust the display appropriately. - var aesthetic = (JX.Scrollbar.getScrollbarControlWidth() === 0); - JX.DOM.alterClass(node, 'has-aesthetic-scrollbar', aesthetic); - - var d = JX.Vector.getDocument(); - - var list_dimensions = JX.Vector.getDim(node); - var icon_height = 16; - var list_y = (list_dimensions.y - icon_height); - - var ii; - var offset; - - // First, build a list of all the items we're going to show. - var items = []; - for (ii = 0; ii < this._objectives.length; ii++) { - var objective = this._objectives[ii]; - var objective_node = objective.getNode(); - - var anchor = objective.getAnchor(); - if (!anchor || !objective.isVisible()) { - JX.DOM.remove(objective_node); - continue; - } - - offset = (JX.$V(anchor).y / d.y) * (list_y); - - items.push({ - offset: offset, - node: objective_node, - objective: objective - }); - } - - // Now, sort it from top to bottom. - items.sort(function(u, v) { - return u.offset - v.offset; - }); - - // Lay out the items in the objective list, leaving a minimum amount - // of space between them so they do not overlap. - var min = null; - for (ii = 0; ii < items.length; ii++) { - var item = items[ii]; - - offset = item.offset; - - if (min !== null) { - if (item.objective.shouldStack()) { - offset = min; - } else { - offset = Math.max(offset, min); - } - } - min = offset + 15; - - item.node.style.top = offset + 'px'; - node.appendChild(item.node); - } - - } - - } - -}); diff --git a/webroot/rsrc/js/application/differential/behavior-populate.js b/webroot/rsrc/js/application/differential/behavior-populate.js --- a/webroot/rsrc/js/application/differential/behavior-populate.js +++ b/webroot/rsrc/js/application/differential/behavior-populate.js @@ -60,8 +60,7 @@ var changeset_list = new JX.DiffChangesetList() .setTranslations(JX.phtize(config.pht)) - .setInlineURI(config.inlineURI) - .setShowObjectives(config.showObjectives); + .setInlineURI(config.inlineURI); // Install and activate the current page. var page_id = JX.Quicksand.getCurrentPageID();