Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright (C) 2017 The Android Open Source Project |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | --> |
| 16 | |
| 17 | <link rel="import" href="../../../bower_components/polymer/polymer.html"> |
| 18 | |
| 19 | <link rel="import" href="../../../behaviors/gr-patch-set-behavior/gr-patch-set-behavior.html"> |
| 20 | <link rel="import" href="../../../behaviors/gr-path-list-behavior/gr-path-list-behavior.html"> |
| 21 | <link rel="import" href="../../../behaviors/keyboard-shortcut-behavior/keyboard-shortcut-behavior.html"> |
| 22 | <link rel="import" href="../../core/gr-navigation/gr-navigation.html"> |
Kasper Nilsson | caf31c1 | 2017-10-25 15:18:09 -0700 | [diff] [blame] | 23 | <link rel="import" href="../../plugins/gr-endpoint-decorator/gr-endpoint-decorator.html"> |
| 24 | <link rel="import" href="../../plugins/gr-endpoint-param/gr-endpoint-param.html"> |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 25 | <link rel="import" href="../../shared/gr-button/gr-button.html"> |
| 26 | <link rel="import" href="../../shared/gr-editable-label/gr-editable-label.html"> |
| 27 | <link rel="import" href="../../shared/gr-fixed-panel/gr-fixed-panel.html"> |
| 28 | <link rel="import" href="../../shared/gr-rest-api-interface/gr-rest-api-interface.html"> |
Kasper Nilsson | 8819114 | 2017-12-19 14:54:15 -0800 | [diff] [blame] | 29 | <link rel="import" href="../gr-default-editor/gr-default-editor.html"> |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 30 | <link rel="import" href="../../../styles/shared-styles.html"> |
| 31 | |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 32 | <dom-module id="gr-editor-view"> |
| 33 | <template> |
| 34 | <style include="shared-styles"> |
| 35 | :host { |
| 36 | background-color: var(--view-background-color); |
| 37 | } |
| 38 | gr-fixed-panel { |
| 39 | background-color: #fff; |
| 40 | border-bottom: 1px #eee solid; |
Kasper Nilsson | ea00f8c | 2018-01-03 10:25:44 -0800 | [diff] [blame] | 41 | z-index: 1; |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 42 | } |
| 43 | header, |
| 44 | .subHeader { |
| 45 | align-items: center; |
| 46 | display: flex; |
| 47 | justify-content: space-between; |
| 48 | padding: .75em var(--default-horizontal-margin); |
| 49 | } |
| 50 | header gr-editable-label { |
Becky Siegel | e64a1c9 | 2018-01-26 14:43:46 -0800 | [diff] [blame] | 51 | font-size: 1.2rem; |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 52 | font-weight: bold; |
| 53 | } |
| 54 | .textareaWrapper { |
Kasper Nilsson | 6cf8997 | 2018-01-30 17:23:54 -0800 | [diff] [blame^] | 55 | border: 1px solid #ddd; |
| 56 | border-radius: 3px; |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 57 | margin: var(--default-horizontal-margin); |
| 58 | } |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 59 | .textareaWrapper .editButtons { |
| 60 | display: none; |
| 61 | } |
| 62 | .rightControls { |
Kasper Nilsson | 6cf8997 | 2018-01-30 17:23:54 -0800 | [diff] [blame^] | 63 | justify-content: flex-end; |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 64 | } |
| 65 | </style> |
Kasper Nilsson | eff3226 | 2018-01-03 11:24:11 -0800 | [diff] [blame] | 66 | <gr-fixed-panel keep-on-scroll> |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 67 | <header> |
| 68 | <gr-editable-label |
| 69 | label-text="File path" |
| 70 | value="[[_path]]" |
| 71 | placeholder="File path..." |
| 72 | on-changed="_handlePathChanged"></gr-editable-label> |
| 73 | <span class="rightControls"> |
| 74 | <gr-button |
Kasper Nilsson | 5c6a5cd | 2018-01-18 16:41:59 -0800 | [diff] [blame] | 75 | id="close" |
| 76 | link |
| 77 | on-tap="_handleCloseTap">Close</gr-button> |
| 78 | <gr-button |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 79 | id="save" |
| 80 | disabled$="[[_saveDisabled]]" |
| 81 | primary |
Kasper Nilsson | 5c6a5cd | 2018-01-18 16:41:59 -0800 | [diff] [blame] | 82 | link |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 83 | on-tap="_saveEdit">Save</gr-button> |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 84 | </span> |
| 85 | </header> |
| 86 | </gr-fixed-panel> |
| 87 | <div class="textareaWrapper"> |
Kasper Nilsson | 6c39ab9 | 2017-12-14 15:41:00 -0800 | [diff] [blame] | 88 | <gr-endpoint-decorator id="editorEndpoint" name="editor"> |
Kasper Nilsson | bb7ae96 | 2017-12-12 15:05:22 -0800 | [diff] [blame] | 89 | <gr-endpoint-param name="fileContent" value="[[_newContent]]"></gr-endpoint-param> |
| 90 | <gr-endpoint-param name="prefs" value="[[_prefs]]"></gr-endpoint-param> |
| 91 | <gr-endpoint-param name="fileType" value="[[_type]]"></gr-endpoint-param> |
Kasper Nilsson | 8819114 | 2017-12-19 14:54:15 -0800 | [diff] [blame] | 92 | <gr-default-editor id="file" file-content="[[_newContent]]"></gr-default-editor> |
Kasper Nilsson | caf31c1 | 2017-10-25 15:18:09 -0700 | [diff] [blame] | 93 | </gr-endpoint-decorator> |
Kasper Nilsson | 84e63a9 | 2017-09-12 14:15:44 -0700 | [diff] [blame] | 94 | </div> |
| 95 | <gr-rest-api-interface id="restAPI"></gr-rest-api-interface> |
| 96 | </template> |
| 97 | <script src="gr-editor-view.js"></script> |
| 98 | </dom-module> |