silverstripe/sapphire — pull request #1831 by a2nt (2013-05-03 21:50:04+00:00)
Title: IMPROVEMENT Media Dialog extra data

HtmlEditorField_Toolbar class allows you to extend media fields for an
instance this way:
```php
class HtmlEditorField_ToolbarEx extends Extension {
public function updateFieldsForImage($fields, $url, $file){
if(is_a($file,'HtmlEditorField_Embed')){
$fields->push(
CheckboxField::create('lightbox','Popup Preview',0)
->addExtraClass('extra-data')
);
}
}
}
```

But there's no use in such exteding when u can't pass this attributes
to content field so every field that has class "extra-data" will be
added to media as data-*field_name* attribute as u can see in my
exmaple data-lightbox="1" attribute will be added to an image. The same
way we can add a hidden field with full size image url and it will be
possible to open this image in lightbox window