No commit activity in last 3 years
No release in over 3 years
Scrivito Widget to add a gif with simple control to start and stop
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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
  }
};