Commit e8d61f53 authored by Ryan Lee's avatar Ryan Lee

initial import of untested video wiki macro plugin

parents
OpenProject Video Wiki Macro
============================
Provides a new wiki macro for embedding externally hosted videos that come
with their own players, using the <iframe> tag.
Usage
=====
```
<<video(url[,width,height])>>
```
where `url` is the embedding URL for the video, and the optional `width` and
`height` for the player size.
module OpenProject
module VideoWikiMacro
require 'open_project/video_wiki_macro/engine'
end
end
require 'open_project/plugins'
module OpenProject::VideoWikiMacro
class Engine < ::Rails::Engine
engine_name :openproject_video_wiki_macro
register 'openproject-video_wiki_macro',
:author_url => 'http://zepheira.com/',
:requires_openproject => '>= 3.0.0'
config.to_prepare do
require 'redmine'
Redmine::WikiFormatting::Macros.register do
desc = "OpenProject video macro. Use as {{video(&lt;url&gt;[,&lt;width&gt;,&lt;height&gt;])}}."
macro :video do |video_wiki_content, args|
url = ""
w = 600
h = 400
if args.length >= 1
url = args[0]
if args.length == 3
w = args[1]
h = args[2]
end
"<iframe type=\"text/html\" width=\"#{w}\" height=\"#{h}\" src=\"#{url}\" frameborder=\"0\"></iframe>".html_safe
else
"<code>Video macro error, check your syntax!</code>"
end
end
end
end
end
end
require 'open_project/video_wiki_macro'
# -*- encoding: utf-8 -*-
# stub: openproject-video_wiki_macro 1.0.0 ruby lib
Gem::Specification.new do |s|
s.name = "openproject-video_wiki_macro"
s.version = "1.0.0"
s.required_rubygems_version = Gem::Requirements.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Ryan Lee", "Zepheira LLC"]
s.date = "2014-05-20"
s.description = "Adds a wiki macro for embedding external video."
s.email = "ryanlee@zepheira.com"
s.homepage = "http://zepheira.com"
s.licneses = ["BSD"]
s.rubygems_version = "2.2.2"
s.summary = "OpenProject Video Wiki Macro"
if s.respond_to? :specification_version then
s.specification_version = 4
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rails>, ["~> 3.2.9"])
s.add_runtime_dependency(%q<openproject-plugins>, ["~> 1.0.6"])
else
s.add_dependency(%q<rails>, ["~> 3.2.9"])
s.add_dependency(%q<openproject-plugins>, ["~> 1.0.6"])
end
else
s.add_dependency(%q<rails>, ["~> 3.2.9"])
s.add_dependency(%q<openproject-plugins>, ["~> 1.0.6"])
end
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment