[ADD] pad: new etherpad plugin to remove autofocus

In the form views where the pads are used, Etherpad-lite automatically
focus on the pad content, even if the user has already started to type
into another field.

This behavior is quite annoying for "quick changes", so we provide a
(very tiny) plugin for Etherpad-lite that will prevent this autofocus.

Detailed installation instructions are also included.
This commit is contained in:
Hitesh Trivedi
2014-12-05 14:45:06 +01:00
committed by Richard Mathot
parent 1c834d009f
commit f570ea1e3e
4 changed files with 61 additions and 0 deletions
@@ -0,0 +1,28 @@
Readme
======
`ep_disable_init_focus` is a very simple
[Etherpad-lite](https://github.com/ether/etherpad-lite) plugin, which disable
the focus on the pad content after its loading.
Rationale
---------
Etherpad-lite autofocus can be annoying to end-users when it is used in Odoo's
"pad" widget, because it will override web client focus rules. This plugin is
design to get rid of this behavior.
Installation instructions
-------------------------
1. Stop your Etherpad-lite server.
2. Copy the `ep_disabl_init_focus` folder into the `node_modules` folder of
your Etherpad-lite installation.
3. in the folder of your Etherpad-lite installation, run this command to
install the plugin:
```sh
npm install node_modules/ep_disable_init_focus/
```
4. Restart the Etherpad-lite server.
@@ -0,0 +1,10 @@
{
"parts":[
{
"name":"ep_disable_init_focus",
"client_hooks":{
"aceEditEvent":"ep_disable_init_focus/static/js/disable_init_focus"
}
}
]
}
@@ -0,0 +1,15 @@
{
"name":"ep_disable_init_focus",
"version":"0.0.1",
"description":"Disables init focus in etherpad-lite.",
"dependencies":{
},
"engines":{
"node":"*"
},
"author":{
"name":"Odoo S.A. - Hitesh Trivedi",
"email":"thiteshm155@gmail.com"
}
}
@@ -0,0 +1,8 @@
exports.aceEditEvent = function(hook, call, editorInfo, rep, documentAttributeManager){
call.editorInfo.ace_focus = focus;
function focus(){
// Simple hook to disable the focus on the pad
}
};