Merge pull request #490 from simonwelsh/cms-oembed

BUGFIX: Provide a default width and height of 100px for those endpoints ...
This commit is contained in:
Sam Minnée 2012-05-24 20:49:54 -07:00
commit 497aa9bfa9
3 changed files with 4 additions and 3 deletions

View File

@ -39,3 +39,4 @@ and [installation from source](http://doc.silverstripe.org/framework/en/installa
## Attribution ## ## Attribution ##
* Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/). * Some icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).
* default_media.png by Thibault Geffroy from [The Noun Project](http://thenounproject.com/). All rights reserved. Licensed under a [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/).

View File

@ -553,7 +553,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
} elseif($file->Type == 'photo') { } elseif($file->Type == 'photo') {
$thumbnailURL = $file->Oembed->url; $thumbnailURL = $file->Oembed->url;
} else { } else {
$thumbnailURL = $url; $thumbnailURL = FRAMEWORK_DIR . '/images/default_media.png';
} }
$previewField = new LiteralField("ImageFull", $previewField = new LiteralField("ImageFull",
@ -825,11 +825,11 @@ class HtmlEditorField_Embed extends HtmlEditorField_File {
} }
public function getWidth() { public function getWidth() {
return $this->oembed->Width; return $this->oembed->Width ?: 100;
} }
public function getHeight() { public function getHeight() {
return $this->oembed->Height; return $this->oembed->Height ?: 100;
} }
public function getPreview() { public function getPreview() {

BIN
images/default_media.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB