Commit Graph

32 Commits

Author SHA1 Message Date
Javi Martín
cc7e0d586b Reduce local variables usage in CoffeeScript
Local variables are one of the things CoffeeScript doesn't compile to
modern JavaScript automatically: it uses `var` instead of `const` or
`let`.

Besides, using `$this = $(this)` is usually done to reference the
current object in another function where the current object is a
different one. Here we were using it with no clear purpose.
2019-09-11 03:14:17 +02:00
Javi Martín
86e704d8a4 Use strict mode in JavaScript
Strict mode is supported by 98% of the browsers, including Internet
Explorer 10, and it helps developers avoid common JavaScript pitfalls.
2019-09-11 03:14:17 +02:00
Javi Martín
747767386a Use this instead of @ in CoffeeScript
We're using `this` most of the time, and it's what's used in JavaScript.
2019-09-11 03:14:17 +02:00
Javi Martín
1cc3324468 Use each and forEach instead of for .. in
We're planning to replace CoffeeScript with JavaScript, and CoffeeScript
compiles `for .. in` to complex JavaScript code.
2019-09-11 03:14:16 +02:00
Javi Martín
36a557927a Remove unused variables 2019-09-11 01:56:27 +02:00
Javi Martín
738e9ebc8b Remove code specific to Internet Explorer 8
Internet Explorer 9 was released eight years ago. Besides that, we don't
really support IE8 anyway, since we show a popup to IE8 users saying
we don't support it, we haven't maintained the IE8-specific CSS file for
years, and we don't test our JavaScript against IE8.
2019-09-10 22:43:37 +02:00
Javi Martín
b27855c1cf Use double quotes in CoffeeScript files
As we do in the rest of the application.

Note we cannot add a rule enforcing double quotes because CoffeeScript
Lint does not have such rule.
2019-03-06 11:41:21 +01:00
Javi Martín
9e80c75032 Use string interpolation in CoffeeScript
We use it in Ruby, and it will make it easier to change all quotes to
double quotes in CoffeeScript files.
2019-03-06 11:41:21 +01:00
Javi Martín
d963657e41 Use spaces around curly braces in CoffeeScript
Just like we do in Ruby.
2019-03-05 21:38:36 +01:00
Bertocq
0379a66c77 Remove unnecesary empty parameter list on coffeescript file 2017-06-16 00:06:26 +02:00
Bertocq
8f682901ed Fix Operators must be spaced properly rule on multiple coffeescript files 2017-06-16 00:03:34 +02:00
Amaia Castro
854d51dd8e Calculate annotations weight and add weight css classes for color intensity 2017-03-02 14:25:23 +01:00
Amaia Castro
5f61e9f270 Clear box before showing comments for anchor 2017-02-24 16:31:47 +01:00
Amaia Castro
c7eaadb4b2 Show comment boxes for all annotations at the clicked point 2017-02-24 15:45:36 +01:00
Amaia Castro
8b80efd534 Fix scroll to anchor 2017-02-23 19:05:36 +01:00
Amaia Castro
20bfe5e0e5 Fix annotation highlight on click 2017-02-23 16:04:55 +01:00
Amaia Castro
7061d70f22 Avoid loading annotations twice when creating new one 2017-02-23 16:04:30 +01:00
Fernando Blat
667d86788e Fix annotation highlighting for multimode annotation 2017-02-13 10:12:03 +01:00
Fernando Blat
5cd263b79c In mobile, don't load comments in the sidebar, but use the permalink page 2017-02-06 13:15:37 +01:00
Fernando Blat
ee90bca24d Highlight current annotation 2017-02-06 12:57:30 +01:00
Fernando Blat
3bb77b7536 Only open annotations if the anchor is for an annotation 2017-01-19 11:06:41 +01:00
Amaia Castro
7be2901535 Only highlight text and send request if phase is open 2017-01-17 10:47:33 +01:00
Amaia Castro
65fcd83ee5 Don’t show new annotation/comment form if allegations phase is not open 2017-01-16 19:06:06 +01:00
Fernando Blat
046c021c0c Complete create comment details 2017-01-14 16:43:40 +01:00
Fernando Blat
f47cef5a93 Highlight text when creating a comment 2017-01-14 16:43:26 +01:00
Fernando Blat
17a68f5c14 Load annotations on click event 2017-01-14 16:42:57 +01:00
Fernando Blat
4431d95d31 Basic annotation creation 2017-01-14 16:42:12 +01:00
Amaia Castro
306e3fa59f Don’t show comments panel if seeing final version 2017-01-11 23:11:11 +01:00
Amaia Castro
174fe5ee04 Don’t scroll and show comments when there isn’t an anchor in the url 2017-01-10 18:59:18 +01:00
Amaia Castro
f3daf2aca2 Show comments box when scrolling to annotation 2017-01-10 18:24:55 +01:00
Amaia Castro
4f539b374f View comments for draft text 2017-01-10 17:25:02 +01:00
Amaia Castro
ee9fa3db15 Base Legislation Annotations 2017-01-04 12:56:58 +01:00