Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/differential/behavior-populate.js
| /** | /** | ||||
| * @provides javelin-behavior-differential-populate | * @provides javelin-behavior-differential-populate | ||||
| * @requires javelin-behavior | * @requires javelin-behavior | ||||
| * javelin-dom | * javelin-dom | ||||
| * javelin-stratcom | * javelin-stratcom | ||||
| * phabricator-tooltip | * phabricator-tooltip | ||||
| * phabricator-diff-changeset-list | * phabricator-diff-changeset-list | ||||
| * phabricator-diff-changeset | * phabricator-diff-changeset | ||||
| * phuix-formation-view | |||||
| * @javelin | * @javelin | ||||
| */ | */ | ||||
| JX.behavior('differential-populate', function(config, statics) { | JX.behavior('differential-populate', function(config, statics) { | ||||
| // When we perform a Quicksand navigation, deactivate the changeset lists on | // When we perform a Quicksand navigation, deactivate the changeset lists on | ||||
| // the current page and activate the changeset lists on the new page. | // the current page and activate the changeset lists on the new page. | ||||
| var onredraw = function(page_id) { | var onredraw = function(page_id) { | ||||
| ▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | JX.behavior('differential-populate', function(config, statics) { | ||||
| } | } | ||||
| var changeset_list = new JX.DiffChangesetList() | var changeset_list = new JX.DiffChangesetList() | ||||
| .setTranslations(JX.phtize(config.pht)) | .setTranslations(JX.phtize(config.pht)) | ||||
| .setInlineURI(config.inlineURI) | .setInlineURI(config.inlineURI) | ||||
| .setInlineListURI(config.inlineListURI) | .setInlineListURI(config.inlineListURI) | ||||
| .setIsStandalone(config.isStandalone); | .setIsStandalone(config.isStandalone); | ||||
| // Install and activate the current page. | if (config.formationViewID) { | ||||
| var page_id = JX.Quicksand.getCurrentPageID(); | var formation_node = JX.$(config.formationViewID); | ||||
| statics.pages[page_id] = [changeset_list]; | var formation_view = new JX.PHUIXFormationView(formation_node); | ||||
| onredraw(page_id); | changeset_list.setFormationView(formation_view); | ||||
| formation_view.start(); | |||||
| } | |||||
| for (var ii = 0; ii < config.changesetViewIDs.length; ii++) { | for (var ii = 0; ii < config.changesetViewIDs.length; ii++) { | ||||
| var id = config.changesetViewIDs[ii]; | var id = config.changesetViewIDs[ii]; | ||||
| var node = JX.$(id); | var node = JX.$(id); | ||||
| var changeset = changeset_list.newChangesetForNode(node); | var changeset = changeset_list.newChangesetForNode(node); | ||||
| if (changeset.shouldAutoload()) { | if (changeset.shouldAutoload()) { | ||||
| changeset.setStabilize(true).load(); | changeset.setStabilize(true).load(); | ||||
| } | } | ||||
| } | } | ||||
| // Install and activate the current page. | |||||
| var page_id = JX.Quicksand.getCurrentPageID(); | |||||
| statics.pages[page_id] = [changeset_list]; | |||||
| onredraw(page_id); | |||||
| var highlighted = null; | var highlighted = null; | ||||
| var highlight_class = null; | var highlight_class = null; | ||||
| JX.Stratcom.listen( | JX.Stratcom.listen( | ||||
| ['mouseover', 'mouseout'], | ['mouseover', 'mouseout'], | ||||
| ['differential-changeset', 'tag:td'], | ['differential-changeset', 'tag:td'], | ||||
| function(e) { | function(e) { | ||||
| var t = e.getTarget(); | var t = e.getTarget(); | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||