function onPartitionData(live_registrations,
                           live_versions,
                           stored_registrations,
                           partition_id,
                           partition_path) {
    var unregistered_registrations = [];
    var unregistered_versions = [];
    getUnregisteredWorkers(stored_registrations,
                           live_registrations,
                           live_versions,
                           unregistered_registrations,
                           unregistered_versions);
    var template;
    var container = $('serviceworker-list');
    // Existing templates are keyed by partition_id. This allows
    // the UI to be updated in-place rather than refreshing the
    // whole page.
    for (var i = 0; i < container.childNodes.length; ++i) {
      if (container.childNodes[i].partition_id == partition_id) {
        template = container.childNodes[i];
      }
    }
    // This is probably the first time we're loading.
    if (!template) {
      template = jstGetTemplate('serviceworker-list-template');
      container.appendChild(template);
    }
    var fillLogFunc = fillLogForVersion.bind(this, container, partition_id);
    stored_registrations.forEach(function(registration) {
      [registration.active, registration.waiting].forEach(fillLogFunc);
    });
    unregistered_registrations.forEach(function(registration) {
      [registration.active, registration.waiting].forEach(fillLogFunc);
    });
    unregistered_versions.forEach(fillLogFunc);
    jstProcess(new JsEvalContext({
                 stored_registrations: stored_registrations,
                 unregistered_registrations: unregistered_registrations,
                 unregistered_versions: unregistered_versions,
                 partition_id: partition_id,
                 partition_path: partition_path}),
               template);
    for (var i = 0; i < COMMANDS.length; ++i) {
      var handler = commandHandler(COMMANDS[i]);
      var links = container.querySelectorAll('button.' + COMMANDS[i]);
      for (var j = 0; j < links.length; ++j) {
        if (!links[j].hasClickEvent) {
          links[j].addEventListener('click', handler, false);
          links[j].hasClickEvent = true;
        }
      }
    }
  }
// Fired once per partition from the backend.
Fired once per partition from the backend.
Fired once per partition from the backend .
function onPartitionData(live_registrations,
                           live_versions,
                           stored_registrations,
                           partition_id,
                           partition_path) {
    var unregistered_registrations = [];
    var unregistered_versions = [];
    getUnregisteredWorkers(stored_registrations,
                           live_registrations,
                           live_versions,
                           unregistered_registrations,
                           unregistered_versions);
    var template;
    var container = $('serviceworker-list');
    for (var i = 0; i < container.childNodes.length; ++i) {
      if (container.childNodes[i].partition_id == partition_id) {
        template = container.childNodes[i];
      }
    }
    if (!template) {
      template = jstGetTemplate('serviceworker-list-template');
      container.appendChild(template);
    }
    var fillLogFunc = fillLogForVersion.bind(this, container, partition_id);
    stored_registrations.forEach(function(registration) {
      [registration.active, registration.waiting].forEach(fillLogFunc);
    });
    unregistered_registrations.forEach(function(registration) {
      [registration.active, registration.waiting].forEach(fillLogFunc);
    });
    unregistered_versions.forEach(fillLogFunc);
    jstProcess(new JsEvalContext({
                 stored_registrations: stored_registrations,
                 unregistered_registrations: unregistered_registrations,
                 unregistered_versions: unregistered_versions,
                 partition_id: partition_id,
                 partition_path: partition_path}),
               template);
    for (var i = 0; i < COMMANDS.length; ++i) {
      var handler = commandHandler(COMMANDS[i]);
      var links = container.querySelectorAll('button.' + COMMANDS[i]);
      for (var j = 0; j < links.length; ++j) {
        if (!links[j].hasClickEvent) {
          links[j].addEventListener('click', handler, false);
          links[j].hasClickEvent = true;
        }
      }
    }
  }
function onPartitionData ( live_registrations , live_versions , stored_registrations , partition_id , partition_path ) { var unregistered_registrations = [ ] ; var unregistered_versions = [ ] ; getUnregisteredWorkers ( stored_registrations , live_registrations , live_versions , unregistered_registrations , unregistered_versions ) ; var template ; var container = $ ( 'serviceworker-list' ) ; for ( var i = 0 ; i < container . childNodes . length ; ++ i ) { if ( container . childNodes [ i ] . partition_id == partition_id ) { template = container . childNodes [ i ] ; } } if ( ! template ) { template = jstGetTemplate ( 'serviceworker-list-template' ) ; container . appendChild ( template ) ; } var fillLogFunc = fillLogForVersion . bind ( this , container , partition_id ) ; stored_registrations . forEach ( function ( registration ) { [ registration . active , registration . waiting ] . forEach ( fillLogFunc ) ; } ) ; unregistered_registrations . forEach ( function ( registration ) { [ registration . active , registration . waiting ] . forEach ( fillLogFunc ) ; } ) ; unregistered_versions . forEach ( fillLogFunc ) ; jstProcess ( new JsEvalContext ( { stored_registrations : stored_registrations , unregistered_registrations : unregistered_registrations , unregistered_versions : unregistered_versions , partition_id : partition_id , partition_path : partition_path } ) , template ) ; for ( var i = 0 ; i < COMMANDS . length ; ++ i ) { var handler = commandHandler ( COMMANDS [ i ] ) ; var links = container . querySelectorAll ( 'button.' + COMMANDS [ i ] ) ; for ( var j = 0 ; j < links . length ; ++ j ) { if ( ! links [ j ] . hasClickEvent ) { links [ j ] . addEventListener ( 'click' , handler , false ) ; links [ j ] . hasClickEvent = true ; } } } }
Fired once per partition from the backend.
Fired once per partition from the backend .
// Existing templates are keyed by partition_id. This allows // the UI to be updated in-place rather than refreshing the // whole page. // This is probably the first time we're loading.