<commit_before><link rel="import" href="../polymer/polymer.html">

<script>
  (function () {

    // share g with core-style
    window.CoreStyle = window.CoreStyle || {
      g: {},
      list: {},
      refMap: {}
    };

    // initialize default theme values
    if (!window.CoreStyle.g.theme) {
      window.CoreStyle.g.theme = {};
      var t = window.CoreStyle.g.theme;
      t.colorTwo = '#123456';
    }


    Polymer({

      is: 'at-core-theme',
      properties: {
        theme: {
          type: String,
          value: 'carbon'
        }
      },
      // static
      g: CoreStyle.g,
      list: CoreStyle.list,

      ready: function () {
        this.themeChanged();
      },

      themeChanged: function () {

        // is theme already loaded?
        if (window.CoreStyle.g.theme.name == this.theme) return;
        if (window.CoreStyle.g.theme.name && !this.theme) return;

        var url = "/components/";
        if (window.ComponentsBase != undefined) url = window.ComponentsBase;
        url += "at-core-theme/dist/" + this.theme + "/semantic";
        if (Polymer.Settings.useShadow) url += "-deep";
        url += ".css";

        var cssref = document.getElementById("at-core-theme");

        if (!cssref) {

          var style = document.createElement('style');
          style.textContent = '.themed, [themed] { opacity: 0; display: block; } \n' +
            '[unresolved], html /deep/ unresolved { opacity: 0; display: block; overflow: hidden; } \n';
          var head = document.querySelector('head');
          head.insertBefore(style, head.firstChild);

          cssref = document.createElement("link");
          cssref.setAttribute("rel", "stylesheet");
          cssref.setAttribute("type", "text/css");
          cssref.setAttribute("id", "at-core-theme");
          cssref.setAttribute("href", url);

          // ensure that at-core-theme is first element in head, so that classes can still be overwritten as needed
          var h = document.getElementsByTagName("head")[0];
          if (!h.children.length) {
            h.appendChild(cssref);
          } else {
            h.insertBefore(cssref, h.firstChild);
          }

          // remove unresolved from body, now per element [unresolved] is setup
          document.body.removeAttribute('unresolved');

        } else {
          cssref.setAttribute("href", url);
        }

        console.log("theme changed to: " + this.theme);
        window.CoreStyle.g.theme.name = this.theme;
      }

    });

  })();
</script>

<commit_msg>switch from unresolved to loading for finer grained control over body<commit_after><link rel="import" href="../polymer/polymer.html">

<script>
  (function () {

    // share g with core-style
    window.CoreStyle = window.CoreStyle || {
      g: {},
      list: {},
      refMap: {}
    };

    // initialize default theme values
    if (!window.CoreStyle.g.theme) {
      window.CoreStyle.g.theme = {};
      var t = window.CoreStyle.g.theme;
      t.colorTwo = '#123456';
    }


    Polymer({

      is: 'at-core-theme',
      properties: {
        theme: {
          type: String,
          value: 'carbon'
        }
      },
      // static
      g: CoreStyle.g,
      list: CoreStyle.list,

      ready: function () {
        this.themeChanged();
      },

      themeChanged: function () {

        // is theme already loaded?
        if (window.CoreStyle.g.theme.name == this.theme) return;
        if (window.CoreStyle.g.theme.name && !this.theme) return;

        var url = "/components/";
        if (window.ComponentsBase != undefined) url = window.ComponentsBase;
        url += "at-core-theme/dist/" + this.theme + "/semantic";
        if (Polymer.Settings.useShadow) url += "-deep";
        url += ".css";

        var cssref = document.getElementById("at-core-theme");

        if (!cssref) {

          var style = document.createElement('style');
          style.textContent = '.themed, [themed] { opacity: 0; display: block; } \n' +
            '[loading], html /deep/ loading { opacity: 0; display: block; overflow: hidden; } \n';
          var head = document.querySelector('head');
          head.insertBefore(style, head.firstChild);

          cssref = document.createElement("link");
          cssref.setAttribute("rel", "stylesheet");
          cssref.setAttribute("type", "text/css");
          cssref.setAttribute("id", "at-core-theme");
          cssref.setAttribute("href", url);

          // ensure that at-core-theme is first element in head, so that classes can still be overwritten as needed
          var h = document.getElementsByTagName("head")[0];
          if (!h.children.length) {
            h.appendChild(cssref);
          } else {
            h.insertBefore(cssref, h.firstChild);
          }

          // remove loading from body, now themed hides body until css is loaded
          document.body.removeAttribute('loading');

        } else {
          cssref.setAttribute("href", url);
        }

        console.log("theme changed to: " + this.theme);
        window.CoreStyle.g.theme.name = this.theme;
      }

    });

  })();
</script>


{'fraction_non_alphanumeric': 0.14602803738317757, 'fraction_numerical': 0.0035046728971962616, 'mean_word_length': 2.023543260741613, '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': '1502026', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1452, 'n_words': 340}