15

One would think you could simply copy-and-paste the Google calendar embed code into the Edit HTML Source view in the wiki, but it appears FogBugz strips out the iframe when saving the page. Is this true? Are iframes 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:

In the wiki template page or somewhere in the Site Configuration section, allow the admin to white-list all tags that can be added in the Edit HTML Source view of a wiki or all wikis.

.

Fog Creek Case FC2035779

flag

2 Answers

4

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 Can I embed a Google Doc into a FogBugz wiki page). Here's the finished result:

alt text

To start, you want to go into your gmail calendar's settings and take note of the embed code:

alt text

alt text

The only thing we're interested in is the URL inside the embed code, like so:

http://www.google.com/calendar/embed?src=test%40example.com&ctz=America/New_York

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:

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; } */

The above customization will look for Google Calendar embed links within wiki pages and replace them with the actual embedded calendar.

link|flag
1

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.

link|flag
Rich, Any update on the feasibility of iframe embedding in wikis? – Tod Robbins Jul 21 2011 at 17:02
We will revisit this when it comes to the top of the feature request pile. – Rich Armstrong Jul 21 2011 at 19:16

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.