<commit_before>//Use Polymer Bindings
var mainContent = document.querySelector('#mainContent');

mainContent.addEventListener('dom-change', function(){
  // Grab elements, create settings, etc.
  //var canvas = document.querySelector("#canvas");
  //var context = canvas.getContext("2d");
  var video = document.querySelector("#video");
  var videoObj = { "video": true };
  var errBack = function(error) {
      console.log("Video capture error: ", error.code);
    };

  // Put video listeners into place
  if(navigator.webkitGetUserMedia) { // WebKit-prefixed
    navigator.webkitGetUserMedia(videoObj, function(stream){
      video.src = window.URL.createObjectURL(stream);
      video.play();
    }, errBack);
  }

});

var resizeWindow = function(){
  var appWindow = chrome.app.window.current();
  var visibileContent = document.querySelector('#video');

  chrome.storage.local.get("windowFrame",function(items){
    var headerHeight = 0;
    var windowFrame='none';

    if (items.windowFrame!='none'){
      headerHeight=33;
    }
    appWindow.resizeTo(visibileContent.offsetWidth,visibileContent.offsetHeight+headerHeight);
  });

};

mainContent.toggleToolbar = function(){
  var collapsable = document.querySelector('#collapsableToolbar');
  //Display/Hide the toolbar
  collapsable.toggle();
};

mainContent.collapseResize = function(){
  resizeWindow();
};

mainContent.closeWindow = function(){
  var windowFrame='none';
  chrome.storage.local.get("windowFrame",function(items){
    if (items != null){
      windowFrame=items.windowFrame;

    }
    var options={};
    options.windowFrame= windowFrame;
    var appWindow = chrome.app.window.current();
    options.top=appWindow.innerBounds.top;
    options.left=appWindow.innerBounds.left;
    options.width=appWindow.innerBounds.width;
    options.height=appWindow.innerBounds.height;

    //Store the variables in the local storage
    chrome.storage.local.set(options, function() {
          // Notify that we saved.
          //message('Settings saved');
          window.close();
        });
  });

};

mainContent.changeWindowMode = function(){

  var windowFrame='chrome';
  chrome.storage.local.get("windowFrame",function(items){
    if (items != null){
      windowFrame=items.windowFrame;
      if (windowFrame=='none'){
        windowFrame='chrome';
      }else{
        windowFrame='none';
      }
    }
    var options={};
    options.windowFrame= windowFrame;
    var appWindow = chrome.app.window.current();
    options.top=appWindow.innerBounds.top;
    options.left=appWindow.innerBounds.left;
    options.width=appWindow.innerBounds.width;
    options.height=appWindow.innerBounds.height;

    //Store the variables in the local storage
    chrome.storage.local.set(options, function() {
          // Notify that we saved.
          //message('Settings saved');
          chrome.runtime.reload(); //Reload the app
        });
  });

};<commit_msg>collapse toolbar after 5 seconds<commit_after>//Use Polymer Bindings
var mainContent = document.querySelector('#mainContent');

mainContent.addEventListener('dom-change', function(){
  // Grab elements, create settings, etc.
  //var canvas = document.querySelector("#canvas");
  //var context = canvas.getContext("2d");
  var video = document.querySelector("#video");
  var videoObj = { "video": true };
  var errBack = function(error) {
      console.log("Video capture error: ", error.code);
    };

  // Put video listeners into place
  if(navigator.webkitGetUserMedia) { // WebKit-prefixed
    navigator.webkitGetUserMedia(videoObj, function(stream){
      video.src = window.URL.createObjectURL(stream);
      video.play();
    }, errBack);
  }

});

var resizeWindow = function(){
  var appWindow = chrome.app.window.current();
  var visibileContent = document.querySelector('#video');

  chrome.storage.local.get("windowFrame",function(items){
    var headerHeight = 0;
    var windowFrame='none';

    if (items.windowFrame!='none'){
      headerHeight=33;
    }
    appWindow.resizeTo(visibileContent.offsetWidth,visibileContent.offsetHeight+headerHeight);
  });

};

var collapseTimeout = null;

mainContent.toggleToolbar = function(){
  var collapsable = document.querySelector('#collapsableToolbar');
  //Display/Hide the toolbar
  collapsable.toggle();
  if (collapseTimeout) {
    clearTimeout(collapseTimeout);
  }
  if (collapsable.opened){
    //AutoCollapse the toolbar after 5 second
    collapseTimeout = setTimeout(function() {
      collapsable.opened = false;
    }, 5000);
  }
};

mainContent.collapseResize = function(){
  resizeWindow();
};

mainContent.closeWindow = function(){
  var windowFrame='none';
  chrome.storage.local.get("windowFrame",function(items){
    if (items){
      windowFrame=items.windowFrame;
    }
    var options={};
    options.windowFrame= windowFrame;
    var appWindow = chrome.app.window.current();
    options.top=appWindow.innerBounds.top;
    options.left=appWindow.innerBounds.left;
    options.width=appWindow.innerBounds.width;
    options.height=appWindow.innerBounds.height;

    //Store the variables in the local storage
    chrome.storage.local.set(options, function() {
          // Notify that we saved.
          //message('Settings saved');
          window.close();
        });
  });

};

mainContent.changeWindowMode = function(){

  var windowFrame='chrome';
  chrome.storage.local.get("windowFrame",function(items){
    if (items){
      windowFrame=items.windowFrame;
      if (windowFrame=='none'){
        windowFrame='chrome';
      }else{
        windowFrame='none';
      }
    }
    var options={};
    options.windowFrame= windowFrame;
    var appWindow = chrome.app.window.current();
    options.top=appWindow.innerBounds.top;
    options.left=appWindow.innerBounds.left;
    options.width=appWindow.innerBounds.width;
    options.height=appWindow.innerBounds.height;

    //Store the variables in the local storage
    chrome.storage.local.set(options, function() {
          // Notify that we saved.
          //message('Settings saved');
          chrome.runtime.reload(); //Reload the app
        });
  });

};
{'fraction_non_alphanumeric': 0.13763861709067188, 'fraction_numerical': 0.00228310502283105, 'mean_word_length': 3.51620029455081, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4946913', 'n_tokens_mistral': 1788, 'n_tokens_neox': 1747, 'n_words': 335}