mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 10:58:38 +08:00
Added margin to the video container in lazyYt plugin
This commit is contained in:
parent
6832b06a80
commit
29947f6e95
2 changed files with 1 additions and 26 deletions
|
@ -12,36 +12,10 @@ class PostAnalyzer
|
||||||
@found_oneboxes
|
@found_oneboxes
|
||||||
end
|
end
|
||||||
|
|
||||||
#to add margin between youtube links
|
|
||||||
def newlinereplace(*args)
|
|
||||||
sp = args[0].split(/\n+/)
|
|
||||||
a = 0
|
|
||||||
x = 0
|
|
||||||
replacem = []
|
|
||||||
while a<sp.length do
|
|
||||||
if sp[a].length > 0
|
|
||||||
replacem[x] =sp[a]
|
|
||||||
x+=1
|
|
||||||
end
|
|
||||||
if a!= sp.length-1
|
|
||||||
replacem[x]="\n"
|
|
||||||
x+=1
|
|
||||||
end
|
|
||||||
a+=1
|
|
||||||
end
|
|
||||||
args[0]=replacem.join()
|
|
||||||
return *args
|
|
||||||
end
|
|
||||||
|
|
||||||
# What we use to cook posts
|
# What we use to cook posts
|
||||||
def cook(*args)
|
def cook(*args)
|
||||||
yt_string = args[0]
|
|
||||||
if yt_string.include? "www.youtube"
|
|
||||||
*args = newlinereplace(*args)
|
|
||||||
end
|
|
||||||
|
|
||||||
cooked = PrettyText.cook(*args)
|
cooked = PrettyText.cook(*args)
|
||||||
|
|
||||||
result = Oneboxer.apply(cooked, topic_id: @topic_id) do |url, _|
|
result = Oneboxer.apply(cooked, topic_id: @topic_id) do |url, _|
|
||||||
@found_oneboxes = true
|
@found_oneboxes = true
|
||||||
Oneboxer.invalidate(url) if args.last[:invalidate_oneboxes]
|
Oneboxer.invalidate(url) if args.last[:invalidate_oneboxes]
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
padding: 0 0 56.25% 0;
|
padding: 0 0 56.25% 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #000000;
|
background-color: #000000;
|
||||||
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lazyYT-container iframe {
|
.lazyYT-container iframe {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue