Commit Graph

5958 Commits (3ddce87ee4ebaf1bc0cf81eb69bd89712d03d2e3)

Author SHA1 Message Date
translatewiki.net 20be994d9b Localisation updates from https://translatewiki.net. 2018-10-18 08:18:00 +02:00
muxator 9774518525 dependencies: update graceful-fs, 4.1.3 -> 4.1.11 2018-10-17 00:37:35 +02:00
muxator e68edcd23d dependencies: update cookie-parser, 1.3.4 -> 1.4.3 2018-10-17 00:34:28 +02:00
muxator f67fc3ad38 dependencies: update ejs, 2.5.7 -> 2.6.1 2018-10-17 00:31:55 +02:00
muxator a585487802 dependencies: update semver, 5.1.0 -> 5.6.0 2018-10-17 00:28:21 +02:00
muxator 50b245d260 dependencies: update request, 2.83.0 -> 2.88.0 2018-10-17 00:27:51 +02:00
muxator c69c0053b6 dependencies: update npm, 6.4.0 -> 6.4.1 2018-10-17 00:27:25 +02:00
muxator 5734eea10b dependencies: update express, 4.16.3 -> 4.16.4 2018-10-17 00:26:51 +02:00
translatewiki.net 4f756d3953 Localisation updates from https://translatewiki.net. 2018-10-15 09:25:07 +02:00
muxator 9aaa02ec70 installDeps: no need to download jquery at starting time. Remove curl dependency
In installDeps.sh we have a bunch of code (from 2011) that checks for the
existence of jQuery and eventually downloads it, but since 1239ce7f28 (year
2012) jquery is vendorized in /src/static/js/jquery.js.

Also, stop mentioning curl as a dependency in the README.md

Fixes #3494
2018-10-07 18:56:28 +02:00
translatewiki.net 4121add1b8 Localisation updates from https://translatewiki.net. 2018-10-03 22:03:52 +02:00
muxator 23eab79946 pad.html: for each client plugin, add a class to #editorcontainerbox
This commit implements the following behaviour:

1. adds a function clientPluginNames() to hooks.js (mimicking what is done in
   static.js), which returns an array containing the list of currently installed
   client side plugins. The array is eventually empty.

2. calls that function in pad.html at rendering time (thus server-side) to
   populate a class attribute.

Example results:
- with no client-side plugins installed:
  <div id="editorcontainerbox" class="">

- with some client-side plugins installed:
  <div id="editorcontainerbox" class="ep_author_neat ep_adminpads">

