<commit_before>// Copyright 2015-2017, University of Colorado Boulder

/**
 * Failure message displayed when a WebGL context loss is experienced and we can't recover. Offers a button to reload
 * the simulation.
 *
 * @author <NAME> <<EMAIL>>
 */
define( function( require ) {
  'use strict';

  // modules
  var Dialog = require( 'SUN/Dialog' );
  var FontAwesomeNode = require( 'SUN/FontAwesomeNode' );
  var HBox = require( 'SCENERY/nodes/HBox' );
  var inherit = require( 'PHET_CORE/inherit' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
  var Tandem = require( 'TANDEM/Tandem' );
  var Text = require( 'SCENERY/nodes/Text' );
  var TextPushButton = require( 'SUN/buttons/TextPushButton' );

  // strings
  var webglWarningContextLossFailureString = require( 'string!SCENERY_PHET/webglWarning.contextLossFailure' );
  var webglWarningContextLossReloadString = require( 'string!SCENERY_PHET/webglWarning.contextLossReload' );

  /**
   *
   * @constructor
   */
  function ContextLossFailureDialog() {
    Tandem.indicateUninstrumentedCode();

    var warningSign = new FontAwesomeNode( 'warning_sign', {
      fill: '#E87600', // "safety orange", according to Wikipedia
      scale: 0.6
    } );

    var text = new Text( webglWarningContextLossFailureString, { font: new PhetFont( 12 ) } );

    var button = new TextPushButton( webglWarningContextLossReloadString, {
      font: new PhetFont( 12 ),
      baseColor: '#E87600',
      listener: function() {
        window.location.reload();
      }
    } );

    Dialog.call( this, new HBox( {
      children: [ warningSign, text, button ],
      spacing: 10
    } ), {
      modal: true,
      hasCloseButton: false,
      xMargin: 10,
      yMargin: 10
    } );
  }

  sceneryPhet.register( 'ContextLossFailureDialog', ContextLossFailureDialog );

  return inherit( Dialog, ContextLossFailureDialog );
} );<commit_msg>hasCloseButton is no longer an option, modal:true is the default, https://github.com/phetsims/joist/issues/413, https://github.com/phetsims/scenery-phet/issues/373<commit_after>// Copyright 2015-2017, University of Colorado Boulder

/**
 * Failure message displayed when a WebGL context loss is experienced and we can't recover. Offers a button to reload
 * the simulation.
 *
 * @author <NAME> <<EMAIL>>
 */
define( function( require ) {
  'use strict';

  // modules
  var Dialog = require( 'SUN/Dialog' );
  var FontAwesomeNode = require( 'SUN/FontAwesomeNode' );
  var HBox = require( 'SCENERY/nodes/HBox' );
  var inherit = require( 'PHET_CORE/inherit' );
  var PhetFont = require( 'SCENERY_PHET/PhetFont' );
  var sceneryPhet = require( 'SCENERY_PHET/sceneryPhet' );
  var Tandem = require( 'TANDEM/Tandem' );
  var Text = require( 'SCENERY/nodes/Text' );
  var TextPushButton = require( 'SUN/buttons/TextPushButton' );

  // strings
  var webglWarningContextLossFailureString = require( 'string!SCENERY_PHET/webglWarning.contextLossFailure' );
  var webglWarningContextLossReloadString = require( 'string!SCENERY_PHET/webglWarning.contextLossReload' );

  /**
   *
   * @constructor
   */
  function ContextLossFailureDialog() {
    Tandem.indicateUninstrumentedCode();

    var warningSign = new FontAwesomeNode( 'warning_sign', {
      fill: '#E87600', // "safety orange", according to Wikipedia
      scale: 0.6
    } );

    var text = new Text( webglWarningContextLossFailureString, { font: new PhetFont( 12 ) } );

    var button = new TextPushButton( webglWarningContextLossReloadString, {
      font: new PhetFont( 12 ),
      baseColor: '#E87600',
      listener: function() {
        window.location.reload();
      }
    } );

    Dialog.call( this, new HBox( {
      children: [ warningSign, text, button ],
      spacing: 10
    } ), {
      xMargin: 10,
      yMargin: 10
    } );
  }

  sceneryPhet.register( 'ContextLossFailureDialog', ContextLossFailureDialog );

  return inherit( Dialog, ContextLossFailureDialog );
} );
{'fraction_non_alphanumeric': 0.12155388471177944, 'fraction_numerical': 0.016541353383458645, 'mean_word_length': 3.5926352128883776, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '2205280', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1260, 'n_words': 303}