Commit 47bad0f7 authored by Ryan Lee's avatar Ryan Lee

initial commit of plugin

parents
OpenProject Google Calendar Macro
=================================
Provides a new wiki macro for embedding a Google Calendar.
Usage
=====
```
{{google_calendar(source,tz[,width,height])}}
```
where `source` is the calendar identifier as provided in the embed snippet
(e.g., `zepheira.com_randomchars%40group.calendar.google.com`) and `tz` is
the original timezone, also provided in the embed snippet. Also available
are the optional `width` and `height` for the embedding size.
Do not use quotes to surround arguments.
module OpenProject
module GoogleCalendarMacro
require 'open_project/google_calendar_macro/engine'
end
end
module OpenProject::GoogleCalendarMacro
class Engine < ::Rails::Engine
engine_name :openproject_google_calendar_macro
include OpenProject::Plugins::ActsAsOpEngine
register 'openproject-google_calendar_macro',
:author_url => 'http://zepheira.com/',
:requires_openproject => '>= 3.0.0' do
Redmine::WikiFormatting::Macros.register do
desc "OpenProject video macro. Use as {{google_calendar(&lt;source&gt;,&lt;timezone&gt;[,&lt;width&gt;,&lt;height&gt;])}}."
macro :google_calendar do |google_calendar_content, args|
src = ""
tz = ""
w = "800"
h = "600"
if args.length >= 2
src = args[0]
tz = args[1]
if args.length == 4
w = args[2]
h = args[3]
end
html = "<iframe style=\"border: 0\" width=\"".html_safe
html << w
html << "\" height=\"".html_safe
html << h
html << "\" src=\"https://www.google.com/calendar/embed?src=".html_safe
html << src
html << "&ctz=".html_safe
html << tz
html << "\" frameborder=\"0\" scrolling=\"no\"></iframe>".html_safe
html
else
"<pre>Google Calenda macro error, check your syntax!</pre>".html_safe
end
end
end
end
end
end
module OpenProject
module GoogleCalendarMacro
VERSION = "4.0.9"
end
end
require 'open_project/google_calendar_macro'
# -*- encoding: utf-8 -*-
# stub: openproject-google_calendar_macro 4.0.9 ruby lib
Gem::Specification.new do |s|
s.name = "openproject-google_calendar_macro"
s.version = "4.0.9"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Ryan Lee", "Zepheira LLC"]
s.date = "2015-04-07"
s.description = "Adds a wiki macro for embedding a Google Calendar."
s.email = "ryanlee@zepheira.com"
s.files = ["README.md", "lib/openproject-google_calendar_macro.rb", "lib/open_project/google_calendar_macro.rb", "lib/open_project/google_calendar_macro/engine.rb"]
s.homepage = "http://zepheira.com"
s.licenses = ["BSD"]
s.rubygems_version = "2.2.2"
s.summary = "OpenProject Google Calendar Macro"
s.test_files = []
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"])
else
s.add_dependency(%q<rails>, ["~> 3.2.9"])
end
else
s.add_dependency(%q<rails>, ["~> 3.2.9"])
end
end
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