<!--
Copyright (C) 2016 The Android Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/iron-input/iron-input.html">

<dom-module id="gr-diff-preferences">
  <template>
    <style>
      :host {
        display: block;
      }
      :host[disabled] {
        opacity: .5;
        pointer-events: none;
      }
      button,
      input,
      select {
        font: inherit;
      }
      input[type="number"] {
        width: 4em;
      }
      button {
        background-color: #f1f2f3;
        border: 1px solid #aaa;
        border-radius: 2px;
        cursor: pointer;
        font: inherit;
        padding: .2em .75em;
      }
      button.primary {
        background: #448aff;
        border: none;
        color: #fff;
      }
      .header,
      .actions {
        padding: 1em 1.5em;
      }
      .header {
        border-bottom: 1px solid #ddd;
        font-weight: bold;
      }
      .mainContainer {
        padding: 1em 0;
      }
      .pref {
        align-items: center;
        display: flex;
        padding: .35em 1.5em;
        width: 20em;
      }
      .pref:hover {
        background-color: #ebf5fb;
      }
      .pref label {
        cursor: pointer;
        flex: 1;
      }
      .actions {
        border-top: 1px solid #ddd;
        display: flex;
      }
      .cancel {
        display: flex;
        flex: 1;
        justify-content: flex-end;
      }
    </style>
    <div class="header">
      Diff View Preferences
    </div>
    <div class="mainContainer">
      <div class="pref">
        <label for="contextSelect">Context</label>
        <select id="contextSelect" on-change="_handleContextSelectChange">
          <option value="3">3 lines</option>
          <option value="10">10 lines</option>
          <option value="25">25 lines</option>
          <option value="50">50 lines</option>
          <option value="75">75 lines</option>
          <option value="100">100 lines</option>
          <option value="-1">Whole file</option>
        </select>
      </div>
      <div class="pref">
        <label for="columnsInput">Columns</label>
        <input is="iron-input" type="number" id="columnsInput"
            prevent-invalid-input
            allowed-pattern="[0-9]"
            bind-value="{{prefs.line_length}}">
      </div>
      <div class="pref">
        <label for="tabSizeInput">Tab width</label>
        <input is="iron-input" type="number" id="tabSizeInput"
            prevent-invalid-input
            allowed-pattern="[0-9]"
            bind-value="{{prefs.tab_size}}">
      </div>
      <div class="pref">
        <label for="showTabsInput">Show tabs</label>
        <input is="iron-input" type="checkbox" id="showTabsInput"
            on-tap="_handleShowTabsTap">
      </div>
    </div>
    <div class="actions">
      <button class="primary" on-tap="_handleSave">Save</button>
      <div class="cancel">
        <button on-tap="_handleCancel">Cancel</button>
      </div>
    </div>
  </template>
  <script>
  (function() {
    'use strict';

    Polymer({
      is: 'gr-diff-preferences',

      /**
       * Fired when the user presses the save button.
       *
       * @event save
       */

      /**
       * Fired when the user presses the cancel button.
       *
       * @event cancel
       */

      properties: {
        prefs: {
          type: Object,
          notify: true,
          value: function() { return {}; },
        },
        disabled: {
          type: Boolean,
          value: false,
          reflectToAttribute: true,
        },
      },

      observers: [ '_prefsChanged(prefs.*)' ],

      _prefsChanged: function(changeRecord) {
        var prefs = changeRecord.base;
        this.$.contextSelect.value = prefs.context;
        this.$.showTabsInput.checked = prefs.show_tabs;
      },

      _handleContextSelectChange: function(e) {
        var selectEl = Polymer.dom(e).rootTarget;
        this.set('prefs.context', parseInt(selectEl.value, 10));
      },

      _handleShowTabsTap: function(e) {
        this.set('prefs.show_tabs', Polymer.dom(e).rootTarget.checked);
      },

      _handleSave: function() {
        this.fire('save', null, {bubble: false});
      },

      _handleCancel: function() {
        this.fire('cancel', null, {bubble: false});
      },
    });
  })();
  </script>
</dom-module>
