This plugin adds left/right/down swipe actions to entries in the the message list on touch devices (tables/phones).
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.
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.
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.
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.
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.
Mesasge List: The following actions are available for left/right swipe:
archive
- Archive the message (Requires the Roundcube Archive plugin)delete
- Delete the messageforward
- Forward the messagemarkasjunk
- Mark the message as junk (Requires the Roundcube Markasjunk plugin)move
- Move the message to a chosen folderreply
- Reply to the messagereply-all
- Reply all to the messageswipe-flagged
- Mark the message as flagged/unflaggedswipe-read
- Mark the message as read/unreadswipe-select
- Select/deselect the messagenone
- Swipe disabledThe following actions are available for down swipe:
checkmail
- Check for new messages in the current foldernone
- Swipe disabledContacts List: The following actions are available for left/right swipe:
vcard_attachments
- Attach the contact to a new message as a vCard (Requires the Roundcube Vcard_attachments plugin)compose
- Compose a new message to this contactdelete
- Delete the contactswipe-select
- Select/deselect the contactnone
- Swipe disabledThe following actions are available for down swipe:
none
- Swipe disabledThis 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:
swipe_actions
- Prevent overriding all swipe configswipe_actions.list
- e.g. swipe_actions.mesasgelist
Prevent overriding of the swipe actions on a specific list, e.g. mesasgelistswipe_actions.list.direction
- e.g. swipe_actions.mesasgelist.left
Prevent overriding of the swipe actions on a specific list and directionThe swipe_actions
hook is triggered when the plugin starts up
on the list options menu.
Arguments:
$args['actions'] = [
'list_name' => '*JS list object name*',
'selection_id' => '*JS element identifier e.g. UID*',
'vertical' => [
'*action_name*' => ['label' => '*display name*'],
...
],
'horizontal' => [
'*action_name*' => ['label' => '*display name*'],
...
]
];
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.
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.