1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 19:02:41 +01:00
phorge-phorge/webroot/rsrc/js/application/diffusion/behavior-pull-lastmodified.js
epriestley e03deb7d4a Always pull extra browse information over Ajax, and batch some of the queries
Summary:
This code is currently quite complicated because we pull history data inline for SVN files, and via ajax for everything else (SVN dirs, everything in Git and Hg).

Always pull over ajax; batch some of the queries.

Test Plan: {F34860}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley, vrana, aran

Maniphest Tasks: T2683

Differential Revision: https://secure.phabricator.com/D5255
2014-05-12 11:47:27 -07:00

25 lines
613 B
JavaScript

/**
* @provides javelin-behavior-diffusion-pull-lastmodified
* @requires javelin-behavior
* javelin-dom
* javelin-util
* javelin-workflow
* javelin-json
*/
JX.behavior('diffusion-pull-lastmodified', function(config) {
new JX.Workflow(config.uri, {paths: JX.JSON.stringify(JX.keys(config.map))})
.setHandler(function(r) {
for (var k in r) {
for (var l in r[k]) {
if (!config.map[k][l]) {
continue;
}
JX.DOM.setContent(JX.$(config.map[k][l]), JX.$H(r[k][l]));
}
}
})
.start();
});