<commit_before><link rel="import" href="../bower_components/core-icon-button/core-icon-button.html">>
<link rel="import" href="../bower_components/core-header-panel/core-header-panel.html">
<link rel="import" href="../bower_components/paper-fab/paper-fab.html">
<link rel="import" href="../bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">

<polymer-element name="cp-sources-selector">
  <template>
    <style>
      :host {
        display: block;
        position: relative;
        display: inline-block;
        height: 100%;
        width: 100%;
        overflow-y: auto;
        background-color: white;
      }

      #panel_overlay {
        position:absolute;
        top:0px;
        left:0px;
        bottom:0px;
        right:0px;
        background-color:rgba(0, 0, 0, 0.5);
        z-index: 5;
        visibility: hidden;
      }

      #panel {
        height: 100%;
        width: 100%;
      }

      #header {
        background-color: #ff8b00;
        text-align: left;
        color: white;
        padding-top: 30px;
      }

      #headertext {
        margin: 0;
        font-size: 1.1em;
      }

      #add {
        background-color: #ffcd97;
        bottom:-20px;
        z-index:1;
      }

      #add::shadow core-icon, core-icon {
        color: black;
      }

      #select_all {
        padding-top:45px;
        padding-bottom:45px;
        border-bottom:solid black 1px;
      }

      #title-back {
        align-items:center;
        margin-top:50px;
      }

      #sources div {
        padding-top:15px;
        padding-bottom:15px;
        align-items: center;
      }

      paper-checkbox {
        margin-right: 15px;
        margin-left: 15px;
      }

      #sources core-icon {
        color: gray;
      }

      paper-dialog {
        left: 5%;
        right: 5%;
        top: 40%;
        bottom: 40%;
        background-color:white;
        display: flex;
      }

      #add_dialog::shadow #container {
        padding: 0;
        max-height: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
      }

      #add_dialog::shadow #main {
        padding: 0;
        max-height: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
      }

      #add_dialog::shadow #actions {
        padding: 0;
      }

      #add_dialog paper-input-decorator {
        padding: 0;
        width: 70%;
        height: 35%;
        margin: auto;
        font-size: 70%;
      }

      #add_dialog_button_wrapper {
        width:70%;
        height:30%;
        margin: auto;
      }

      #add_dialog_button_wrapper paper-button {
        font-size: 70%;
        text-align: center;
        width: 30%;
        height: 70%;
        margin: auto;
      }
    </style>

    <div id="panel_overlay"></div>
    <core-header-panel id="panel">
      <core-toolbar id="header" class="medium-tall">
        <div vertical layout>
          <div id="title-back" horizontal layout>
            <core-icon-button icon="arrow-back"
                              on-tap="{{onBackButtonClick}}">
            </core-icon-button>

            <div flex>
              <div id="headertext">Groups</div>
            </div>
          </div>
          <paper-fab id="add" icon="add" on-click="{{onAddClick}}"></paper-fab>
        </div>
      </core-toolbar>

      <div id="select_all" horizontal layout>
        <paper-checkbox on-change="{{enableAllSources}}"></paper-checkbox>
        <div flex>Select All</div>
      </div>

      <div id="sources" vertical layout></div>

      <paper-dialog id="add_dialog" flex transition="paper-dialog-transition-center" autoCloseDisabled="{{true}}">
        <paper-input-decorator label="Source Name" floatingLabel error="input is required!">
          <input is="core-input" required>
        </paper-input-decorator>

        <paper-input-decorator label="Source URL" floatingLabel error="input is required!">
          <input is="core-input" required>
        </paper-input-decorator>

        <div id="add_dialog_button_wrapper" horizontal justified layout>
          <paper-button id="cancel" dismissive on-click="{{onAddCancelClick}}">Cancel</paper-button>
          <paper-button id="done" on-click="{{onAddDoneClick}}">Done</paper-button>
        </div>
      </paper-dialog>
    </core-header-panel>
  </template>

  <script>
    (function () {
      var onAddSource = function (self, name, url, type) {
        var wrapper = document.createElement("DIV");
        var checkbox = document.createElement("paper-checkbox");
        var listItem = document.createElement("DIV");
        var trash = document.createElement("core-icon");
        var icon = document.createAttribute("icon");

        listItem.innerText = name;
        listItem.setAttributeNode(document.createAttribute("flex"));

        icon.value = "delete";
        trash.setAttributeNode(icon);

        wrapper.setAttributeNode(document.createAttribute("horizontal"));
        wrapper.setAttributeNode(document.createAttribute("layout"));

        checkbox.addEventListener("change", function () {
          onCheckboxToggled(self, name, url, type,
            checkbox.getAttribute("checked") !== null);
        });

        trash.addEventListener("click", function () {
          onRemoveSource(self, name, url, type, wrapper);
        });

        wrapper.appendChild(checkbox);
        wrapper.appendChild(listItem);
        wrapper.appendChild(trash);
<commit_msg>cp-sources-selector: Some stylistic changes.<commit_after><link rel="import" href="../bower_components/core-icon-button/core-icon-button.html">>
<link rel="import" href="../bower_components/core-header-panel/core-header-panel.html">
<link rel="import" href="../bower_components/paper-fab/paper-fab.html">
<link rel="import" href="../bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">

<polymer-element name="cp-sources-selector">
  <template>
    <style>
      :host {
        display: block;
        position: relative;
        display: inline-block;
        height: 100%;
        width: 100%;
        overflow-y: auto;
        background-color: white;
      }

      #panel_overlay {
        position:absolute;
        top:0px;
        left:0px;
        bottom:0px;
        right:0px;
        background-color:rgba(0, 0, 0, 0.5);
        z-index: 5;
        visibility: hidden;
      }

      #panel {
        height: 100%;
        width: 100%;
      }

      #header {
        background-color: #ff8b00;
        text-align: left;
        color: white;
        padding-top: 30px;
      }

      #headertext {
        margin: 0;
        font-size: 1.1em;
      }

      #add {
        background-color: #ffcd97;
        bottom:-20px;
        z-index:1;
      }

      #add::shadow core-icon, core-icon {
        color: black;
      }

      #select_all {
        padding-top:45px;
        padding-bottom:45px;
        border-bottom:solid black 1px;
      }

      #title-back {
        align-items:center;
        margin-top:50px;
      }

      #sources div {
        padding-top:15px;
        padding-bottom:15px;
        align-items: center;
      }

      paper-checkbox {
        margin-right: 15px;
        margin-left: 15px;
      }

      #sources core-icon {
        color: gray;
      }

      paper-dialog {
        left: 5%;
        right: 5%;
        top: 40%;
        bottom: 40%;
        background-color:white;
        display: flex;
      }

      #add_dialog::shadow #container {
        padding: 0;
        max-height: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
      }

      #add_dialog::shadow #main {
        padding: 0;
        max-height: 100%;
        max-width: 100%;
        width: 100%;
        height: 100%;
      }

      #add_dialog::shadow #actions {
        padding: 0;
      }

      #add_dialog paper-input-decorator {
        padding: 0;
        width: 70%;
        height: 35%;
        margin: auto;
        font-size: 70%;
      }

      #add_dialog_button_wrapper {
        width:70%;
        height:30%;
        margin: auto;
      }

      #add_dialog_button_wrapper paper-button {
        font-size: 70%;
        text-align: center;
        width: 30%;
        height: 70%;
        margin: auto;
      }
    </style>

    <div id="panel_overlay"></div>
    <core-header-panel id="panel">
      <core-toolbar id="header" class="medium-tall">
        <div vertical layout>
          <div id="title-back" horizontal layout>
            <core-icon-button icon="arrow-back"
                              on-tap="{{onBackButtonClick}}">
            </core-icon-button>

            <div flex>
              <div id="headertext">Groups</div>
            </div>
          </div>
          <paper-fab id="add" icon="add" on-click="{{onAddClick}}"></paper-fab>
        </div>
      </core-toolbar>

      <div id="select_all" horizontal layout>
        <paper-checkbox on-change="{{enableAllSources}}"></paper-checkbox>
        <div flex>Select All</div>
      </div>

      <div id="sources" vertical layout></div>

      <paper-dialog id="add_dialog" flex transition="paper-dialog-transition-center" autoCloseDisabled="{{true}}">
        <paper-input-decorator label="Source Name" floatingLabel error="input is required!">
          <input is="core-input" required>
        </paper-input-decorator>

        <paper-input-decorator label="Source URL" floatingLabel error="input is required!">
          <input is="core-input" required>
        </paper-input-decorator>

        <div id="add_dialog_button_wrapper" horizontal justified layout>
          <paper-button id="cancel" dismissive on-click="{{onAddCancelClick}}">Cancel</paper-button>
          <paper-button id="done" on-click="{{onAddDoneClick}}">Done</paper-button>
        </div>
      </paper-dialog>
    </core-header-panel>
  </template>

  <script>
    (function () {
      var onAddSource = function (self, name, url, type) {
        var wrapper = document.createElement("div");
        var checkbox = document.createElement("paper-checkbox");
        var listItem = document.createElement("div");
        var trash = document.createElement("core-icon");
        var icon = document.createAttribute("icon");

        listItem.innerText = name;
        listItem.setAttributeNode(document.createAttribute("flex"));

        icon.value = "delete";
        trash.setAttributeNode(icon);

        wrapper.setAttributeNode(document.createAttribute("horizontal"));
        wrapper.setAttributeNode(document.createAttribute("layout"));

        checkbox.addEventListener("change", function () {
          onCheckboxToggled(self, name, url, type,
            checkbox.getAttribute("checked") !== null);
        });

        trash.addEventListener("click", function () {
          onRemoveSource(self, name, url, type, wrapper);
        });

        wrapper.appendChild(checkbox);
        wrapper.appendChild(listItem);
        wrapper.appendChild(trash);

{'fraction_non_alphanumeric': 0.1420439618180226, 'fraction_numerical': 0.017514668534897977, 'mean_word_length': 2.0641266434129326, 'pattern_counts': {'":': 0, '<': 109, '<?xml version=': 0, '>': 111, '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': '1355991', 'n_tokens_mistral': 3523, 'n_tokens_neox': 3297, 'n_words': 631}