johndoh/swipe 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

johndoh/swipe

Composer 安装命令:

composer require johndoh/swipe

包简介

Adds swipe actions to the message list of Roundcube

关键字:

README 文档

README

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

  • Install via Composer by adding johndoh/swipe to your composer.json file or running composer require johndoh/swipe
    or
  • Place this plugin folder into plugins directory of Roundcube
  • Add swipe to $config['plugins'] in your Roundcube config

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

Supported skins

  • Elastic

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:

  • archive - Archive the message (Requires the Roundcube Archive plugin)
  • delete - Delete the message
  • forward - Forward the message
  • markasjunk - Mark the message as junk (Requires the Roundcube Markasjunk plugin)
  • move - Move the message to a chosen folder
  • reply - Reply to the message
  • reply-all - Reply all to the message
  • swipe-flagged - Mark the message as flagged/unflagged
  • swipe-read - Mark the message as read/unread
  • swipe-select - Select/deselect the message
  • none - Swipe disabled

The following actions are available for down swipe:

  • checkmail - Check for new messages in the current folder
  • none - Swipe disabled

Contacts 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 contact
  • delete - Delete the contact
  • swipe-select - Select/deselect the contact
  • none - Swipe disabled

The following actions are available for down swipe:

  • none - Swipe disabled

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:

  • swipe_actions - Prevent overriding all swipe config
  • swipe_actions.list - e.g. swipe_actions.mesasgelist Prevent overriding of the swipe actions on a specific list, e.g. mesasgelist
  • swipe_actions.list.direction - e.g. swipe_actions.mesasgelist.left Prevent overriding of the swipe actions on a specific list and direction

Interaction with other plugins

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

  • list_type - the name of list the swipe actions are being performed on, e.g. messagelist, used when selecting/saving config
  • actions - an array of actions for this list in the format:
$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:

  • list_type
  • actions

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.

johndoh/swipe 适用场景与选型建议

johndoh/swipe 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 5.45k 次下载、GitHub Stars 达 11, 最近一次更新时间为 2020 年 04 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「swipe」 「gesture」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 johndoh/swipe 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 johndoh/swipe 我们能提供哪些服务?
定制开发 / 二次开发

基于 johndoh/swipe 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 5.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 21
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 5
  • Forks: 6
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2020-04-11