定制 malago/flarum-ext-fancybox 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

malago/flarum-ext-fancybox

最新稳定版本:0.3.0

Composer 安装命令:

composer require malago/flarum-ext-fancybox

包简介

Image formatting and lightbox modal using fancyBox (original from the-turk and squeevee).

关键字:

README 文档

README

GPLv3 license Latest Stable Version Total Downloads

Disclaimer: This extension has forked from the-turk/flarum-ext-fancybox

fancyBox

Features

  • Based on fancyBox v3.
  • Clicking on an image in a post launches the fancyBox modal. This allows users to zoom in on the image, pan around, and navigate among multiple images, videos or iframes on the same post as a gallery.
  • Images are displayed with formatting to normalize sizes and layout.
  • If the author of the post has wrapped the image in a link, it will be shown as an external link. (Clicking on the image will not launch the fancyBox modal in this case.)
  • Image or URL titles are considered as captions.

Note: This extension does not generate thumbnails. The storage location of images, and the file size / bandwidth usage are not affected.

Conflictions

  • This package conflicts with squeevee/flarum-ext-fancybox and the-turk/flarum-ext-fancybox, so you need to remove them first.
  • It seems like this package is not compatible with reflar/recache (see #4).

Installation

composer require malago/flarum-ext-fancybox

Updating

composer update malago/flarum-ext-fancybox
php flarum cache:clear

Usage

Enable the extension.

Image layouts

Image layouts can be controlled by the formatting of the post's markup (e.g., its BBCode or Markdown).

An image is "stand-alone" if it is not in a paragraph with any text or other images, i.e., it is separated from text or other images by at least two returns. A stand-alone image is displayed in large format.

Example of a stand-alone image

An image is "inline" if it is in a paragraph with text or other images. An inline image is displayed in small format, in order to fit into the flow of text.

Example of an inline image

(For technical reasons, an image is considered inline if it is separated from text or another image by only one return.)

If you have the flarum/bbcode extension, you can use [img fancy=off][/img] to prevent images from formatting by this extension. This will also exclude them from the fancyBox gallery of the post.

Links

As mentioned under Features, if an image is wrapped in a link, its behavior and appearance are altered. Most notably, in order to preserve the link, clicking on the image opens the link instead of opening the fancyBox modal. Images within links are also not added to the fancyBox gallery for a post.

External linked image

That said, if you have the flarum/bbcode extension, you can use fancy attribute of the URL tag to show videos or iframes on the fancyBox modal. They will be added to the fancyBox gallery of the post.

  • Use [URL fancy=iframe][/URL] for iframes:

    Iframe

  • Use [URL fancy=video][/URL] for videos (fancyBox supports YouTube, Vimeo & MP4):

    Video

Captions

You need to have the flarum/bbcode extension in order to add captions. The title attribute of the IMG or the URL tag will be automatically considered as a caption (the IMG tag has the higher priority). Here are some possible usage examples:

Caption

[img title="Caption this."][/img]
[url title="Caption this." fancy]![](src)[/url]
[url title="Caption this." fancy=video][img][/img][/url]
[url fancy][img title="Caption this."][/img][/url]

Links

malago/flarum-ext-fancybox 适用场景与选型建议

malago/flarum-ext-fancybox 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.4k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 01 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 malago/flarum-ext-fancybox 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 4
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2021-01-27