Feature Request: Embed Google Calendar in a wiki page - FogBugz Knowledge Exchange most recent 30 from http://fogbugz.stackexchange.com2013-05-19T18:41:26Zhttp://fogbugz.stackexchange.com/feeds/question/6261http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://fogbugz.stackexchange.com/questions/6261/feature-request-embed-google-calendar-in-a-wiki-pageFeature Request: Embed Google Calendar in a wiki pageflipdoubt2010-12-11T13:26:02Z2012-07-13T15:17:18Z
<p>One would think you could simply copy-and-paste the Google calendar embed code into the <strong>Edit HTML Source</strong> view in the wiki, but it appears FogBugz strips out the <code>iframe</code> when saving the page. Is this true? Are <code>iframes</code> disallowed for security reasons? Is there a description of exactly what HTML is allowed and what is not allowed in the wiki? As an admin, can I customize exactly what HTML is allowed in my wiki? If not, I would like to request this feature:</p>
<blockquote>
<p>In the wiki template page or somewhere in the <strong>Site Configuration</strong> section, allow the admin to white-list all tags that can be added in the <strong>Edit HTML Source</strong> view of a wiki or all wikis.</p>
</blockquote>
<p>.</p>
<blockquote>
<p><img src="http://www.gravatar.com/avatar/baf927dcc0b0c5d0f41dece1e575aa0f?s=32&d=identicon&r=PG" alt="Fog Creek"> <a href="http://fogbugz.stackexchange.com/questions/1023/whats-that-kiwi-logo-and-case-number-at-the-bottom-of-my-feature-request" rel="nofollow">Case FC2035779</a></p>
</blockquote>
http://fogbugz.stackexchange.com/questions/6261/feature-request-embed-google-calendar-in-a-wiki-page/6389#6389Answer by Rich Armstrong for Feature Request: Embed Google Calendar in a wiki pageRich Armstrong2010-12-22T18:58:22Z2010-12-22T18:58:22Z<p>We're currently sorting through the security issues involved in allowing IFRAMES. There are various XSS and click-jacking concerns that I think we can get around. Discussion is ongoing, but might take some time.</p>
http://fogbugz.stackexchange.com/questions/6261/feature-request-embed-google-calendar-in-a-wiki-page/10584#10584Answer by Ben McCormack for Feature Request: Embed Google Calendar in a wiki pageBen McCormack2012-07-13T15:17:18Z2012-07-13T15:17:18Z<p>FogBugz rewrites the iframes that you paste into the wiki for security reasons. However, we can use a BugMonkey script to get around this behavior and have our calendar show up (similar to what we do in <a href="http://fogbugz.stackexchange.com/questions/10523/can-i-embed-a-google-doc-into-a-fogbugz-wiki-page" rel="nofollow">Can I embed a Google Doc into a FogBugz wiki page</a>). Here's the finished result:</p>
<p><img src="http://i.imgur.com/E2D4h.png" alt="alt text"></p>
<p>To start, you want to go into your gmail calendar's settings and take note of the embed code:</p>
<p><img src="http://i.imgur.com/j9Lbz.png" alt="alt text"></p>
<p><img src="http://i.imgur.com/kmMeO.png" alt="alt text"></p>
<p>The only thing we're interested in is the URL inside the embed code, like so: </p>
<pre><code>http://www.google.com/calendar/embed?src=test%40example.com&ctz=America/New_York
</code></pre>
<p>Take the URL and add it as a link to any wiki page where you want the calendar to show up. Then add the following BugMonkey customization (My Settings > Customizations) to your FogBugz installation and enable it for all users:</p>
<pre><code>name: Embed Google Calendar
description: Allows you to embed a Google Calendar into a FogBugz wiki
author: Ben McCormack
version: 1.0.0.0
minApi: 1.0
js:
$(document).ready(function(){
//make sure we're on the view wiki page, not editing
if ($('a#idViewArticle.selected').length === 0) {
return;
}
var toMatch = /\bhttp:\/\/www\.google\.com\/calendar\/embed\?[^ ]*\b/i;
var matches = $('a[href*="http://www.google.com/calendar/embed"]').filter(function(){
return $(this).attr('href').match(toMatch);
});
$(matches).each(function() {
var href = $(this).attr('href');
var iframe = '<iframe src="' + href + '"width="715" height="600" frameborder="0" scrolling="no" style="border: 0"></iframe>';
var replaceWith = $(this).replaceWith(iframe);
});
});
css:
/* body { background-color: red !important; } */
</code></pre>
<p>The above customization will look for Google Calendar embed links within wiki pages and replace them with the actual embedded calendar.</p>