Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangeset.js
Show First 20 Lines • Show All 316 Lines • ▼ Show 20 Lines | members: { | ||||
getHighlight: function() { | getHighlight: function() { | ||||
return this._highlight; | return this._highlight; | ||||
}, | }, | ||||
_getNodeData: function() { | _getNodeData: function() { | ||||
return JX.Stratcom.getData(this._node); | return JX.Stratcom.getData(this._node); | ||||
}, | }, | ||||
_onresponse: function(sequence, response) { | _onresponse: function(sequence, response) { | ||||
if (sequence != this._sequence) { | if (sequence != this._sequence) { | ||||
// If this isn't the most recent request, ignore it. This normally | // If this isn't the most recent request, ignore it. This normally | ||||
// means the user changed view settings between the time the page loaded | // means the user changed view settings between the time the page loaded | ||||
// and the content filled. | // and the content filled. | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | getInlineForRow: function(node) { | ||||
var inline = new JX.DiffInline(node) | var inline = new JX.DiffInline(node) | ||||
.setChangeset(this); | .setChangeset(this); | ||||
this._inlines.push(inline); | this._inlines.push(inline); | ||||
data.inline = inline; | data.inline = inline; | ||||
} | } | ||||
return data.inline; | return data.inline; | ||||
}, | |||||
getInlineByID: function(id) { | |||||
// TODO: Currently, this will only find inlines which the user has | |||||
// already interacted with! Inlines are built lazily as events arrive. | |||||
// This can not yet find inlines which are passively present in the | |||||
// document. | |||||
for (var ii = 0; ii < this._inlines.length; ii++) { | |||||
var inline = this._inlines[ii]; | |||||
if (inline.getID() == id) { | |||||
return inline; | |||||
} | } | ||||
} | |||||
return null; | |||||
} | |||||
}, | }, | ||||
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; | ||||
} | } | ||||
} | } | ||||
}); | }); |