Skip to content

Scrivito Widget for a gif with simple control to start and stop.

License

Notifications You must be signed in to change notification settings

infopark/scrivito_gif_control_widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScrivitoGifControlWidget

A widget for starting and stopping animated GIFs.

Installation

Add this line to your application's Gemfile:

gem 'scrivito_gif_control_widget'

Add this line to your application Javascript Manifest:

//= require scrivito_gif_control_widget

Localization

The following code represents the default localization for English. Copy it to your en.yml and change it if necessary:

en:
  scrivito_gif control_widget:
    thumbnail:
      title: Gif Control
      description: Add a widget to control start and stop of a gif animation with click.
    details:
      image_gif: Gif

Customization

Due to the click event the widget needs to handle, the GIF image in such a widget can only be set via the properties dialog using the Content Browser. You may want to create a corresponding filter for the Content Browser in order to find GIF binaries easier:

scrivito.content_browser.filters = function(filter) {
  if (filter.image_gif) {
    return {
      _obj_class: {
        field: '_obj_class',
        options: {
          Image: {
            query: scrivito.obj_where('blob:content_type', 'equals', 'image/gif'),
            icon: 'image',
            title: 'Gifs'
          }
        }
      }
    };
  }
  else {
    ... // standard filter goes here
  }
};

About

Scrivito Widget for a gif with simple control to start and stop.

Resources

License

Stars

Watchers

Forks

Packages

No packages published