johndoh / roundcube-swipe

Adds swipe actions to the message list of Roundcube
https://plugins.roundcube.net/#/packages/johndoh/swipe
11 stars 5 forks source link

Roundcube Webmail Swipe

This plugin adds left/right/down swipe actions to entries in the the message list on touch devices (tables/phones).

ATTENTION

This is just a snapshot from the GIT repository and is NOT A STABLE version of Swipe. It is Intended for use with the GIT-master version of Roundcube and it may not be compatible with older versions. Stable versions of Swipe are available from the Roundcube plugin repository (for 1.4 and above) or the releases section of the GitHub repository.

License

This plugin is released under the GNU General Public License Version 3+.

Even if skins might contain some programming work, they are not considered as a linked part of the plugin and therefore skins DO NOT fall under the provisions of the GPL license. See the README file located in the core skins folder for details on the skin license.

Install

NB: When downloading the plugin from GitHub you will need to create a directory called skin and place the files in there, ignoring the root directory in the downloaded archive.

Supported skins

Supported browsers

This plugin relies on Pointer Events and should work in any browser which supports these. Vertical swipe actions require touch-action: pan-down; support. There is no support for Legacy Edge or Internet Explorer.

Configuration

To set the default actions add the following to your Roundcube config file:

$config['swipe_actions'] = [
  'messagelist' => [
    'left' => '<action>',
    'right' => '<action>',
    'down' => '<action>'
  ],
  'contactlist' => [
    'left' => '<action>',
    'right' => '<action>',
    'down' => 'none'
  ]
];

Replace <action> with your desired action from the list below. Users can configure the actions, overriding the defaults, from the List Options menu.

Supported actions

Mesasge List: The following actions are available for left/right swipe:

The following actions are available for down swipe:

Contacts List: The following actions are available for left/right swipe:

The following actions are available for down swipe:

disabled_actions and dont_override

This plugin respects the disabled_actions config option for Roundcube commands. To prevent users from overriding swipe config you can add any of the following to dont_override:

Interaction with other plugins

The swipe_actions hook is triggered when the plugin starts up on the list options menu. Arguments:

Return values:

The swipe-action JS event is triggered when a swipe action is performed. Return false to abort the action or return a JSON object like this to assign an action:

{
  'class': '<class name for the action box>',
  'text': '<text displayed in the action box>',
  'callback': function(p) { <your action here> },
  'command': '<roundcube command>'
};

Note: Only 1 of callback and command need to be supplied. If no callback is defined then the command is passed to the standard Swipe callback function.

Customizing the Elastic skin

The colors and styles used by this plugin can be overridden by adding a _custom.less file to the skins/elastic sub-folder of this plugin and then recompiling the CSS.