Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangeset.js
| Show All 26 Lines | construct : function(node) { | ||||
| this._highlight = data.highlight; | this._highlight = data.highlight; | ||||
| this._encoding = data.encoding; | this._encoding = data.encoding; | ||||
| this._loaded = data.loaded; | this._loaded = data.loaded; | ||||
| 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._objectiveName = data.objectiveName; | |||||
| this._icon = data.icon; | this._icon = data.icon; | ||||
| this._inlines = []; | this._inlines = []; | ||||
| }, | }, | ||||
| members: { | members: { | ||||
| _node: null, | _node: null, | ||||
| _loaded: false, | _loaded: false, | ||||
| Show All 13 Lines | members: { | ||||
| _inlines: null, | _inlines: null, | ||||
| _visible: true, | _visible: true, | ||||
| _undoNode: null, | _undoNode: null, | ||||
| _displayPath: null, | _displayPath: null, | ||||
| _changesetList: null, | _changesetList: null, | ||||
| _objective: null, | |||||
| _objectiveName: null, | |||||
| _icon: null, | _icon: null, | ||||
| getLeftChangesetID: function() { | getLeftChangesetID: function() { | ||||
| return this._leftID; | return this._leftID; | ||||
| }, | }, | ||||
| getRightChangesetID: function() { | getRightChangesetID: function() { | ||||
| return this._rightID; | return this._rightID; | ||||
| }, | }, | ||||
| setChangesetList: function(list) { | setChangesetList: function(list) { | ||||
| this._changesetList = list; | this._changesetList = list; | ||||
| var objectives = list.getObjectives(); | |||||
| this._objective = objectives.newObjective() | |||||
| .setAnchor(this._node); | |||||
| this._updateObjective(); | |||||
| return this; | return this; | ||||
| }, | }, | ||||
| _updateObjective: function() { | |||||
| this._objective | |||||
| .setIcon(this.getIcon()) | |||||
| .setColor(this.getColor()) | |||||
| .setTooltip(this.getObjectiveName()); | |||||
| }, | |||||
| getIcon: function() { | getIcon: function() { | ||||
| if (!this._visible) { | if (!this._visible) { | ||||
| return 'fa-file-o'; | return 'fa-file-o'; | ||||
| } | } | ||||
| return this._icon; | return this._icon; | ||||
| }, | }, | ||||
| getColor: function() { | getColor: function() { | ||||
| if (!this._visible) { | if (!this._visible) { | ||||
| return 'grey'; | return 'grey'; | ||||
| } | } | ||||
| return 'blue'; | return 'blue'; | ||||
| }, | }, | ||||
| getObjectiveName: function() { | |||||
| return this._objectiveName; | |||||
| }, | |||||
| getChangesetList: function() { | getChangesetList: function() { | ||||
| return this._changesetList; | return this._changesetList; | ||||
| }, | }, | ||||
| /** | /** | ||||
| * Has the content of this changeset been loaded? | * Has the content of this changeset been loaded? | ||||
| * | * | ||||
| * This method returns `true` if a request has been fired, even if the | * This method returns `true` if a request has been fired, even if the | ||||
| ▲ Show 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | _onchangesetresponse: function(response) { | ||||
| } | } | ||||
| if (response.undoTemplates) { | if (response.undoTemplates) { | ||||
| this._undoTemplates = response.undoTemplates; | this._undoTemplates = response.undoTemplates; | ||||
| } | } | ||||
| JX.Stratcom.invoke('differential-inline-comment-refresh'); | JX.Stratcom.invoke('differential-inline-comment-refresh'); | ||||
| this._objective.show(); | |||||
| this._rebuildAllInlines(); | this._rebuildAllInlines(); | ||||
| JX.Stratcom.invoke('resize'); | JX.Stratcom.invoke('resize'); | ||||
| }, | }, | ||||
| _getContentFrame: function() { | _getContentFrame: function() { | ||||
| return JX.DOM.find(this._node, 'div', 'changeset-view-content'); | return JX.DOM.find(this._node, 'div', 'changeset-view-content'); | ||||
| }, | }, | ||||
| ▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | toggleVisibility: function() { | ||||
| if (this._visible) { | if (this._visible) { | ||||
| JX.DOM.show(diff); | JX.DOM.show(diff); | ||||
| JX.DOM.remove(undo); | JX.DOM.remove(undo); | ||||
| } else { | } else { | ||||
| JX.DOM.hide(diff); | JX.DOM.hide(diff); | ||||
| JX.DOM.appendContent(diff.parentNode, undo); | 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'); | JX.Stratcom.invoke('resize'); | ||||
| }, | }, | ||||
| isVisible: function() { | isVisible: function() { | ||||
| return this._visible; | return this._visible; | ||||
| }, | }, | ||||
| _getUndoNode: function() { | _getUndoNode: function() { | ||||
| ▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines | |||||