<commit_before>// Copyright 2012 <NAME>. All Rights Reserved.

/**
 * @fileoverview Entry point for the Solitario app.
 *
 * @author <EMAIL> (<NAME>)
 */

goog.provide('solitario.App');
goog.provide('solitario.init');

goog.require('goog.dom');
goog.require('goog.dom.BufferedViewportSizeMonitor');
goog.require('goog.dom.ViewportSizeMonitor');
goog.require('goog.events');
goog.require('solitario.game.Game');


/**
 * Entry point of the application.
 */
solitario.init = function() {
  solitario.App.getInstance();
};


/**
 * Singleton class for the Solitario app.
 *
 * @constructor
 */
solitario.App = function() {
  /**
   * The current game loaded in the app.
   * @type {solitario.game.Game}
   * @private
   */
  this.game_ = new solitario.game.Game();

  /**
   * Viewport monitor to adjust for size changes.
   * @type {goog.dom.ViewportSizeMonitor}
   * @private
   */
   this.viewportMonitor_ = new goog.dom.BufferedViewportSizeMonitor(
       new goog.dom.ViewportSizeMonitor(), 50);

   // Listen for viewport changes.
   goog.events.listen(this.viewportMonitor_, goog.events.EventType.RESIZE,
                      this.resizeBoard_, false, this);
   // Trigger initial viewport calculation.
   this.resizeBoard_();

   window.setTimeout(goog.bind(this.game_.start, this.game_), 2000);
};
goog.addSingletonGetter(solitario.App);


/**
 * Handler to change the size of the base font to accomodate
 * viewport resizing.
 *
 * @param {goog.events.Event} e Viewport resize event.
 * @private
 */
solitario.App.prototype.resizeBoard_ = function(e) {
  var pixelSize = (this.viewportMonitor_.getSize().width / 85).toFixed(1) +
      'px';
  goog.dom.getDocument().body.style.fontSize = pixelSize;
};


goog.exportSymbol('solitario.init', solitario.init);<commit_msg>Viewport resizing now considers height too.<commit_after>// Copyright 2012 <NAME>. All Rights Reserved.

/**
 * @fileoverview Entry point for the Solitario app.
 *
 * @author <EMAIL> (<NAME>)
 */

goog.provide('solitario.App');
goog.provide('solitario.init');

goog.require('goog.dom');
goog.require('goog.dom.BufferedViewportSizeMonitor');
goog.require('goog.dom.ViewportSizeMonitor');
goog.require('goog.events');
goog.require('solitario.game.Game');


/**
 * Entry point of the application.
 */
solitario.init = function() {
  solitario.App.getInstance();
};


/**
 * Singleton class for the Solitario app.
 *
 * @constructor
 */
solitario.App = function() {
  /**
   * The current game loaded in the app.
   * @type {solitario.game.Game}
   * @private
   */
  this.game_ = new solitario.game.Game();

  /**
   * Viewport monitor to adjust for size changes.
   * @type {goog.dom.ViewportSizeMonitor}
   * @private
   */
   this.viewportMonitor_ = new goog.dom.BufferedViewportSizeMonitor(
       new goog.dom.ViewportSizeMonitor(), 50);

   // Listen for viewport changes.
   goog.events.listen(this.viewportMonitor_, goog.events.EventType.RESIZE,
                      this.resizeBoard_, false, this);
   // Trigger initial viewport calculation.
   this.resizeBoard_();

   window.setTimeout(goog.bind(this.game_.start, this.game_), 2000);
};
goog.addSingletonGetter(solitario.App);


/**
 * Handler to change the size of the base font to accomodate
 * viewport resizing.
 *
 * @param {goog.events.Event} e Viewport resize event.
 * @private
 */
solitario.App.prototype.resizeBoard_ = function(e) {
  var viewportSize = this.viewportMonitor_.getSize();
  var widthPixelSize = (viewportSize.width / 85).toFixed(1);
  var heightPixelSize = (viewportSize.height / 60).toFixed(1);
  var pixelSize = Math.min(widthPixelSize, heightPixelSize) + 'px';
  goog.dom.getDocument().body.style.fontSize = pixelSize;
};


goog.exportSymbol('solitario.init', solitario.init);
{'fraction_non_alphanumeric': 0.146524064171123, 'fraction_numerical': 0.007754010695187166, 'mean_word_length': 3.7716836734693877, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '769782', 'n_tokens_mistral': 1281, 'n_tokens_neox': 1196, 'n_words': 253}