Needs review
Project:
JavaScript Theming
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2010 at 01:54 UTC
Updated:
16 Feb 2010 at 01:54 UTC
I will turn this into a patch later.
This is a straight port of d7 theme_image. however without ability to validate/create image path (what core does in php), what you pass here is what will be used for image.path.
/**
* Implements JS version of core's theme_image:7. Return a themed image.
*/
Drupal.theme.prototype.image = function(image) {
var path = image.path || '';
var alt = image.alt || '';
var title = image.title || '';
var attributes = image.attributes || '';
attributes = Drupal.drupalAttributes(attributes);
return '<img src="' + path + '" alt="' + Drupal.checkPlain(alt) + '" title="' + Drupal.checkPlain(title) + '"' + attributes +' />';
}