mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
DEV: apply coding standards to plugins (#10594)
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
function setUp($el, settings) {
|
||||
@ -91,7 +91,7 @@
|
||||
|
||||
$el
|
||||
.css({
|
||||
"padding-bottom": padding_bottom
|
||||
"padding-bottom": padding_bottom,
|
||||
})
|
||||
.html(innerHtml.join(""));
|
||||
|
||||
@ -123,7 +123,7 @@
|
||||
id,
|
||||
"/",
|
||||
thumb_img,
|
||||
'">'
|
||||
'">',
|
||||
].join("")
|
||||
)
|
||||
);
|
||||
@ -132,7 +132,7 @@
|
||||
$thumb = $el
|
||||
.find(".ytp-thumbnail")
|
||||
.addClass("lazyYT-image-loaded")
|
||||
.on("click", function(e) {
|
||||
.on("click", function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (
|
||||
@ -156,15 +156,15 @@
|
||||
});
|
||||
}
|
||||
|
||||
$.fn.lazyYT = function(newSettings) {
|
||||
$.fn.lazyYT = function (newSettings) {
|
||||
var defaultSettings = {
|
||||
default_ratio: "16:9",
|
||||
callback: null, // ToDO execute callback if given
|
||||
container_class: "lazyYT-container"
|
||||
container_class: "lazyYT-container",
|
||||
};
|
||||
var settings = $.extend(defaultSettings, newSettings);
|
||||
|
||||
return this.each(function() {
|
||||
return this.each(function () {
|
||||
var $el = $(this).addClass(settings.container_class);
|
||||
setUp($el, settings);
|
||||
});
|
||||
|
Reference in New Issue
Block a user