old_contents: /**
   * Copyright 2014 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  /*global $:false */
  
  'use strict';
  
  var Microphone = require('./Microphone');
  var models = require('./data/models.json').models;
  var initViews = require('./views').initViews;
  var utils = require('./utils');
  var pkg = require('../package');
  
  window.BUFFERSIZE = 8192;
  
  $(document).ready(function() {
  
    // Temporary app data
    $('#appSettings')
      .html(
        '<p>Version: ' + pkg.version + '</p>'
        + '<p>Buffer Size: ' + BUFFERSIZE + '</p>'
      );
  
  
    // Make call to API to try and get token
    utils.getToken(function(token) {
  
      window.onbeforeunload = function(e) {
        localStorage.clear();
      };
  
      if (!token) {
        console.error('No authorization token available');
        console.error('Attempting to reconnect...');
      }
  
      var viewContext = {
        currentModel: 'en-US_BroadbandModel',
        models: models,
        token: token,
        bufferSize: BUFFERSIZE
      };
  
      initViews(viewContext);
  
      utils.initPubSub();
  
      // Save models to localstorage
      localStorage.setItem('models', JSON.stringify(models));
  
      // Set default current model
      localStorage.setItem('currentModel', 'en-US_BroadbandModel');
      localStorage.setItem('sessionPermissions', 'true');
  
  
      $.subscribe('clearscreen', function() {
        $('#resultsText').text('');
        $('#resultsJSON').text('');
        $('.error-row').hide();
        $('.notification-row').hide();
        $('.hypotheses > ul').empty();
        $('#metadataTableBody').empty();
      });
  
    });
  
  });
new_contents: /**
   * Copyright 2014 IBM Corp. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  /*global $:false */
  
  'use strict';
  
  var Microphone = require('./Microphone');
  var models = require('./data/models.json').models;
  var utils = require('./utils');
  utils.initPubSub();
  var initViews = require('./views').initViews;
  var pkg = require('../package');
  
  window.BUFFERSIZE = 8192;
  
  $(document).ready(function() {
  
    // Temporary app data
    $('#appSettings')
      .html(
        '<p>Version: ' + pkg.version + '</p>'
        + '<p>Buffer Size: ' + BUFFERSIZE + '</p>'
      );
  
  
    // Make call to API to try and get token
    utils.getToken(function(token) {
  
      window.onbeforeunload = function(e) {
        localStorage.clear();
      };
  
      if (!token) {
        console.error('No authorization token available');
        console.error('Attempting to reconnect...');
      }
  
      var viewContext = {
        currentModel: 'en-US_BroadbandModel',
        models: models,
        token: token,
        bufferSize: BUFFERSIZE
      };
  
      initViews(viewContext);
  
      // Save models to localstorage
      localStorage.setItem('models', JSON.stringify(models));
  
      // Set default current model
      localStorage.setItem('currentModel', 'en-US_BroadbandModel');
      localStorage.setItem('sessionPermissions', 'true');
  
  
      $.subscribe('clearscreen', function() {
        $('#resultsText').text('');
        $('#resultsJSON').text('');
        $('.error-row').hide();
        $('.notification-row').hide();
        $('.hypotheses > ul').empty();
        $('#metadataTableBody').empty();
      });
  
    });
  
  });
subject: Initialize pubsub at top of root module