15 Commits

Author SHA1 Message Date
Kasper Nilsson
264f2f422b ES6ify /scripts/util.js
Bug: Issue 6179
Change-Id: Icc3a146dd50a9444b386212ff994203b2012e27b
2017-05-15 16:53:33 +00:00
Wyatt Allen
3b824c577d Remove unnecessary HTML escaping
Because the `_computeAccountTitle` method was only used in a binding to
an HTML attribute, the manual HTML escaping performed in that method was
in not needed.

Since removing this, the only use-site for the `util.escapeHTML`
function is the `GrDiffBuilder`. To discourage general use of manual
HTML escaping (in favor of default escaping in Polymer bindings) -- as
well as to lighten util.js -- the escapeHTML function is moved into
`GrDiffBuilder`, its regex is made a constant, and is given a unit test.

Change-Id: I28c9f546cf50461e96995ecd6da8653e75554023
2017-01-30 17:28:57 -08:00
Becky Siegel
5c611bf1a0 Fix lint errors
Change-Id: I6d198498a7bd480a2b0081bff20ba89c3941ad48
2016-12-19 17:59:48 -08:00
Becky Siegel
acf455a9b6 Make file list more useful on mobile
Previously, the file path was truncated and often the file name was cut
off completely, which had made it hard to tell what files were actually
changed.  With this change, the text appearing on the file list just
show ellipsis and the file name (ex: '.../filename.txt').

Additionally, for both mobile and larger screens, the full filename
appears (line wrapped if needed) when the file list item is expanded.
This way, if enough content is cut off that it's still not useful, there
is a way to see the path in it's entirety.

Bug: Issue 4609
Change-Id: Ic4aaf45bafbc3c5b31add8f7c43b18c9d2b2913b
2016-12-14 14:46:17 -08:00
Andrew Bonventre
ef01a637a1 Wrap util.js in an IIFE to prevent deploy error
'use strict' can mess up execution of third-party scripts if
they are all concatenated to the same file. To prevent this, code
is wrapped in an immediately-invoked function expression (IIFE).
This ensures that the strict mode is only applied within the scope
of the function it’s wrapped in.

Change-Id: I59e433b419e2e7b85f87cc97d3add577e2c7590e
2016-03-29 21:34:50 -04:00
Andrew Bonventre
d171f07a78 Add backtick to HTML escape code
Internet Explorer treats a backtick (`) as an attribute
delimiter like " and '. Account for this in HTML escape
code.

Change-Id: I48bccc0013829662479ce321a34f5c69e48aca95
2016-02-17 17:13:45 +00:00
Urs Wolfer
26caed7b8d Fix issues detected by 'JSHint' and 'JSCS'
Change-Id: Ia535be02d19f09e716f00ec8819ba785010798f7
2016-02-05 19:43:48 +01:00
Andrew Bonventre
b272b8711e Refactor keyboard shortcut handling into a behavior
Change-Id: I25687959ba7dab846236af28cdb13786e87dc38e
2016-02-01 21:43:27 +00:00
Andrew Bonventre
195eff5911 Fill in getModifierState when it's not defined
CustomEvent fired by the testing framework does not define a
getModifierState function on the event.

Change-Id: Ie490d2505780f241661e2dde36128f4e120cc89f
2016-01-24 23:25:23 -05:00
Andrew Bonventre
570190c16d Suppress keyboard shortcuts if a modifier key is pressed
Change-Id: Ib79b805f400454c1b2f61a1a1ccb9da1b90330f7
2016-01-24 20:51:18 -05:00
Andrew Bonventre
1141b4eef0 Don't use iron-a11y-keys-behavior for keyboard shortcuts
Due to known bugs[1] use the keyCode instead.

[1] https://github.com/PolymerElements/iron-a11y-keys-behavior/issues/27

Change-Id: I61d80d6df5a241968651818324ca266304c9be69
2016-01-11 12:23:44 -05:00
Andrew Bonventre
c3ef3e4dc1 Draft comments initial implementation
This implements basic functionality for draft CRUD operations.

There are a few things that are TBD:
+ Layout edge cases within the diff view.
+ Reply/Done actions in threads.
+ Not allowing the user to add drafts if logged out.
+ I’m sure a few more things...

Feature: Issue 3649
Change-Id: Ia7419eecee5d5b20e73e17241990d7a7ffede0e8
2015-12-09 12:32:37 -05:00
Andrew Bonventre
64c2ff6f2c Suppress keyboard shortcuts while some elements are in focus
Otherwise you could trigger them by typing the appropriate
shortcut while inside the search bar, for example.

Change-Id: I0ebc3f9235814faac19ec364f185386d8e496f04
2015-12-02 18:02:04 -05:00
Andrew Bonventre
ab0f6a82c1 [PolyGerrit] Basic diff view with tests
This covers proper rendering at this point.

Issue 3648
Change-Id: I4c22595ca7ed8f5d98034e68b48942e34b5eb6bb
2015-11-16 14:36:15 -05:00
Andrew Bonventre
ba69835964 Add the skeleton of a new UI based on Polymer, PolyGerrit
This is the beginnings of an experimental new non-GWT web UI developed
using a modern JS web framework, http://www.polymer-project.org/. It
will coexist alongside the GWT UI until it is feature-complete.

The functionality of this change is light years from complete, with
a full laundry list of things that don't work. This change is simply
meant to get the starting work in and continue iteration afterward.

The contents of the polygerrit-ui directory started as the full tree of
https://github.com/andybons/polygerrit at 219f531, plus a few more
local changes since review started. In the future this directory will
be pruned, rearranged, and integrated with the Buck build.

Change-Id: Ifb6f5429e8031ee049225cdafa244ad1c21bf5b5
2015-11-09 22:01:28 +00:00