Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Avert your eyes.
- (function($, $Trumba) {
- Drupal.behaviors.csumbDashboardEvents = {
- attach: function() {
- },
- /**
- * Monkey-patch a CSS file into the iFrame.
- */
- addCss : function(event) {
- $.get(Drupal.settings.dashboardEvents.css, function(data) {
- var $style = $('<style>');
- $style.html(data);
- $('iframe.trumba').contents().find('head').append($style);
- jQuery('iframe.trumba').parent('div').css('height', $('iframe.trumba').contents().find('body').height() + 'px');
- });
- },
- /**
- * Override the default iFrame template for Trumba to include an event callback onload.
- * We are going this route because of iFrame/JS scoping issues where Trumba munges the $ variable.
- */
- addEvents : function() {
- $Trumba.Spuds.IFRAME_FORMAT = '<iframe class="trumba" onload="Drupal.behaviors.csumbDashboardEvents.addCss();" src="javascript:\'<html><head>{5}</head><body style={4}> </body></html>\'" id="{0}" name="{0}" style="{1}" frameborder="no" width="100%" scrolling="no" marginheight="0" marginwidth="0" {2} {3}><\/iframe>';
- $Trumba.addSpud({
- webName: "csumb-obi-for-website",
- spudType : "main",
- url : { template : "detaillist", events: "4" }
- });
- }
- }
- })(jQuery, $Trumba);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement