<commit_before>/*globals Polymer */
'use strict';

Polymer(
  {
    is: 'cordova-core',

    properties: {
      /**
       * Return if cordova deviceready event has been fired.
       */
      ready: {
        notify: true,
        readOnly: true,
        type: Boolean,
        value: false
      },

      /**
       * Return if cordova application is paused.
       */
      paused: {
        notify: true,
        readOnly: true,
        type: Boolean,
        value: false
      }
    },

    attached() {
      const cordovaEl = document.querySelector('#cordova');

      document.addEventListener(
        'deviceready',
        this._setReady.bind(this, true),
        false
      );
      document.addEventListener(
        'pause',
        this._setPaused.bind(this, true),
        false
      );
      document.addEventListener(
        'resume',
        this._setPaused.bind(this, false),
        false
      );

      if (!cordovaEl) {
        let script = document.createElement('script');

        script.id = 'cordova';<commit_msg>Change way to load cordova.js<commit_after>/*globals Polymer */
'use strict';

Polymer(
  {
    is: 'cordova-core',

    properties: {
      /**
       * Return if cordova deviceready event has been fired.
       */
      ready: {
        notify: true,
        readOnly: true,
        type: Boolean,
        value: false
      },

      /**
       * Return if cordova application is paused.
       */
      paused: {
        notify: true,
        readOnly: true,
        type: Boolean,
        value: false
      }
    },

    attached() {
      const cordovaEl = document.querySelector('[src="cordova.js"]');

      document.addEventListener(
        'deviceready',
        this._setReady.bind(this, true),
        false
      );
      document.addEventListener(
        'pause',
        this._setPaused.bind(this, true),
        false
      );
      document.addEventListener(
        'resume',
        this._setPaused.bind(this, false),
        false
      );

      if (!cordovaEl) {
        let script = document.createElement('script');

{'fraction_non_alphanumeric': 0.117168818747011, 'fraction_numerical': 0.0, 'mean_word_length': 1.6514575411913814, 'pattern_counts': {'":': 0, '<': 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': '2432866', 'n_tokens_mistral': 604, 'n_tokens_neox': 588, 'n_words': 133}