Commit graph

1021 commits

Author SHA1 Message Date
muxator
5eb60cef01 jQuery: update vendored version (1.9.1 -> 1.12.4)
The vendored jquery version was 1.9.1 from 2013-02-04. Let's replace it with the
most recent one from the 1.x branch (1.12.4 from 2016-05-20).

The modification in rjquery.js is needed because recent jQuery versions changed
their behaviour, and do not set themselves on the global window object.
See: https://github.com/parcel-bundler/parcel/issues/333#issuecomment-357882648

This will be the lastest jQuery 1.x version ever, because 1.x branch is
definitively EOLed (see https://github.com/jquery/jquery.com/issues/162).

This is a stopgap measure to get the latest security fixes. Going forward,
another strategy will be needed.

Closes #3640
2019-09-16 22:55:53 +02:00
Tristram Gräbener
8453f07205 Chat bubble: by default hide in CSS
The current behaviour is to show the chat bubble and hide if chat is
disabled.

Because of this, the bubble appears wrongfully for a short time.

With this PR, by default it is hidden and displayed only if chat is
enabled.

Fixes: #3088
2019-04-15 23:14:47 +00:00
muxator
dc7e49f89d Remove trailing whitespaces
Hoping to minimize future diffs. Not touching vendorized libraries.
2019-04-16 00:34:29 +02:00
Ray Bellis
0c2d662541 plugins download and search: converted to Promises
Also fixed a bug where the system would make a request to the central server for
the plugin list for every search even if the list was already cached.
2019-01-23 12:24:53 +00:00
Ray Bellis
a579dfc285 pluginfw/installer.js: use Promise version of hooks.aCallAll() in install(), uninstall()
We cannot use arrow functions in this file, because code in /src/static can end
up being loaded in browsers, and we still support IE11.
2019-01-18 16:10:48 +00:00
Ray Bellis
80b3019154 pluginfw/plugins.js: converted to Promise API 2019-01-18 13:52:37 +00:00
Ray Bellis
8d85ae582e pluginfw/hooks.js: allow returning a Promise in aCallFirst(), aCallAll()
Since this code can end up loaded in browsers when using client side plugins,
avoid use of ES6 syntax features such as arrow functions until MSIE support is
finally dropped.
2019-01-18 13:49:17 +00:00
muxator
9497ee734f prepare to async: trivial reformatting
This change is only cosmetic. Its aim is do make it easier to understand the
async changes that are going to be merged later on. It was extracted from the
original work from Ray Bellis.

To verify that nothing has changed, you can run the following command on each
file touched by this commit:
  npm install uglify-es
  diff --unified <(uglify-js --beautify bracketize <BEFORE.js>) <(uglify-js --beautify bracketize <AFTER.js>)



This is a complete script that does the same automatically (works from a
mercurial clone):

```bash
#!/usr/bin/env bash

set -eu

REVISION=<THIS_REVISION>

PARENT_REV=$(hg identify --rev "${REVISION}" --template '{p1rev}')
FILE_LIST=$(hg status --no-status --change ${REVISION})
UGLIFYJS="node_modules/uglify-es/bin/uglifyjs"

for FILE_NAME in ${FILE_LIST[@]}; do
  echo "Checking ${FILE_NAME}"
  diff --unified \
    <("${UGLIFYJS}" --beautify bracketize <(hg cat --rev "${PARENT_REV}" "${FILE_NAME}")) \
    <("${UGLIFYJS}" --beautify bracketize <(hg cat --rev "${REVISION}"   "${FILE_NAME}"))
done
```
2019-02-08 23:20:57 +01:00
muxator
b34fc2de2b use Date.now() instead of new Date().getTime()
This is documented to be more performant.

The substitution was made on frontend code, too (i.e., the one in /static),
because Date.now() is supported since IE 9, and we are life supporting only
IE 11.

Commands:
  find . -name *.js | xargs sed --in-place "s/new Date().getTime()/Date.now()/g"
  find . -name *.js | xargs sed --in-place "s/(new Date()).getTime()/Date.now()/g"

Not done on jQuery.
2019-02-26 23:25:15 +01:00
Sebastian Castro
378dbe8485 skins: Improve clientPluginNames class helper
Moving classes to html tag so it can be used to style other part of template depending on plugins like #users, #chat etc...
Rename plugin class with "plugin-" prefix, because there were conflicts with some plugins using the same .ep_font_color class to apply css rules
2019-02-22 19:48:46 +01:00
Sebastian Castro
401db8fce3 chat: Adds placeholder to input. Translate stick button 2019-02-22 19:48:08 +01:00
muxator
0ad8291ae7 hooks: restore Internet Explorer 11 compatibility.
Compatibility with IE11 regressed in 23eab79946 while working for #3488.
That commit made use of modern js syntax, not supported by IE11.

- Removed arrow functions, replaced with normal functions.
- Removed the spread operator (<...iterable>) and the "new Set()" construct,
  replaced with _.uniq()

At some point IE11 compatibility will be dropped.
Ditching it now, for such a small gain, is not wise.

Fixes #3500.
2018-11-28 20:03:39 +01:00
Sebastian Castro
2ce195747b skins: Fixes #3510 show/hide line numbers 2018-11-15 11:34:32 +01:00
Sebastian Castro
63ec2d8cc2 font picker: improve the font picker (closes #3451)
Preparatory work for introducing colibris skin
2018-11-08 21:56:10 +01:00
Sebastian Castro
23eb1701ed ace2_inner: fix first line number position
Preparatory work for introducing colibris skin
2018-11-08 21:55:58 +01:00
Sebastian Castro
4115f792e4 ace.js: prioritize the skin style over the plugin style
Preparatory work for introducing colibris skin
2018-11-08 21:55:34 +01:00
Sebastian Castro
8a6eae26d7 ace.js: also add plugins names to #outerdocbody (refs #3488)
This commit is an integration to aa8204e5dfe4
2018-11-08 21:55:07 +01: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
muxator
36f39a6e13 ace.js: remove template literals to keep IE 11 compatibility
Files in "src/static" are executed on the client: do not break browser
compatibility because of syntactic sugar.

Introduced in 9c990ab08a.
2018-08-27 02:18:34 +02:00
muxator
9c990ab08a skins: finalize support for multiple skins
The old "static/custom" directory is replaced by "static/skins/<skinName>",
where <skinName> is taken from settings.json.
When no value is found, a default of "no-skin" is assumed, so that backward
compatibility is maintained.

The most evident security concerns have been addressed.

Closes #3471.
2018-08-26 21:17:04 +02:00
muxator
6c56e7ca7a ace.js: use URL encoding when building an URL via string concatenation
Not performing encoding/decoding when traversing logical domains is a security
risk.
String concatenation is not great, too, but this change is just focused on
allowing the implementation of skin support.
2018-08-26 02:40:36 +02:00
Dan Bornstein
2a876e5e9b Ensure that all lines in the pad are marked with class ace-line.
Without this change, lines that haven't ever been edited will have either
an empty class or, in the case of list start lines, a class that begins
with a space (because the `ace-line` before the space never got added).
2016-09-13 01:17:04 +02:00
Luiza Pagliari
58c3154769
[fix] Ignore default line attribs when detecting edges of changeset (#3420)
When comparing original content with the changes made by the user, we
need to ignore some line attribs that are added by content collector,
otherwise we would consider the change started on the first char of the
line -- the '*' that is added when line has line attribs.

In order to be able to handle both #3354 and #3118, we need to take into
account both the styles attribs (to fix #3354) and the line attribs
defined by any of the plugins (to fix #3118), but we can ignore those
extra line attribs that are added by Etherpad and do not add any
functionality (`'lmkr', 'insertorder', 'start'`).
2018-07-09 17:44:38 -03:00
Mantary
2be873e3c7 Use keydown instead of keypress on Firefox. 2018-07-01 12:05:46 +02:00
anugu-chegg
7b6a4aba30 Remove leftover code from earlier commits 2018-04-19 23:23:16 +02:00
anugu-chegg
b4068144c3 Refactor code 2018-04-19 23:23:16 +02:00
anugu-chegg
461ed413b7 Fix few mistakes 2018-04-19 23:23:16 +02:00
anugu-chegg
d41e184a3c Send commits missed during the reconnect 2018-04-19 23:23:16 +02:00
anugu-chegg
bf05e9ae89 Handle client reconnect properly 2018-04-19 23:23:16 +02:00
anugu-chegg
4265f4175e Handle socketio errors properly 2018-04-19 23:23:16 +02:00
anugu-chegg
fb20c26c5f Don't send COMMIT-MESSAGE when socketio connection is not active 2018-04-19 23:23:16 +02:00
Benjamin Schweizer
d26df86490 made url relative 2018-04-19 22:55:40 +02:00
nashe
92eee85f36 Escape data when listing available plugins 2018-04-09 22:31:13 +02:00
John McLear
6a38826e9d
Merge pull request #3366 from ether/release/1.6.4
Release/1.6.4
2018-04-07 11:05:31 +01:00
John McLear
bb83d39ff0
Merge pull request #3197 from User1m/patch-1
fixed plugin dependency issue
2018-04-03 13:13:11 +01:00
Luc Didry
b0da9a579d Fix numbering line when plugin add padding-top (like ep_page_view) 2018-03-25 19:24:52 +02:00
Robert Helmer
38b1e0a35e better sanitize window location in error messages 2018-01-30 12:51:53 -08:00
Joas Souza
454f539561 Select formatting button on selection (#3301)
[feat] Select button when selection is on formatted text
2018-01-04 12:28:00 -02:00
Joas Souza
f1fcd16894 Add settings to scroll on edition out of viewport (#3282)
* Add scroll when it edits a line out of viewport

By default, when there is an edition of a line, which is out of the
viewport, Etherpad scrolls the minimum necessary to make this line
visible. This makes that the line stays either on the top or the bottom
of the viewport. With this commit, we add a setting to make possible to
scroll to a position x% pixels from the viewport. Besides of that, we
add a setting to make an animation of this scroll.
If nothing is changed on settings.json the Etherpad default behavior is
kept
2018-01-03 19:57:28 -02:00
Luiza Pagliari
0e1414dcca Allow 'placeholder' to be a localizable attribute on HTML elements (#3257) 2017-09-21 17:49:33 -03:00
Luiza Pagliari
ed5213c9a2 Revert "[feat] Update l10n lib (#3248)" (#3249)
This reverts commit 6bcaa00a4b.
2017-08-15 11:09:56 -03:00
Luiza Pagliari
6bcaa00a4b [feat] Update l10n lib (#3248)
Last update was from 2014.

Fix #3244.
2017-08-15 10:22:59 -03:00
Stefan
f6456c0aa7 Merge pull request #3187 from tiblu/ep_prefs_different_cookie_for_different_protocol
#3179 - Using EP on same domain, but over different protocols causes "Warning: it appears that your browser does not have cookies enabled.
2017-07-30 11:49:29 +02:00
Jan Holub
8bd8be97b9 Added support for the Montserrat Font as discussed in #3201 (#3205)
* Added support for the Montserrat Font as discussed in #3201

I chose a thin version of the Font (namely Montserrat Light) as the regular font and Montserrat Regular as the bold version. The thin fonts just look better in my opinion.
2017-07-12 12:21:48 -03:00
Luiza Pagliari
8c57c8d0d6 Merge pull request #3206 from 00SteinsGate00/RobotoMono
Added RobotoMono as a more modern and pretty monospaced font
2017-07-12 08:02:08 -03:00
Jan Holub
7029248a76 Added RobotoMono as a more modern and pretty monospaced font, addressing #3201
I added RobotoMono-Regular and RobotoMono-Bold as TrueTypeFont files and included them into the list. I tred to stay in alphabetical order where possible.

The author of #3201 was asking for a more modern monospaced font.
2017-06-21 23:44:23 +02:00
Claudius Mbemba
8d60bd5234 fixed plugin dependency issue
running ./bin/run.sh after the 1st time caused the following error "TypeError: Cannot read property 'dependencies' of undefined".
fixed it.
2017-05-30 05:36:29 +02:00
Luiza Pagliari
b6cb46271b Merge pull request #3182 from storytouch/fix/do_not_hide_force_reconnect_modal
Improvements on modals and "force reconnect" messages
2017-05-29 11:05:37 -03:00
Luiza Pagliari
894ebffcaf [fix] Do not close ANY "force reconnect" message
Fix previous commit. As "force reconnect" buttons have all the same id
on DOM, on the previous commit we were only disallowing the first button
with that id on DOM -- "userdup" -- to be closed by a click on editor.
Casually the tests were using the same error to simulate a "force
reconnect", so even the tests were not getting the issue.
2017-05-12 07:03:40 -03:00
Luiza Pagliari
0cb8d31e95 [fix] Have one setting for each shortcut to create ordered list
This is an adjustment to #2891.
2017-05-11 14:56:09 -03:00