<commit_before>Foundation = require 'art-foundation'

{Promise, parseQuery, log} = Foundation
{Meta} = Foundation.Browser.DomElementFactories

module.exports = class FullScreenApp

  @_domReady: ->
    Engine = require 'art-engine'
    query = parseQuery()
    log """
      Art.Engine.FullScreenApp options:
        ?dev=true
          show DomConsole
        ?perfGraphs=true
          show performance graphs
      """

    if query.dev == "true" || query.perfGraphs == "true"

      ###
      TODO:
      this indirectly requires jquery...
      1) dom-console doesn't really need jquery, it just needs a refactor
      2) I'd like a way to easily build production vs dev code.
      3) DomConsole should only be included in dev code.
      ###
      DomConsole = require 'art-foundation/dev_tools/dom_console'

      DomConsole.enable()
      Engine.DevTools.GlobalEpochStats.enable() if query.perfGraphs == "true"

    log "Art.Engine.FullScreenApp: app ready"

  @init: (config = {})->
    document.onreadystatechange = =>
      if document.readyState == "interactive"
        @_domReady();
        appReadyPromise.resolve()

    module.exports = appReadyPromise = new Promise

    @writeDom config

    appReadyPromise

  @writeDom: ({title, styleSheets, scripts, fontFamilies})->

    title ||= "Art App"
    scripts ||= []
    styleSheets ||= []
    fontFamilies ||= []

    styleSheetLinks = for sheetUrl in styleSheets<commit_msg>fullScreenAppInit now properly sets the browser window title<commit_after>Foundation = require 'art-foundation'

{Promise, parseQuery, log} = Foundation
{Meta} = Foundation.Browser.DomElementFactories

module.exports = class FullScreenApp

  @_domReady: ->
    Engine = require 'art-engine'
    query = parseQuery()
    log """
      Art.Engine.FullScreenApp options:
        ?dev=true
          show DomConsole
        ?perfGraphs=true
          show performance graphs
      """

    if query.dev == "true" || query.perfGraphs == "true"

      ###
      TODO:
      this indirectly requires jquery...
      1) dom-console doesn't really need jquery, it just needs a refactor
      2) I'd like a way to easily build production vs dev code.
      3) DomConsole should only be included in dev code.
      ###
      DomConsole = require 'art-foundation/dev_tools/dom_console'

      DomConsole.enable()
      Engine.DevTools.GlobalEpochStats.enable() if query.perfGraphs == "true"

    log "Art.Engine.FullScreenApp: app ready"

  @init: (config = {})->
    document.onreadystatechange = =>
      if document.readyState == "interactive"
        @_domReady();
        appReadyPromise.resolve()

    module.exports = appReadyPromise = new Promise

    @writeDom config

    appReadyPromise

  @writeDom: ({title, styleSheets, scripts, fontFamilies})->

    document.title = title || "Art App"
    scripts ||= []
    styleSheets ||= []
    fontFamilies ||= []

    styleSheetLinks = for sheetUrl in styleSheets
{'fraction_non_alphanumeric': 0.10824567356633864, 'fraction_numerical': 0.0020359687818120122, 'mean_word_length': 2.813712807244502, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4538626', 'n_tokens_mistral': 866, 'n_tokens_neox': 829, 'n_words': 233}