Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangeset.js
| /** | /** | ||||
| * @provides phabricator-diff-changeset | * @provides phabricator-diff-changeset | ||||
| * @requires javelin-dom | * @requires javelin-dom | ||||
| * javelin-util | * javelin-util | ||||
| * javelin-stratcom | * javelin-stratcom | ||||
| * javelin-install | * javelin-install | ||||
| * javelin-workflow | * javelin-workflow | ||||
| * javelin-router | * javelin-router | ||||
| * javelin-behavior-device | * javelin-behavior-device | ||||
| * javelin-vector | * javelin-vector | ||||
| * phabricator-diff-inline | * phabricator-diff-inline | ||||
| * phabricator-diff-path-view | |||||
| * @javelin | * @javelin | ||||
| */ | */ | ||||
| JX.install('DiffChangeset', { | JX.install('DiffChangeset', { | ||||
| construct : function(node) { | construct : function(node) { | ||||
| this._node = node; | this._node = node; | ||||
| var data = this._getNodeData(); | var data = this._getNodeData(); | ||||
| this._renderURI = data.renderURI; | this._renderURI = data.renderURI; | ||||
| this._ref = data.ref; | this._ref = data.ref; | ||||
| this._loaded = data.loaded; | this._loaded = data.loaded; | ||||
| this._treeNodeID = data.treeNodeID; | this._treeNodeID = data.treeNodeID; | ||||
| this._leftID = data.left; | this._leftID = data.left; | ||||
| this._rightID = data.right; | this._rightID = data.right; | ||||
| this._displayPath = JX.$H(data.displayPath); | this._displayPath = JX.$H(data.displayPath); | ||||
| this._pathParts = data.pathParts; | |||||
| this._icon = data.icon; | this._icon = data.icon; | ||||
| this._editorURI = data.editorURI; | this._editorURI = data.editorURI; | ||||
| this._editorConfigureURI = data.editorConfigureURI; | this._editorConfigureURI = data.editorConfigureURI; | ||||
| this._inlines = []; | this._inlines = []; | ||||
| if (data.changesetState) { | if (data.changesetState) { | ||||
| Show All 25 Lines | members: { | ||||
| _displayPath: null, | _displayPath: null, | ||||
| _changesetList: null, | _changesetList: null, | ||||
| _icon: null, | _icon: null, | ||||
| _treeNodeID: null, | _treeNodeID: null, | ||||
| _editorURI: null, | _editorURI: null, | ||||
| _editorConfigureURI: null, | _editorConfigureURI: null, | ||||
| _pathView: null, | |||||
| getEditorURI: function() { | getEditorURI: function() { | ||||
| return this._editorURI; | return this._editorURI; | ||||
| }, | }, | ||||
| getEditorConfigureURI: function() { | getEditorConfigureURI: function() { | ||||
| return this._editorConfigureURI; | return this._editorConfigureURI; | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 805 Lines • ▼ Show 20 Lines | _getUndoNode: function() { | ||||
| } | } | ||||
| return this._undoNode; | return this._undoNode; | ||||
| }, | }, | ||||
| _onundo: function(e) { | _onundo: function(e) { | ||||
| e.kill(); | e.kill(); | ||||
| this.toggleVisibility(); | this.toggleVisibility(); | ||||
| }, | |||||
| getPathView: function() { | |||||
| if (!this._pathView) { | |||||
| this._pathView = new JX.DiffPathView() | |||||
| .setChangeset(this) | |||||
| .setPath(this._pathParts); | |||||
| } | |||||
| return this._pathView; | |||||
| }, | |||||
| select: function(scroll) { | |||||
| this.getChangesetList().selectChangeset(this, scroll); | |||||
| return this; | |||||
| } | } | ||||
| }, | }, | ||||
| statics: { | statics: { | ||||
| getForNode: function(node) { | getForNode: function(node) { | ||||
| var data = JX.Stratcom.getData(node); | var data = JX.Stratcom.getData(node); | ||||
| if (!data.changesetViewManager) { | if (!data.changesetViewManager) { | ||||
| data.changesetViewManager = new JX.DiffChangeset(node); | data.changesetViewManager = new JX.DiffChangeset(node); | ||||
| } | } | ||||
| return data.changesetViewManager; | return data.changesetViewManager; | ||||
| } | } | ||||
| } | } | ||||
| }); | }); | ||||