Skip to content

Commit f02a707

Browse files
committed
Merge branch 'master' of https://github.com/oscarotero/Embed
2 parents d759574 + 03ee485 commit f02a707

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/Adapters/Google.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public static function check(Request $request)
1919
return $request->isValid() && $request->match([
2020
'https://maps.google.*',
2121
'https://www.google.*/maps*',
22+
'https://calendar.google.com/calendar/*',
2223
'https://drive.google.com/file/*/view',
2324
'https://plus.google.com/*/posts/*',
2425
]);
@@ -49,6 +50,10 @@ public function getCode()
4950
.'<div class="g-post" data-href="'.$this->request->getUrl().'"></div>';
5051
}
5152

53+
if ($this->request->getHost() === 'calendar.google.com') {
54+
return Utils::iframe($this->request->getUrl());
55+
}
56+
5257
if (($google = $this->getProvider('google'))) {
5358
return $google->getCode();
5459
}

tests/GoogleTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,17 @@ public function testPlus()
3939
]
4040
);
4141
}
42+
43+
public function testCalendar()
44+
{
45+
$this->assertEmbed(
46+
'https://calendar.google.com/calendar/embed?src=spain__es%40holiday.calendar.google.com&ctz=Europe/Madrid',
47+
[
48+
'title' => 'Festivos en España',
49+
'type' => 'rich',
50+
'code' => '<iframe src="https://calendar.google.com/calendar/embed?src=spain__es%40holiday.calendar.google.com&amp;ctz=Europe%2FMadrid" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:600px;height:400px;"></iframe>',
51+
'providerName' => 'google',
52+
]
53+
);
54+
}
4255
}

0 commit comments

Comments
 (0)