[Embed] Revert defaults and fix Readme example
This commit is contained in:
parent
bcae2f26b5
commit
a500277dca
@ -507,7 +507,7 @@ class ImageFile extends MediaFile
|
|||||||
return [(int)$rw, (int)$rh,
|
return [(int)$rw, (int)$rh,
|
||||||
(int)$cx, (int)$cy,
|
(int)$cx, (int)$cy,
|
||||||
is_null($cw) ? $width : (int)$cw,
|
is_null($cw) ? $width : (int)$cw,
|
||||||
is_null($ch) ? $height : (int)$ch,];
|
is_null($ch) ? $height : (int)$ch];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,9 +55,9 @@ class EmbedPlugin extends Plugin
|
|||||||
public $append_whitelist = []; // fill this array as domain_whitelist to add more trusted sources
|
public $append_whitelist = []; // fill this array as domain_whitelist to add more trusted sources
|
||||||
public $check_whitelist = false; // security/abuse precaution
|
public $check_whitelist = false; // security/abuse precaution
|
||||||
|
|
||||||
public $thumbnail_width = null;
|
public $thumbnail_width = 128;
|
||||||
public $thumbnail_height = null;
|
public $thumbnail_height = 128;
|
||||||
public $crop = null;
|
public $crop = true;
|
||||||
public $max_size = null;
|
public $max_size = null;
|
||||||
|
|
||||||
protected $imgData = [];
|
protected $imgData = [];
|
||||||
|
@ -10,24 +10,24 @@ Settings
|
|||||||
========
|
========
|
||||||
* `domain_whitelist`: Array of regular expressions. Always escape your dots and end your strings.
|
* `domain_whitelist`: Array of regular expressions. Always escape your dots and end your strings.
|
||||||
* `check_whitelist`: Whether to check the domain_whitelist.
|
* `check_whitelist`: Whether to check the domain_whitelist.
|
||||||
* `thumbnail_width`: Maximum width of the thumbnail in pixels. Defaults to global `[thumbnail][width]`.
|
* `thumbnail_width`: Maximum width of the thumbnail in pixels. Defaults to 128. Setting as `null` makes it use global `[thumbnail][width]`.
|
||||||
* `thumbnail_height`: Maximum height of the thumbnail in pixels. Defaults to global `[thumbnail][height]`.
|
* `thumbnail_height`: Maximum height of the thumbnail in pixels. Defaults to 128. Setting as `null` makes it use global `[thumbnail][height]`.
|
||||||
* `crop`: Crop to the size (not preserving aspect ratio). Defaults to global `[thumbnail][crop]`.
|
* `crop`: Crop to the size (not preserving aspect ratio). Defaults to true. Setting as `null` makes it use global `[thumbnail][crop]`.
|
||||||
* `max_size`: Max media size. Anything bigger than this is rejected. Defaults to global `[attachments][file_quota]`.
|
* `max_size`: Max media size. Anything bigger than this is rejected. Defaults to global `[attachments][file_quota]`.
|
||||||
|
|
||||||
Relevant GNU social global settings
|
Relevant GNU social global settings
|
||||||
===================================
|
===================================
|
||||||
|
|
||||||
* `[attachments][show_html]`: Whether to show HTML oEmbed data.
|
* `[attachments][show_html]`: Whether to show HTML oEmbed data. Defaults to false.
|
||||||
|
|
||||||
Example
|
Example
|
||||||
=======
|
=======
|
||||||
|
|
||||||
```
|
```
|
||||||
$config['thumbnail']['width'] = 42;
|
|
||||||
$config['thumbnail']['height'] = 42;
|
|
||||||
$config['attachments']['show_html'] = true;
|
$config['attachments']['show_html'] = true;
|
||||||
addPlugin('Embed', [
|
addPlugin('Embed', [
|
||||||
|
'thumbnail_width' => 42,
|
||||||
|
'thumbnail_height' => 42,
|
||||||
'domain_whitelist' => [
|
'domain_whitelist' => [
|
||||||
'^i\d*\.ytimg\.com$' => 'YouTube',
|
'^i\d*\.ytimg\.com$' => 'YouTube',
|
||||||
'^i\d*\.vimeocdn\.com$' => 'Vimeo'
|
'^i\d*\.vimeocdn\.com$' => 'Vimeo'
|
||||||
|
Loading…
Reference in New Issue
Block a user