-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbookmarklet.html
24 lines (22 loc) · 1.77 KB
/
bookmarklet.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>cal</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<link href="cal.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid" style="padding-top: 20px;">
<div class="row">
<div class="col-md-6">
<h1>PDcal Bookmarklet</h1>
Drag the link below to your bookmarks bar. Then, when viewing any PagerDuty schedules page with an Export menu, click on the <b>PDcal</b> link in your bookmarks bar. A new item will appear in the Export menu to open the public calendar view in a new tab.
<div align="center"><a class="btn btn-primary btn-lg" href="javascript:(function()%7B%24('ul.cal-options-menu').each(function()%20%7Bvar%20ul%20%3D%20%24(this)%3B%24(this).find('li.just-my-cal-option%20%3E%20a').each(function()%20%7Bif%20(%20ul.find('i.icon-external-link-sign').length%20%3E%200%20)%20%7Breturn%3B%7Dvar%20icalurl%20%3D%20%24(this).attr('href').replace(%2F%5C%3F.*%24%2F%2C%20'')%3Bvar%20href%20%3D%20'https%3A%2F%martindstone.github.io%2FPDcal%2Findex.html%3FiCalURL%3D'%20%2B%20icalurl%3B%24(ul).append('%3Cli%20class%3D%22cal-subheader%22%3E%3Ch4%20class%3D%22dropdown-menu-subheader%22%3E%3Ci%20class%3D%22icon%20icon-external-link-sign%20icon-fixed-width%22%3E%3C%2Fi%3EPublic%20View%3C%2Fh4%3E%3C%2Fli%3E')%3B%24(ul).append('%3Cli%20class%3D%22cal-option%22%3E%3Ca%20class%3Daction-link%20cal-link%22%20href%3D%22'%20%2B%20href%20%2B%20'%22%20target%3D%22_blank%22%3EOpen%20in%20new%20tab%3C%2Fa%3E')%3B%7D)%3B%7D)%7D)()">PDcal</a></div>
</div>
</div>
</div>
</body>
</html>