Giter Club home page Giter Club logo

flarum-ext-fancybox's Introduction

fancyBox Extension for Flarum

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

flarum-ext-fancybox's People

Contributors

squeevee avatar malago86 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.