Commit Graph

1219 Commits

Author SHA1 Message Date
muxator 312c72c364 formatting: bulk remove trailing whitespaces
Do not touch vendorized files (e.g. libraries that were imported from external
projects).

No functional changes.

Command:
    find . -name '*.<EXTENSION>' -type f -print0 | xargs -0 sed -i 's/[[:space:]]*$//'
2019-10-20 02:09:22 +02:00
muxator 24abd9ca07 formatting: dos2unix on admin.css
In preparation for next commit. I was not able to find other non-vendorized
files that were in DOS format and legitimately needed to be converted.

No functional changes.
2019-10-20 02:50:01 +02:00
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
cupcakearmy d88726b58d colibris: the "ok" button was misaligned in Chrome
When visiting Etherpad's home page with Chrome the "ok" button was not on the
same line as the pad name text box. On Firefox & Safari there was no problem.
Tested on Chrome 74.

Fixes #3604.
2019-05-10 09:50:25 +02:00
Tristram Gräbener 357780d573 Display the version in the web interface
In the settings drop-down this adds an “About” section that also shows
the commit if "exposeVersion" is set to true.

Fixes #2968
2019-04-15 23:17:34 +00: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 9848a600e3 colibris: Fixes #3548 #3549 chat improvements 2019-02-22 19:48:46 +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 fc629e49d9 skins:colibris fixes #3514 hide sidediv and "show line number" option on mobile 2018-11-28 15:01:12 +01:00
Sebastian Castro 2ce195747b skins: Fixes #3510 show/hide line numbers 2018-11-15 11:34:32 +01:00
Sebastian Castro 4c7ae65ac4 colibris: use a darker default font and do not use OpenDyslexic 2018-11-08 21:56:41 +01:00
Sebastian Castro 385ca8771b colibris: various improvements, including author_hover, cursortrace plugins 2018-11-08 21:56:40 +01:00
Sebastian Castro 39ad22f78f colibris: style timeslider page 2018-11-08 21:56:39 +01:00
Sebastian Castro 8343afde84 colibris: move ep_embedded_hyperlinks style to plugin itself 2018-11-08 21:56:38 +01:00
Sebastian Castro 948e9e4e10 colibris: responsive layout depending on plugins activated 2018-11-08 21:56:30 +01:00
Sebastian Castro 413f46b085 colibris: minor improvements 2018-11-08 21:56:29 +01:00
Sebastian Castro e8c229cc65 colibris: add style for ep_embedded_hyperlink plugin 2018-11-08 21:56:29 +01:00
Sebastian Castro 9205b551df colibris: fix plugin ep_comments style 2018-11-08 21:56:28 +01:00
Sebastian Castro af641c3b3d colibris: minor improvements 2018-11-08 21:56:27 +01:00
Sebastian Castro 8881a2a61f colibris: style plugin ep_tables2 2018-11-08 21:56:26 +01:00
Sebastian Castro 24b46984d4 colibris: Style ep_set_title_on_pad 2018-11-08 21:56:18 +01:00
Sebastian Castro dad6c217ef colibris: improvements 2018-11-08 21:56:17 +01:00
Sebastian Castro 3f761121b2 colibris: improve colibris responsive 2018-11-08 21:56:15 +01:00
Sebastian Castro 6cc499bcce colibris: add new skin, initial commit
Needs further development: responsive, plugins, configuration...
2018-11-08 21:56:14 +01:00
Sebastian Castro d3d1fd21bb fonts: add pencil, link and table icon
Preparatory work for introducing colibris skin
2018-11-08 21:56:13 +01:00
Sebastian Castro e80f9a6f59 pad.css: group togheter three very similar rules.
a) these rules:
  [class^="icon-"]:before
  [class*=" icon-"]:before

b) were the same as this one:
  [data-icon]:before

except the rules in b) had a "content: attr(data-icon)" rule, too.

This commit groups all of them together, and gets rid of the "attr(data-icon)".

The commit that introduced these rules in the first place, and that are now
partially reverted, was 9aea689438 (move tiny bit
of font awesome we actually use into pad.css) from 2014-11-19.

Preparatory work for introducing colibris skin
2018-11-08 21:56:11 +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 aba1c6f8bd skins: moved "static/custom" -> "static/skins/no-skin"
The old empty skin created by the startup scripts becomes the default: no-skin.
2018-08-26 21:17:04 +02:00
muxator 0c518cadf5 skins: replace {js,css}.template with actual files. Simplify startup scripts.
Currently, an Etherpad skin requires the existence of 6 files:
- index.{css,js}
- pad.{css,js}
- timeslider.{css,js}

In the default empty skin (in static/custom), there were 2 small placeholders
({js,css}.template) to be copied in place by the startup script in case no skin
was in use.

Now that we are moving to multiple directories (see #3471) we can simply commit
the example files and remove the copying code from the startup script.
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