You are here

function _ufo_header_js in SWF Tools 6

Same name and namespace in other branches
  1. 5 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 61

Code

function _ufo_header_js() {
  $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: 'true'\n\t\t             };\n      UFO.create(FO, this.id);\n    });\n  });\n  ";
  return $js;
}