Looking at the existing code (src/node/hooks/express/static.js#L39-L57), a
client-side plugin is defined as a plugin that implements at least a client side
hook.

NOTE: there is currently no support for notifying plugin removal/installation
      to the connected clients: for now, in order to get an updated class list,
      the clients will have to refresh the page.

Fixes #3488
2018-10-02 21:22:13 +02:00
translatewiki.net 2a5e87cc7d Localisation updates from https://translatewiki.net. 2018-09-20 11:05:16 +02:00
translatewiki.net 051a8765e4 Localisation updates from https://translatewiki.net. 2018-09-13 10:54:15 +02:00
translatewiki.net 1fce593779 Localisation updates from https://translatewiki.net. 2018-09-06 21:23:58 +02:00
translatewiki.net 4a514706cb Localisation updates from https://translatewiki.net. 2018-09-03 08:10:53 +02:00
Luiza Pagliari 8b7f7d49c0 tests: make sure author is switched on authorship test
Original implementation of authorship test assumed a simple pad reload
would switch the author -- and it actually did on Chrome. But other
browsers might keep the author id on cookie.

To force the author switch, expire the cookie before reloading the pad.

Fixes: #3435
2018-09-02 13:10:27 +02:00
muxator c09e638fc3 installDeps.sh: don't nuke all installed plugins on update
This is a modification of PR #3474 by rohieb <rohieb@rohieb.name>.

When this script is run after an update, and something fails during the npm
run, the installed plugins were deleted, too.

In this version what gets deleted is only the directory that contains the
direct dependencies of the core Etherpad, ie:
  node_modules/ep_etherpad-lite/node_modules
2018-08-29 21:45:33 +02:00
muxator 727fbc2669
Merge pull request #3478 from muxator/flatten-code
This series is an attempt to reduce the control structure depth of the code
base, maintaining at the same time its exact same behaviour, bugs included. It
is, in a sense, an initial attempt at a refactoring in the spirit of its
original definition [0].

The idea beyond this refactoring is that reducing the code depth and, sometimes,
inverting some conditions, bugs and logic errors may become easier to spot, and
the code easier to read.

When looked at while ignoring white space changes, all of these diffs should
appear trivial.

[0] https://refactoring.com/
2018-08-29 21:24:26 +02:00
muxator 1a93ab4eb5 db/Pad: reversed truthy condition to make core logic evident
Since the original comparison compared for truthy and not for "===", and it's
3 AM now, I blindly negated it, in order to show how fragile it was in the first
instance.

No functional changes.

This is the final commit of this refactoring series.
2018-08-29 03:03:34 +02:00
muxator 69e1bf28aa db/Pad: reversed condition to make core logic evident. No functional changes
Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
2018-08-29 02:52:26 +02:00
muxator d931a700b4 db/Pad: reversed condition to make error handling evident. No functional changes
Here it was legal to replace a lax comparison with a strict one, since we are
using indexOf(), whose return value is known.
2018-08-29 02:49:40 +02:00
muxator 0e8789863c db/Pad: removed unuseful else clause, no functional changes 2018-08-29 02:46:08 +02:00
muxator 049f5f2859 db/Pad: removed unuseful else clause, no functional changes 2018-08-29 02:44:51 +02:00
muxator e90487c3e2 db/GroupManager: early return, no functional changes 2018-08-29 02:42:29 +02:00
muxator a1d21c0cd2 db/GroupManager: early return, no functional changes 2018-08-29 02:41:53 +02:00
muxator 9ed7608421 db/GroupManager: early return, no functional changes 2018-08-29 02:41:14 +02:00
muxator da8faa1aa9 db/GroupManager: early return, no functional changes 2018-08-29 02:40:14 +02:00
muxator f7254a47ea db/GroupManager: early return, no functional changes 2018-08-29 02:39:05 +02:00
muxator 604952bc97 db/GroupManager: fix indentation
This is to make easier on the eye the next change.
2018-08-29 02:38:09 +02:00
muxator c85bcf0614 db/GroupManager: move inner function on top. No functional change
This is to make easier on the eye the next change.
2018-08-29 02:36:25 +02:00
muxator 6af419a88e SecurityManager.js: early return, no functional changes 2018-08-29 02:33:29 +02:00
muxator 61823e7689 db/AuthorManager: early return, no functional changes 2018-08-29 02:28:40 +02:00
muxator 2b8646a855 db/AuthorManager: early return, no functional changes 2018-08-29 02:28:35 +02:00
muxator b59818676e db/API.js: early return to make error handling evident. No functional changes 2018-08-29 02:18:32 +02:00
muxator 67ce19eddb db/API.js: removed unuseful else clause, no functional changes 2018-08-29 02:16:24 +02:00
muxator 610a6db8c8 db/API.js: early return, no functional changes 2018-08-29 02:13:06 +02:00
muxator fef57efd46 db/API.js: early return, no functional changes 2018-08-29 02:10:45 +02:00
muxator 42bc0a59e1 db/API.js: early return, no functional changes 2018-08-29 02:09:33 +02:00
muxator 05a33f1533 db/API.js, SessionManager: lot of copied & pasted code in integer parsing
Replaced with an early return, no functional changes.
2018-08-29 02:08:05 +02:00
muxator 1d45a63864 db/API.js: early return, no functional changes 2018-08-29 01:57:00 +02:00
muxator 30d814d8ed db/API.js: early return, no functional changes 2018-08-29 01:57:28 +02:00
muxator 4728736dd8 db/PadManager: early return, no functional changes 2018-08-29 01:47:38 +02:00
muxator ecb0c41d29 db/PadManager: early return, no functional changes 2018-08-29 01:46:18 +02:00
muxator 12f224ae72 db/PadManager: early return, no functional changes 2018-08-29 01:44:13 +02:00
muxator 391bd79e03 padurlsanitize: early return, no functional changes 2018-08-29 01:38:55 +02:00
muxator d19436d044 adminsettings: early return, no functional changes. 2018-08-29 01:34:45 +02:00
muxator b60c0b122c PadMessageHandler: reversed condition to make core logic evident. No behavioural changes.
This one replaces a big "if (message)" negating its truthy condition.

Being lame, I erred on the safe side and wrote a super ugly statement that is
guaranteed to respect the original logic.

In the hope that eventual logic errors become more evident now.

See: https://stackoverflow.com/questions/36661748/what-is-the-exact-negation-of-ifvariable-in-javascript#36661843
2018-08-29 01:23:38 +02:00
muxator 324929ca2d PadMessageHandler: early return to reduce code depth.
Get rid of an else branch to simplify code layout. No functional changes at all.

==============

This series is an attempt to reduce the control structure depth of the code
base, maintaining at the same time its exact same behaviour, bugs included. It
is, in a sense, an initial attempt at a refactoring in the spirit of its
original definition [0].

The idea beyond this refactoring is that reducing the code depth and, sometimes,
inverting some conditions, bugs and logic errors may become easier to spot, and
the code easier to read.

When looked at ignoring whitespace changes, all of these diffs should appear
trivial.

[0] https://refactoring.com/
2018-08-29 00:57:28 +02:00
anoy 07bc163cb6 url encode pad name 2018-08-27 14:15:50 +02:00