Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sectore/jekyll-swfobject
A plugin for Jekyll to embed Flash files (*.swf) using SWFObject
https://github.com/sectore/jekyll-swfobject
Last synced: 30 days ago
JSON representation
A plugin for Jekyll to embed Flash files (*.swf) using SWFObject
- Host: GitHub
- URL: https://github.com/sectore/jekyll-swfobject
- Owner: sectore
- License: mit
- Created: 2013-01-09T14:59:12.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-01T12:26:47.000Z (over 10 years ago)
- Last Synced: 2024-11-07T20:41:55.597Z (about 1 month ago)
- Language: Ruby
- Size: 183 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-jekyll-plugins - **SWF Object** - swfobject](https://rubygems.org/gems/jekyll-swfobject)) -- Liquid plugin for embedding Adobe Flash files (.swf) using SWFObject. (Tags)
README
# Jekyll Plugin: SWFObject Tag
SWFObject Tag is a [Liquid](http://www.liquidmarkup.org/) plugin for [Jekyll](http://jekyllrb.com/) to embed Flash files (*.swf) using [SWFObject](http://code.google.com/p/swfobject/)
## Installation
1) Add this line to your application's Gemfile:
gem 'jekyll-swfobject'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jekyll-swfobject
2) Add in a plugin file within your Jekyll project's _plugins directory:
# _plugins/my-plugin.rb
require 'jekyll-swfobject'3) Link SWFObject in your layout template or page within `` or before `{% swfobject %}` :
``
## Usage
### Tag
{% swfobject swf_url %}Flash Player required.{% endswfobject %}
Note: Because SWFObject Tag is a `Liquid::Block`, you have to close any `{% swfobject %}` with `{% endswfobject %}` in your templates.
Also an alternative content within the tags is needed.#### Alternative HTML content (required)
{% swfobject swf_url %}
Latest Flash Player Plugin is required.
{% endswfobject %}#### Optional parameters
All optional parameters are defined using `key:value` pairs.
{% swfobject swf_url id:myFlash content_id:flashcontent width:500 height:600 %}{% endswfobject %}
Note: Don't use whitespaces between `:` to avoid issues rendering templates.
For all optional parameters check section [Parameters](#parameters) below.
#### Optional parameters defined in `_config.yml`
swfobject:
height: 350
width: 200
express_install_url: expressInstall.swfYou can define any optional paramter in `_config.yml`. For an overiew of all optional parameters check section [Parameters](#parameters) below.
## Parameters
### Required parameter
`swf_url` - Path to SWF, which has to be embedded
### Optional parameters
All optional parameters can be defined within `{% swfobject %}` and / or using `_config.yml`.
Parameters defined in `_config.yml` will be overridden by tag parameters.`content_id` - Id of the div container, which will be replaced by SWFObject to embed SWF
`height` - Height (`px`, `%`, `em` or `rem`) of the embedded SWF and of the surrounded `
` (default: 100%)`width` - Width (`px`, `%`, `em` or `rem`) of the embedded SWF and of the surrounded `
` (default: 100%).Note: For a better support of fluid and responsive layouts using `em`, `rem` etc. the plugin creates an extra `div`,
which wrappes the generated `` tag. This wrapper `div` will be sized using values of `height` and `width`.
The wrapper can be addressed by using the `content_id` + `-wrapper`, e.g. `flashcontent-wrapper`.`version` - Version of the Flash Player Plugin (default: 10.0)
`flashvars` - String of flashvars using `key=value` pairs combinend with `&`, e.g. `name1=hello&name2=world`
`express_install_url` - URL of the expressInstall.swf
`callback_function` - Callback function to check success or failure of creating a Flash plug-in ``
#### Optional Attributes of the `` element
`id`
`align`
`name`
`styleclass`
For detailed information check SWF Object documentation: http://code.google.com/p/swfobject/wiki/documentation
#### Optional Flash specific parameters
`play`
`loop`
`menu`
`quality`
`scale`
`salign`
`wmode`
`bgcolor`
`base`
`swliveconnect`
`devicefont`
`allowscriptaccess`
`seamlesstabbing`
`allowfullscreen`
`allownetworking`
For detailed information check SWF Object documentation: http://code.google.com/p/swfobject/wiki/documentation
## Live example
SWFObject Tag is used by the Jekyll generated website [WEBSECTOR.DE](http://websector.de). You will find the [source](https://github.com/sectore/websector.de) of WEBSECTOR.DE [here](https://github.com/sectore/websector.de) at GitHub.
## Test
The plugin is well tested using [Test::Unit](http://www.ruby-doc.org/core/classes/Test/Unit.html) with [Shoulda](https://github.com/thoughtbot/shoulda) and [Mocha](http://gofreerange.com/mocha/). To start tests just run
rake test
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request## License
Copyright (c) 2013 "sectore" Jens Krause // [WEBSECTOR.DE](http://websector.de)
SWFObject Tag is free software and it may be redistributed under the terms specified in the MIT-LICENSE file.