##// END OF EJS Templates
hgweb: add graph mode of ajax response processing...
Alexander Plavin -
r19782:8123f505 default
parent child Browse files
Show More
@@ -358,7 +358,8 b' function ajaxScrollInit(urlFormat,'
358 358 nextPageVar,
359 359 nextPageVarGet,
360 360 containerSelector,
361 messageFormat) {
361 messageFormat,
362 mode) {
362 363 updateInitiated = false;
363 364 container = document.querySelector(containerSelector);
364 365
@@ -399,6 +400,16 b' function ajaxScrollInit(urlFormat,'
399 400 function onsuccess(htmlText) {
400 401 nextPageVar = nextPageVarGet(htmlText, nextPageVar);
401 402
403 if (mode == 'graph') {
404 var addHeight = htmlText.match(/^<canvas id="graph".*height="(\d+)"><\/canvas>$/m)[1];
405 addHeight = parseInt(addHeight);
406 graph.canvas.height = addHeight;
407
408 var dataStr = htmlText.match(/^\s*var data = (.*);$/m)[1];
409 var data = JSON.parse(dataStr)
410 graph.reset();
411 graph.render(data);
412 } else {
402 413 var doc = docFromHTML(htmlText);
403 414 var nodes = doc.querySelector(containerSelector).children;
404 415 while (nodes.length) {
@@ -407,6 +418,7 b' function ajaxScrollInit(urlFormat,'
407 418 container.appendChild(node);
408 419 }
409 420 process_dates();
421 }
410 422 },
411 423 function onerror(errorText) {
412 424 var message = {
General Comments 0
You need to be logged in to leave comments. Login now