aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2008-12-24 16:22:35 -0500
committerJoey Hess <joey@gnu.kitenet.net>2008-12-24 16:22:35 -0500
commit3fbe2569ff39c8e280a48c7623e325ef42ebedce (patch)
tree137bebce5fa41787d7330321f0fb5e15c0846e47 /IkiWiki
parent7ba65e7f4bd53c4cbd865fa35a515ef12c183757 (diff)
downloadikiwiki-3fbe2569ff39c8e280a48c7623e325ef42ebedce.tar
ikiwiki-3fbe2569ff39c8e280a48c7623e325ef42ebedce.tar.gz
remove deprecated googlecalendar plugin
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/googlecalendar.pm55
1 files changed, 0 insertions, 55 deletions
diff --git a/IkiWiki/Plugin/googlecalendar.pm b/IkiWiki/Plugin/googlecalendar.pm
deleted file mode 100644
index fad2ad78f..000000000
--- a/IkiWiki/Plugin/googlecalendar.pm
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/perl
-package IkiWiki::Plugin::googlecalendar;
-
-use warnings;
-use strict;
-use IkiWiki 3.00;
-
-sub import {
- hook(type => "getsetup", id => "googlecalendar",
- call => \&getsetup);
- hook(type => "preprocess", id => "googlecalendar",
- call => \&preprocess);
- hook(type => "format", id => "googlecalendar",
- call => \&format);
-}
-
-sub getsetup () {
- return
- plugin => {
- safe => 1,
- rebuild => undef,
- },
-}
-
-sub preprocess (@) {
- my %params=@_;
-
- # Parse the html, looking for the url to embed for the calendar.
- # Avoid XSS attacks..
- my ($url)=$params{html}=~m#iframe\s+src="http://www\.google\.com/calendar/embed\?([^"<>]+)"#;
- if (! defined $url || ! length $url) {
- error gettext("failed to find url in html")
- }
- my ($height)=$params{html}=~m#height="(\d+)"#;
- my ($width)=$params{html}=~m#width="(\d+)"#;
-
- return "<div class=\"googlecalendar\" src=\"$url\" height=\"$height\" width=\"$width\"></div>";
-}
-
-sub format (@) {
- my %params=@_;
-
- $params{content}=~s/<div class=\"googlecalendar" src="([^"]+)" height="([^"]+)" width="([^"]+)"><\/div>/gencal($1,$2,$3)/eg;
-
- return $params{content};
-}
-
-sub gencal ($$$) {
- my $url=shift;
- my $height=shift;
- my $width=shift;
- return qq{<iframe src="http://www.google.com/calendar/embed?$url" style=" border-width:0 " width="$width" frameborder="0" height="$height"></iframe>};
-}
-
-1