{{/if}}
diff --git a/plugins/lazy-yt/assets/javascripts/lazyYT.js b/plugins/lazy-yt/assets/javascripts/lazyYT.js
index 897c15497d2..651ea9df48c 100644
--- a/plugins/lazy-yt/assets/javascripts/lazyYT.js
+++ b/plugins/lazy-yt/assets/javascripts/lazyYT.js
@@ -1,40 +1,40 @@
/*!
-* lazyYT (lazy load YouTube videos)
-* v1.0.1 - 2014-12-30
-* (CC) This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
-* http://creativecommons.org/licenses/by-sa/4.0/
-* Contributors: https://github.com/tylerpearson/lazyYT/graphs/contributors || https://github.com/daugilas/lazyYT/graphs/contributors
-*
-* Usage:
loading...
-*
-* Note: Discourse has forked this from the original, beware when updating the file.
-*
-*/
+ * lazyYT (lazy load YouTube videos)
+ * v1.0.1 - 2014-12-30
+ * (CC) This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
+ * http://creativecommons.org/licenses/by-sa/4.0/
+ * Contributors: https://github.com/tylerpearson/lazyYT/graphs/contributors || https://github.com/daugilas/lazyYT/graphs/contributors
+ *
+ * Usage:
loading...
+ *
+ * Note: Discourse has forked this from the original, beware when updating the file.
+ *
+ */
-(function ($) {
- 'use strict';
+(function($) {
+ "use strict";
function setUp($el, settings) {
- var width = $el.data('width'),
- height = $el.data('height'),
- ratio = ($el.data('ratio')) ? $el.data('ratio') : settings.default_ratio,
- id = $el.data('youtube-id'),
- title = $el.data('youtube-title'),
- padding_bottom,
- innerHtml = [],
- $thumb,
- thumb_img,
- youtube_parameters = $el.data('parameters') || '';
+ var width = $el.data("width"),
+ height = $el.data("height"),
+ ratio = $el.data("ratio") ? $el.data("ratio") : settings.default_ratio,
+ id = $el.data("youtube-id"),
+ title = $el.data("youtube-title"),
+ padding_bottom,
+ innerHtml = [],
+ $thumb,
+ thumb_img,
+ youtube_parameters = $el.data("parameters") || "";
ratio = ratio.split(":");
// width and height might override default_ratio value
- if (typeof width === 'number' && typeof height === 'number') {
+ if (typeof width === "number" && typeof height === "number") {
$el.width(width);
- padding_bottom = height + 'px';
- } else if (typeof width === 'number') {
+ padding_bottom = height + "px";
+ } else if (typeof width === "number") {
$el.width(width);
- padding_bottom = (width * ratio[1] / ratio[0]) + 'px';
+ padding_bottom = (width * ratio[1]) / ratio[0] + "px";
} else {
width = $el.width();
@@ -43,7 +43,7 @@
width = $el.parent().width();
}
- padding_bottom = (ratio[1] / ratio[0] * 100) + '%';
+ padding_bottom = (ratio[1] / ratio[0]) * 100 + "%";
}
//
@@ -53,81 +53,108 @@
// Play button from YouTube (exactly as it is in YouTube)
innerHtml.push('
');
- innerHtml.push('');
- innerHtml.push('
'); // end of .ytp-large-play-button
+ if (width <= 640)
+ innerHtml.push(' style="transform: scale(0.563888888888889);"');
+ innerHtml.push(">");
+ innerHtml.push("");
+ innerHtml.push("
"); // end of .ytp-large-play-button
- innerHtml.push(''); // end of .ytp-thumbnail
+ innerHtml.push(""); // end of .ytp-thumbnail
// Video title (info bar)
innerHtml.push('