<commit_before><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Renuo CMS Client Example</title>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
        integrity="<KEY>" crossorigin="anonymous">

  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
<div class="container">
  <h1>Renuo CMS Client Examples</h1>

  <section>
    <h2>Cannot be edited</h2>
    <div class="row">
      <article class="col-sm-6">
        <h3>This exists and is cached</h3>
        <div data-content-path="some/path/to/some/content" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"></div>
      </article>
      <article class="col-sm-6">
        <h3>This doesn't exist</h3>
        <div data-content-path="some/other-path/to/some/nonexisting-content" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"></div>
      </article>
    </div>
  </section>

  <section>
    <h2>These can be edited</h2>
    <div class="row">
      <article class="col-sm-4">
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>
      <article class="col-sm-4">
        <div data-content-path="content/bla" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>
      <article class="col-sm-4">
        <div data-content-path="even-more-content"
             data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>
    </div>
  </section>

  <section>
    <h2>Corner cases</h2>

    <div class="row">
      <article class="col-sm-4">
        <h3>Same path as above, but not editable</h3>
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"></div>
      </article>

      <article class="col-sm-4">
        <h3>Same path as above, also editable</h3>
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>

      <article class="col-sm-4">
        <h3>Different API Key</h3>
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002" data-api-key="anotherPublicKey"
             data-private-api-key="SuperAdminOnly"></div>
      </article>
    </div>
  </section>

  <section>
    <h2>Default content</h2>

    <div class="row">
      <article class="col-xs-4">
        <h3>Simple default content</h3>
        <div data-content-path="content/new-default-static" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="anotherPublicKey">
          <h4>Default Content</h4>
          <p>This is some default content. It is the default when the API doesn't have a content block for it yet.</p>
        </div>
      </article>

      <article class="col-xs-4">
        <h3>Editable default content</h3>
        <div data-content-path="content/new-default-editable" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="anotherPublicKey" data-private-api-key="SuperAdminOnly">
          <h4>Editable default Content (don't save...)</h4>
          <p>This is some default content. It is the default when the API doesn't have a content block for it yet.</p>
        </div>
      </article>

      <article class="col-xs-4">
        <h3>Editable (wrong private api key)</h3>
        <div data-content-path="content/new-default-not-editable" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="anotherPublicKey" data-private-api-key="InvalidPrivateAPIKey">
          <h4>Editable default Content (cannot be saved, wrong private api key)</h4>
          <p>This is some default content. It is the default when the API doesn't have a content block for it yet.</p>
        </div>
      </article>
    </div>
  </section>

  <section>
    <h2>Lists</h2>

    <div class="row">
      <article class="col-xs-6">
        <h3>Editable list</h3>
        <div data-content-path="list-1" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY">
          <ul>
            <li>Some</li>
            <li>List</li>
            <li>Items</li>
          </ul>
          <p>List with items</p>
        </div>
      </article>

      <article class="col-xs-6">
        <h3>Editable list items</h3>
        <ul class="fa-ul">
          <li>
            <i class="fa-li fa fa-check-square"></i>
            <div data-content-path="list-2/li-1a" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
                 data-private-api-key="AdminONLY">Some
            </div>
          </li>
          <li>
            <i class="fa-li fa fa-check-square"></i>
            <div data-content-path="list-2/li-2a" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
                 data-private-api-key="AdminONLY">List
            </div>
          </li>
          <li>
            <i class="fa-li fa fa-check-square"></i>
            <div class="pull-left" data-content-path="list-2/li-3a" data-api-host="//renuo-cms-api.dev:3002"
                 data-api-key="aValidApiKey"
                 data-private-api-key="AdminONLY">Items
            </div>
          </li>
        </ul>
      </article>
    </div>
  </section>

  <section>
    <h2>Delayed editability</h2>
    <article>
      <h3>This becomes editable after 2 seconds</h3>

      <div data-content-path="i-am-late" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey">
        <p>Some more <b>default</b> content</p>
      </div>
    </article>
  </section>
</div>
</body>
<script src="https://cdn.jsdelivr.net/jquery/2.2.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
        integrity="<KEY>"
        crossorigin="anonymous"></script>
<script src="renuo-cms-client.js"></script>
<script>
  setTimeout(function () {
    var div = jQuery('[data-content-path=i-am-late]').eq(0);
    div.attr('data-private-api-key', 'AdminONLY');
    jQuery(document).trigger('renuo-cms-reload');
  }, 2000);
</script>
</html><commit_msg>make a sample for the single reload event<commit_after><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Renuo CMS Client Example</title>

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
        integrity="<KEY>" crossorigin="anonymous">

  <!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
<div class="container">
  <h1>Renuo CMS Client Examples</h1>

  <section>
    <h2>Cannot be edited</h2>
    <div class="row">
      <article class="col-sm-6">
        <h3>This exists and is cached</h3>
        <div data-content-path="some/path/to/some/content" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"></div>
      </article>
      <article class="col-sm-6">
        <h3>This doesn't exist</h3>
        <div data-content-path="some/other-path/to/some/nonexisting-content" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"></div>
      </article>
    </div>
  </section>

  <section>
    <h2>These can be edited</h2>
    <div class="row">
      <article class="col-sm-4">
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>
      <article class="col-sm-4">
        <div data-content-path="content/bla" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>
      <article class="col-sm-4">
        <div data-content-path="even-more-content"
             data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>
    </div>
  </section>

  <section>
    <h2>Corner cases</h2>

    <div class="row">
      <article class="col-sm-4">
        <h3>Same path as above, but not editable</h3>
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="aValidApiKey"></div>
      </article>

      <article class="col-sm-4">
        <h3>Same path as above, also editable</h3>
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY"></div>
      </article>

      <article class="col-sm-4">
        <h3>Different API Key</h3>
        <div data-content-path="content/blub" data-api-host="//renuo-cms-api.dev:3002" data-api-key="anotherPublicKey"
             data-private-api-key="SuperAdminOnly"></div>
      </article>
    </div>
  </section>

  <section>
    <h2>Default content</h2>

    <div class="row">
      <article class="col-xs-4">
        <h3>Simple default content</h3>
        <div data-content-path="content/new-default-static" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="anotherPublicKey">
          <h4>Default Content</h4>
          <p>This is some default content. It is the default when the API doesn't have a content block for it yet.</p>
        </div>
      </article>

      <article class="col-xs-4">
        <h3>Editable default content</h3>
        <div data-content-path="content/new-default-editable" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="anotherPublicKey" data-private-api-key="SuperAdminOnly">
          <h4>Editable default Content (don't save...)</h4>
          <p>This is some default content. It is the default when the API doesn't have a content block for it yet.</p>
        </div>
      </article>

      <article class="col-xs-4">
        <h3>Editable (wrong private api key)</h3>
        <div data-content-path="content/new-default-not-editable" data-api-host="//renuo-cms-api.dev:3002"
             data-api-key="anotherPublicKey" data-private-api-key="InvalidPrivateAPIKey">
          <h4>Editable default Content (cannot be saved, wrong private api key)</h4>
          <p>This is some default content. It is the default when the API doesn't have a content block for it yet.</p>
        </div>
      </article>
    </div>
  </section>

  <section>
    <h2>Lists</h2>

    <div class="row">
      <article class="col-xs-6">
        <h3>Editable list</h3>
        <div data-content-path="list-1" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
             data-private-api-key="AdminONLY">
          <ul>
            <li>Some</li>
            <li>List</li>
            <li>Items</li>
          </ul>
          <p>List with items</p>
        </div>
      </article>

      <article class="col-xs-6">
        <h3>Editable list items</h3>
        <ul class="fa-ul">
          <li>
            <i class="fa-li fa fa-check-square"></i>
            <div data-content-path="list-2/li-1a" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
                 data-private-api-key="AdminONLY">Some
            </div>
          </li>
          <li>
            <i class="fa-li fa fa-check-square"></i>
            <div data-content-path="list-2/li-2a" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey"
                 data-private-api-key="AdminONLY">List
            </div>
          </li>
          <li>
            <i class="fa-li fa fa-check-square"></i>
            <div class="pull-left" data-content-path="list-2/li-3a" data-api-host="//renuo-cms-api.dev:3002"
                 data-api-key="aValidApiKey"
                 data-private-api-key="AdminONLY">Items
            </div>
          </li>
        </ul>
      </article>
    </div>
  </section>

  <section>
    <h2>Delayed editability</h2>
    <article>
      <h3>This becomes editable after 2 seconds</h3>

      <div data-content-path="i-am-late" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey">
        <p>Some more <b>default</b> content</p>
      </div>
    </article>
  </section>

  <section>
    <h2>Delayed editability</h2>
    <article>
      <h3>This becomes editable after 5 seconds, single triggered</h3>

      <div data-content-path="i-am-single-triggered" data-api-host="//renuo-cms-api.dev:3002" data-api-key="aValidApiKey">
        <p>Some more <b>default</b> content</p>
      </div>
    </article>
  </section>
</div>
</body>
<script src="https://cdn.jsdelivr.net/jquery/2.2.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
        integrity="<KEY>"
        crossorigin="anonymous"></script>
<script src="renuo-cms-client.js"></script>
<script>
  setTimeout(function () {
    var div = jQuery('[data-content-path=i-am-late]').eq(0);
    div.attr('data-private-api-key', 'AdminONLY');
    jQuery(document).trigger('renuo-cms-reload');
  }, 2000);
</script>

<script>
  setTimeout(function () {
    var div = jQuery('[data-content-path=i-am-single-triggered]').eq(0);
    div.attr('data-private-api-key', 'AdminONLY');
    jQuery(document).trigger('renuo-cms-reload-single', ['i-am-single-triggered']);
  }, 5000);
</script>
</html>
{'fraction_non_alphanumeric': 0.18313064504658275, 'fraction_numerical': 0.02261574567953915, 'mean_word_length': 2.3900675024108002, 'pattern_counts': {'":': 0, '<': 397, '<?xml version=': 0, '>': 397, 'https://': 10, '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': '6294036', 'n_tokens_mistral': 5115, 'n_tokens_neox': 4907, 'n_words': 808}