9 Commits

Author SHA1 Message Date
Wyatt Allen
d970500d62 Annotate trailing whitespace per user preference
Add a simple annotation layer that marks trailing whitespace in diffs
(guarded by the `show_whitespace_errors` diff preference). The newly
supported diff preference is added to both diff preference controls. The
requirement that all annotation layers must implement `addListener` is
relaxed as the trailing whitespace layer is the third layer that doesn't
use it.

Adds tests for the layer and the diff preference.

Feature: Issue 4836
Change-Id: Ifba05216bf0bc3c0a8a094f5ef392b983091d59f
2016-11-20 13:31:30 -08:00
Becky Siegel
e7d19a9976 Add preference for line wrapping in diff preferences
Previously in Polygerrit, diff views were always displayed in the width
specified in diff preferences. This change gives the option to wrap
lines instead, which takes precedence over column width (the column
width option is hidden when line wrapping is selected), and fits the
diff view to screen.

The gerrit API already supports the 'lineWrapping' preference so this
change uses that already existing option.

Feature: Issue 4809
Change-Id: I0d9e292739b5910abfd04af63ec4c745bf06e446
2016-10-31 17:35:21 -07:00
beckysiegel
c47410c816 Focus and tab between diff preferences inputs
Previously, the diff preferences form did not automatically focus to the
first textfield and did not allow tabbing between input fields. This
change adds autofocus when the overlay is opened and allows for tabbing
between the other input fields in the modal.

Bug: Issue 4140
Change-Id: If15812bb4404ca4061597755eeaf68d4cae23b3f
2016-09-20 18:30:29 -07:00
Wyatt Allen
7c66d99a1c Respect the diff preference for syntax highlighting
Adds checkboxes to both diff preferences controls, adds an `enabled`
boolean property to the `gr-syntax-layer` element, and updates all
relevant tests.

Bug: Issue 4297
Change-Id: I10cef760c354c53e03acfb3c84379e82859ef25f
2016-07-27 11:14:54 -07:00
Viktar Donich
60d8bce771 Release range comments
Remove beta diff setting and enable range comments for all.

Change-Id: I0cee7e1717574ab54317cdce9e2332c8cda7a0cb
2016-07-14 14:45:15 -07:00
Viktar Donich
5008b4491f Add a checkbox to hide ranged comments behind
Also adds concept of locally stored preferences.

Change-Id: Ib074a682228d5360a932af696e18967e8e3473be
2016-06-08 15:29:11 -07:00
Andrew Bonventre
1c4369b518 Add diff preferences dialog to gr-new-diff
Change-Id: I3024f46fff0a47e7a4e7a8f5beff9929d8ccb50b
2016-03-24 16:35:07 -04:00
Andrew Bonventre
02f71327cf Add comments/drafts to gr-new-diff
Change-Id: I8110b521ab83a31be5db7e3d65268186485db04d
2016-03-22 11:55:03 -04:00
Andrew Bonventre
78792e8e98 Refactor directory structure of components
There is no change in functionality. Only moving things around.

+ Separate html from the js.
+ Place the unit test for a component within the same folder.
+ Organize the components in subfolders.

Change-Id: I51fdc510db75fc1b33f040ca63decbbdfd4d5513
2016-03-04 18:02:24 -05:00