Drupal.behaviors.emWave$i = function (context) {
var wavePanel$i = new WavePanel('http://wave.google.com/a/wavesandbox.com/');
wavePanel$i.loadWave('wavesandbox.com!w+$code');
wavePanel$i.setUIConfig('$bg_color','$color','$font','$font_size');
wavePanel$i.init(document.getElementById('waveframe$i'));
}
EOD;
$output .= "\n" . '';
// Apparently this stuff is not implemented yet.
//$output .= "\n" . ' ';
//$output .= "\n" . '
';
//$output .= "\n" . ' ';
//$output .= "\n" . '
';
// If being output as a link, theme a link version.
if ($link) {
$output = l($output, $link, array('html' => true));
}
return $output;
}
function theme_emwave_wave_full($field, $item, $formatter, $node) {
if ($item['value'] && $item['provider']) {
$code = $item['value'];
$width = $field['widget']['full_width'];
$height = $field['widget']['full_height'];
$bg_color = $field['widget']['bg_color'];
$color = $field['widget']['color'];
$font = $field['widget']['font'];
$font_size = $field['widget']['font_size'];
$link = $field['widget']['full_link'];
if ($link == emwave_LINK_CONTENT) {
$link = 'node/'. $node->nid;
}
else if ($link == emwave_LINK_PROVIDER) {
$link = module_invoke('emfield', 'include_invoke', 'emwave', $item['provider'], 'embedded_link', $code, $item['data']);
}
else {
$link = NULL;
}
$title = module_invoke('emfield', 'include_invoke', 'emwave', $item['provider'], 'wave_title', $code, $item['data']);
$output = theme('emwave_wave', $field, $item, $formatter, $node, $code, $width, $height, $bg_color, $color, $font, $font_size, $title, $link);
}
return $output;
}
function theme_emwave_default($field, $item, $formatter, $node) {
return theme('emwave_wave_full', $field, $item, $formatter, $node);
}
function theme_emwave_wave_preview($field, $item, $formatter, $node) {
if ($item['value'] && $item['provider']) {
$code = $item['value'];
$width = $field['widget']['preview_width'];
$height = $field['widget']['preview_height'];
$bg_color = $field['widget']['bg_color'];
$color = $field['widget']['color'];
$font = $field['widget']['font'];
$font_size = $field['widget']['font_size'];
$link = $field['widget']['preview_link'];
if ($link == emwave_LINK_CONTENT) {
$link = 'node/' . $node->nid;
}
else if ($link == emwave_LINK_PROVIDER) {
$link = module_invoke('emfield', 'include_invoke', 'emwave', $item['provider'], 'embedded_link', $code, $item['data']);
}
else {
$link = NULL;
}
$title = module_invoke('emfield', 'include_invoke', 'emwave', $item['provider'], 'wave_title', $code, $item['data']);
$output = theme('emwave_wave', $field, $item, $formatter, $node, $code, $width, $height, $bg_color, $color, $font, $font_size, $title, $link);
}
return $output;
}
function theme_emwave_formatter_wave_embed($element) {
$field = content_fields($element['#field_name'], $element['#type_name']);
return module_invoke('emwave', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
}
function theme_emwave_formatter_default($element) {
$field = content_fields($element['#field_name'], $element['#type_name']);
return module_invoke('emwave', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
}
function theme_emwave_formatter_wave_full($element) {
$field = content_fields($element['#field_name'], $element['#type_name']);
return module_invoke('emwave', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
}
function theme_emwave_formatter_wave_preview($element) {
$field = content_fields($element['#field_name'], $element['#type_name']);
return module_invoke('emwave', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
}
function theme_emwave_wave_embed($field, $item, $formatter, $node) {
if ($item['value'] && $item['provider']) {
$output = drupal_get_form('emwave_embed_form', $field, $item, $formatter, $node);
}
return $output;
}