Skip to content

Commit

Permalink
Synced to 50c790c
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Sep 27, 2015
1 parent 0ad4f5d commit df483d2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "s9e/text-formatter",
"version": "0.4.0",
"version": "0.4.1",
"type": "library",
"description": "Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding media (YouTube, etc...), enhanced typography and more.",
"homepage": "https://github.com/s9e/TextFormatter/",
Expand Down
2 changes: 1 addition & 1 deletion src/Bundles/Fatdown.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Bundles/Fatdown/Renderer.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Bundles/Forum.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Bundles/Forum/Renderer.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Bundles/MediaPack.php

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Bundles/MediaPack/Renderer.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CachedSiteDefinitionProvider extends SiteDefinitionProvider
'liveleak'=>'a:3:{s:4:"host";s:12:"liveleak.com";s:7:"extract";s:41:"!liveleak\\.com/view\\?i=(?\'id\'[a-f_0-9]+)!";s:6:"iframe";a:3:{s:5:"width";s:3:"640";s:6:"height";s:3:"360";s:3:"src";s:40:"http://www.liveleak.com/ll_embed?i={@id}";}}',
'livestream'=>'a:4:{s:4:"host";s:14:"livestream.com";s:7:"extract";a:2:{i:0;s:69:"!livestream\\.com/accounts/(?\'account_id\'\\d+)/events/(?\'event_id\'\\d+)!";i:1;s:26:"!/videos/(?\'video_id\'\\d+)!";}s:6:"scrape";a:1:{s:7:"extract";s:53:"!accounts/(?\'account_id\'\\d+)/events/(?\'event_id\'\\d+)!";}s:6:"iframe";a:3:{s:5:"width";s:3:"640";s:6:"height";s:3:"360";s:3:"src";s:206:"//new.livestream.com/accounts/<xsl:value-of select="@account_id"/>/events/<xsl:value-of select="@event_id"/><xsl:if test="@video_id">/videos/<xsl:value-of select="@video_id"/></xsl:if>/player?autoPlay=false";}}',
'mailru'=>'a:3:{s:4:"host";s:10:"my.mail.ru";s:6:"scrape";a:2:{s:5:"match";s:35:"!my\\.mail\\.ru/\\w+/\\w+/video/\\w+/\\d!";s:7:"extract";s:36:"!mail\\.ru/video/(?\'id\'[/\\w]+)\\.html!";}s:6:"iframe";a:3:{s:5:"width";s:3:"560";s:6:"height";s:3:"342";s:3:"src";s:50:"http://videoapi.my.mail.ru/videos/embed/{@id}.html";}}',
'medium'=>'a:3:{s:4:"host";s:10:"medium.com";s:7:"extract";s:47:"!medium\\.com/[^/]*/(?:[-\\w]+-)?(?\'id\'[\\da-f]+)!";s:6:"iframe";a:4:{s:5:"width";s:3:"400";s:6:"height";s:3:"454";s:3:"src";s:52:"https://api.medium.com/embed?type=story&path=//{@id}";s:5:"style";a:4:{s:6:"border";s:9:"solid 1px";s:12:"border-color";s:14:"#eee #ddd #bbb";s:13:"border-radius";s:3:"5px";s:10:"box-shadow";s:28:"rgba(0,0,0,0.15) 0px 1px 3px";}}}',
'medium'=>'a:3:{s:4:"host";s:10:"medium.com";s:7:"extract";s:47:"!medium\\.com/[^/]*/(?:[-\\w]+-)?(?\'id\'[\\da-f]+)!";s:6:"iframe";a:5:{s:5:"width";s:3:"400";s:6:"height";s:3:"400";s:3:"src";s:94:"https://api.medium.com/embed?type=story&path=%2F%2F{@id}&id={translate(@id,\'abcdef\',\'111111\')}";s:6:"onload";s:134:"window.addEventListener(\'message\',function(a){{a=a.data.split(\'::\');\'m\'===a[0]&&0<src.indexOf(a[1])&&a[2]&&(style.height=a[2]+\'px\')}})";s:5:"style";a:4:{s:6:"border";s:9:"1px solid";s:12:"border-color";s:14:"#eee #ddd #bbb";s:13:"border-radius";s:3:"5px";s:10:"box-shadow";s:25:"rgba(0,0,0,.15) 0 1px 3px";}}}',
'metacafe'=>'a:3:{s:4:"host";s:12:"metacafe.com";s:7:"extract";s:32:"!metacafe\\.com/watch/(?\'id\'\\d+)!";s:6:"iframe";a:1:{s:3:"src";s:31:"//www.metacafe.com/embed/{@id}/";}}',
'mixcloud'=>'a:4:{s:4:"host";s:12:"mixcloud.com";s:7:"extract";s:55:"@mixcloud\\.com/(?!categories|tag)(?\'id\'[-\\w]+/[^/&]+)/@";s:6:"scrape";a:2:{s:5:"match";s:25:"@//i\\.mixcloud\\.com/\\w+$@";s:7:"extract";s:65:"@link rel="canonical" href="https?://[^/]+/(?\'id\'[-\\w]+/[^/&]+)/@";}s:6:"iframe";a:3:{s:5:"width";s:3:"400";s:6:"height";s:3:"400";s:3:"src";s:106:"//www.mixcloud.com/widget/iframe/?feed=http%3A%2F%2Fwww.mixcloud.com%2F{@id}%2F&embed_type=widget_standard";}}',
'msnbc'=>'a:3:{s:4:"host";s:9:"msnbc.com";s:6:"scrape";a:2:{s:5:"match";a:2:{i:0;s:26:"@msnbc\\.com/[-\\w]+/watch/@";i:1;s:18:"@on\\.msnbc\\.com/.@";}s:7:"extract";s:19:"@guid="?(?\'id\'\\w+)@";}s:6:"iframe";a:3:{s:5:"width";s:3:"635";s:6:"height";s:3:"440";s:3:"src";s:60:"//player.theplatform.com/p/2E2eJC/EmbeddedOffSite?guid={@id}";}}',
Expand All @@ -78,7 +78,7 @@ class CachedSiteDefinitionProvider extends SiteDefinitionProvider
'rutube'=>'a:4:{s:4:"host";s:9:"rutube.ru";s:7:"extract";s:30:"!rutube\\.ru/tracks/(?\'id\'\\d+)!";s:6:"scrape";a:2:{s:5:"match";s:31:"!rutube\\.ru/video/[0-9a-f]{32}!";s:7:"extract";s:34:"!rutube\\.ru/play/embed/(?\'id\'\\d+)!";}s:6:"iframe";a:3:{s:5:"width";s:3:"720";s:6:"height";s:3:"405";s:3:"src";s:28:"//rutube.ru/play/embed/{@id}";}}',
'scribd'=>'a:3:{s:4:"host";s:10:"scribd.com";s:7:"extract";s:28:"!scribd\\.com/doc/(?\'id\'\\d+)!";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"500";s:3:"src";s:81:"//www.scribd.com/embeds/{@id}/content?view_mode=scroll&show_recommendations=false";s:5:"style";a:1:{s:6:"resize";s:8:"vertical";}}}',
'slideshare'=>'a:4:{s:4:"host";s:14:"slideshare.net";s:7:"extract";s:45:"!slideshare\\.net/[^/]+/[-\\w]+-(?\'id\'\\d{6,})$!";s:6:"scrape";a:2:{s:5:"match";s:26:"!slideshare\\.net/[^/]+/\\w!";s:7:"extract";s:29:"!"presentationId":(?\'id\'\\d+)!";}s:6:"iframe";a:3:{s:5:"width";s:3:"427";s:6:"height";s:3:"356";s:3:"src";s:47:"//www.slideshare.net/slideshow/embed_code/{@id}";}}',
'soundcloud'=>'a:4:{s:4:"host";s:14:"soundcloud.com";s:7:"extract";a:3:{i:0;s:83:"@(?\'id\'https?://(?:api\\.)?soundcloud\\.com/(?!pages/)[-/\\w]+/[-/\\w]+|^[^/]+/[^/]+$)@";i:1;s:50:"@api.soundcloud.com/playlists/(?\'playlist_id\'\\d+)@";i:2;s:44:"@api.soundcloud.com/tracks/(?\'track_id\'\\d+)@";}s:6:"scrape";a:3:{s:3:"url";s:158:"https://api.soundcloud.com/resolve?url={@id}&_status_code_map%5B302%5D=200&_status_format=json&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&app_version=7a35847b";s:5:"match";s:8:"@/sets/@";s:7:"extract";s:50:"@api.soundcloud.com/playlists/(?\'playlist_id\'\\d+)@";}s:6:"choose";a:2:{s:4:"when";a:3:{i:0;a:2:{s:4:"test";s:12:"@playlist_id";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"450";s:9:"max-width";s:3:"900";s:3:"src";s:90:"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/{@playlist_id}";}}i:1;a:2:{s:4:"test";s:9:"@track_id";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"166";s:9:"max-width";s:3:"900";s:3:"src";s:84:"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{@track_id}";}}i:2;a:2:{s:4:"test";s:25:"not(contains(@id, \'://\'))";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"166";s:9:"max-width";s:3:"900";s:3:"src";s:67:"https://w.soundcloud.com/player/?url=https%3A//soundcloud.com/{@id}";}}}s:9:"otherwise";a:1:{s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"166";s:9:"max-width";s:3:"900";s:3:"src";s:42:"https://w.soundcloud.com/player/?url={@id}";}}}}',
'soundcloud'=>'a:3:{s:4:"host";s:14:"soundcloud.com";s:7:"extract";a:3:{i:0;s:83:"@(?\'id\'https?://(?:api\\.)?soundcloud\\.com/(?!pages/)[-/\\w]+/[-/\\w]+|^[^/]+/[^/]+$)@";i:1;s:50:"@api.soundcloud.com/playlists/(?\'playlist_id\'\\d+)@";i:2;s:44:"@api.soundcloud.com/tracks/(?\'track_id\'\\d+)@";}s:6:"choose";a:2:{s:4:"when";a:3:{i:0;a:2:{s:4:"test";s:12:"@playlist_id";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"450";s:9:"max-width";s:3:"900";s:3:"src";s:90:"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/{@playlist_id}";}}i:1;a:2:{s:4:"test";s:9:"@track_id";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"166";s:9:"max-width";s:3:"900";s:3:"src";s:84:"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{@track_id}";}}i:2;a:2:{s:4:"test";s:25:"not(contains(@id, \'://\'))";s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"166";s:9:"max-width";s:3:"900";s:3:"src";s:67:"https://w.soundcloud.com/player/?url=https%3A//soundcloud.com/{@id}";}}}s:9:"otherwise";a:1:{s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"166";s:9:"max-width";s:3:"900";s:3:"src";s:42:"https://w.soundcloud.com/player/?url={@id}";}}}}',
'sportsnet'=>'a:3:{s:4:"host";s:12:"sportsnet.ca";s:6:"scrape";a:1:{s:7:"extract";a:2:{i:0;s:25:"/vid(?:eoId)?=(?\'id\'\\d+)/";i:1;s:46:"/param name="@videoPlayer" value="(?\'id\'\\d+)"/";}}s:6:"iframe";a:1:{s:3:"src";s:173:"https://images.rogersdigitalmedia.com/video_service.php?videoId={@id}&playerKey=AQ~~,AAAAAGWRwLc~,cRCmKE8Utf7OFWP38XQcokFZ80fR-u_y&autoStart=false&width=100%25&height=100%25";}}',
'spotify'=>'a:4:{s:6:"scheme";s:7:"spotify";s:4:"host";a:2:{i:0;s:16:"open.spotify.com";i:1;s:16:"play.spotify.com";}s:7:"extract";a:2:{i:0;s:61:"!(?\'uri\'spotify:(?:album|artist|user|track(?:set)?):[,:\\w]+)!";i:1;s:73:"!(?:open|play)\\.spotify\\.com/(?\'path\'(?:album|artist|track|user)/[/\\w]+)!";}s:6:"iframe";a:3:{s:5:"width";s:3:"400";s:6:"height";s:3:"480";s:3:"src";s:224:"https://embed.spotify.com/?view=coverart&amp;uri=<xsl:choose><xsl:when test="@uri"><xsl:value-of select="@uri"/></xsl:when><xsl:otherwise>spotify:<xsl:value-of select="translate(@path,\'/\',\':\')"/></xsl:otherwise></xsl:choose>";}}',
'stitcher'=>'a:3:{s:4:"host";s:12:"stitcher.com";s:6:"scrape";a:2:{s:5:"match";s:11:"!/podcast/!";s:7:"extract";a:2:{i:0;s:23:"!data-eid="(?\'eid\'\\d+)!";i:1;s:23:"!data-fid="(?\'fid\'\\d+)!";}}s:6:"iframe";a:4:{s:5:"width";s:4:"100%";s:6:"height";s:3:"150";s:9:"max-width";s:3:"900";s:3:"src";s:42:"//app.stitcher.com/splayer/f/{@fid}/{@eid}";}}',
Expand Down
3 changes: 2 additions & 1 deletion src/Plugins/MediaEmbed/Configurator/TemplateGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function getTemplate(array $attributes)
$this->attributes['style']['width'] = '100%';
$this->attributes['style']['height'] = '100%';
$this->attributes['style']['position'] = 'absolute';
$this->attributes['style']['left'] = '0';
$outerStyle = 'display:inline-block;width:100%;max-width:' . $this->attributes['width'] . 'px';
$innerStyle = 'position:relative;' . $this->getResponsivePadding();
$prepend .= '<div>' . $this->generateAttributes(array('style' => $outerStyle));
Expand Down Expand Up @@ -67,7 +68,7 @@ protected function generateAttributes(array $attributes)
$xsl = '';
foreach ($attributes as $attrName => $attrValue)
{
$innerXML = (\strpos($attrValue, '<') !== \false) ? $attrValue : AVTHelper::toXSL($attrValue);
$innerXML = (\strpos($attrValue, '<xsl:') !== \false) ? $attrValue : AVTHelper::toXSL($attrValue);
$xsl .= '<xsl:attribute name="' . \htmlspecialchars($attrName, \ENT_QUOTES, 'UTF-8') . '">' . $innerXML . '</xsl:attribute>';
}
return $xsl;
Expand Down

0 comments on commit df483d2

Please sign in to comment.