This commit is contained in:
Aevann1 2021-07-21 13:04:04 +02:00
parent 9a620fe5bb
commit ade99c8f52
2 changed files with 20 additions and 20 deletions

View file

@ -731,26 +731,6 @@ $(document).ready(function() {
}); });
}); });
//yt embed
function getId(url) {
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
var match = url.match(regExp);
if (match && match[2].length == 11) {
return match[2];
} else {
return 'error';
}
}
var myUrl = $('#embedURL').text();
myId = getId(myUrl);
$('#ytEmbed').html('<iframe width="100%" height="475" src="//www.youtube.com/embed/' + myId + '" frameborder="0" allowfullscreen></iframe>');
// Text Formatting // Text Formatting
// Bold Text // Bold Text

View file

@ -3,6 +3,26 @@
<head> <head>
<script> <script>
//yt embed
function getId(url) {
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
var match = url.match(regExp);
if (match && match[2].length == 11) {
return match[2];
} else {
return 'error';
}
}
var myUrl = $('#embedURL').text();
myId = getId(myUrl);
$('#ytEmbed').html('<iframe width="100%" height="475" src="//www.youtube.com/embed/' + myId + '" frameborder="0" allowfullscreen></iframe>');
// Expand Images on Desktop // Expand Images on Desktop
function expandDesktopImage(image, link) { function expandDesktopImage(image, link) {