Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | construct: function() { | ||||
JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
['mouseover', 'mouseout'], | ['mouseover', 'mouseout'], | ||||
'differential-inline-comment', | 'differential-inline-comment', | ||||
onhover); | onhover); | ||||
var onrangedown = JX.bind(this, this._ifawake, this._onrangedown); | var onrangedown = JX.bind(this, this._ifawake, this._onrangedown); | ||||
JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
'mousedown', | 'mousedown', | ||||
['differential-changeset', 'tag:th'], | ['differential-changeset', 'tag:td'], | ||||
onrangedown); | onrangedown); | ||||
var onrangemove = JX.bind(this, this._ifawake, this._onrangemove); | var onrangemove = JX.bind(this, this._ifawake, this._onrangemove); | ||||
JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
['mouseover', 'mouseout'], | ['mouseover', 'mouseout'], | ||||
['differential-changeset', 'tag:th'], | ['differential-changeset', 'tag:td'], | ||||
onrangemove); | onrangemove); | ||||
var onrangeup = JX.bind(this, this._ifawake, this._onrangeup); | var onrangeup = JX.bind(this, this._ifawake, this._onrangeup); | ||||
JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
'mouseup', | 'mouseup', | ||||
null, | null, | ||||
onrangeup); | onrangeup); | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Lines | _onkeyreply: function(is_quote) { | ||||
var old_list = []; | var old_list = []; | ||||
var new_list = []; | var new_list = []; | ||||
var row = origin; | var row = origin; | ||||
while (row) { | while (row) { | ||||
var header = row.firstChild; | var header = row.firstChild; | ||||
while (header) { | while (header) { | ||||
if (JX.DOM.isType(header, 'th')) { | if (this.getLineNumberFromHeader(header)) { | ||||
if (header.className.indexOf('old') !== -1) { | if (header.className.indexOf('old') !== -1) { | ||||
old_list.push(header); | old_list.push(header); | ||||
} else if (header.className.indexOf('new') !== -1) { | } else if (header.className.indexOf('new') !== -1) { | ||||
new_list.push(header); | new_list.push(header); | ||||
} | } | ||||
} | } | ||||
header = header.nextSibling; | header = header.nextSibling; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | _getInlineForEvent: function(e) { | ||||
var changeset = this.getChangesetForNode(node); | var changeset = this.getChangesetForNode(node); | ||||
var inline_row = e.getNode('inline-row'); | var inline_row = e.getNode('inline-row'); | ||||
return changeset.getInlineForRow(inline_row); | return changeset.getInlineForRow(inline_row); | ||||
}, | }, | ||||
getLineNumberFromHeader: function(th) { | getLineNumberFromHeader: function(th) { | ||||
try { | return parseInt(th.getAttribute('data-n')); | ||||
return parseInt(th.id.match(/^C\d+[ON]L(\d+)$/)[1], 10); | |||||
} catch (x) { | |||||
return null; | |||||
} | |||||
}, | }, | ||||
getDisplaySideFromHeader: function(th) { | getDisplaySideFromHeader: function(th) { | ||||
return (th.parentNode.firstChild != th) ? 'right' : 'left'; | return (th.parentNode.firstChild != th) ? 'right' : 'left'; | ||||
}, | }, | ||||
_onrangedown: function(e) { | _onrangedown: function(e) { | ||||
// NOTE: We're allowing "mousedown" from a touch event through so users | // NOTE: We're allowing "mousedown" from a touch event through so users | ||||
▲ Show 20 Lines • Show All 626 Lines • Show Last 20 Lines |