You are here

function _ufo_header_js in SWF Tools 5

Same name and namespace in other branches
  1. 6 ufo/ufo.module \_ufo_header_js()
  2. 6.2 ufo/ufo.module \_ufo_header_js()

The jQuery code that will try to replace all elements after the page loads. This parses the JSON out of the 'swftools' attribute of all class="ufo" divs. *

1 call to _ufo_header_js()
ufo_swftools_embed in ufo/ufo.module
Implementation of swftools_embed hook Returns the markup for the page, plus set necessary javascript.

File

ufo/ufo.module, line 60

Code

function _ufo_header_js() {

  //		var FO = { movie:"test8.swf", width:"300", height:"120", majorversion:"8", build:"0", xi:"true" };
  //		UFO.create(FO, "ufoDemo");
  $js = "\n  \$(document).ready(function(){\n    \$('.ufo').each(function(i){\n      params = Drupal.parseJson(\$(this).attr('swftools'));\n\t\t  var FO = { movie: params['src'], width: params['width'], height: params['height'],\n\t\t             majorversion: params['version'], build: '0', xi: 'false',\n\t\t             quality: params['quality'], wmode: params['wmode'], align: params['align'],\n                 salign: params['salign'], play: params['play'], loop: params['loop'],\n                 menu: params['menu'], base: params['base'], flashvars: params['flashvars'],\n                 allowfullscreen: params['allowfullscreen']\n\t\t             };\n      UFO.create(FO, this.id);\n    });\n  });\n  ";
  return $js;
}