sneed
This commit is contained in:
parent
9c420b8a92
commit
85f5dd46c7
2 changed files with 44 additions and 44 deletions
|
@ -751,41 +751,6 @@ myId = getId(myUrl);
|
||||||
$('#ytEmbed').html('<iframe width="100%" height="475" src="//www.youtube.com/embed/' + myId + '" frameborder="0" allowfullscreen></iframe>');
|
$('#ytEmbed').html('<iframe width="100%" height="475" src="//www.youtube.com/embed/' + myId + '" frameborder="0" allowfullscreen></iframe>');
|
||||||
|
|
||||||
|
|
||||||
// Expand Images on Desktop
|
|
||||||
|
|
||||||
function expandDesktopImage(image, link) {
|
|
||||||
|
|
||||||
// Link text
|
|
||||||
|
|
||||||
var linkText = document.getElementById("desktop-expanded-image-link");
|
|
||||||
var imgLink = document.getElementById("desktop-expanded-image-wrap-link");
|
|
||||||
|
|
||||||
var inlineImage = document.getElementById("desktop-expanded-image");
|
|
||||||
|
|
||||||
inlineImage.src = image.replace("100w.gif", "giphy.gif");
|
|
||||||
linkText.href = image;
|
|
||||||
imgLink.href=image;
|
|
||||||
|
|
||||||
if (image.includes("i.ruqqus.ga")) {
|
|
||||||
linkText.textContent = 'Go to website';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
linkText.textContent = 'View original';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// When image modal is closed
|
|
||||||
|
|
||||||
$('#expandImageModal').on('hidden.bs.modal', function (e) {
|
|
||||||
|
|
||||||
// remove image src and link
|
|
||||||
|
|
||||||
document.getElementById("desktop-expanded-image").src = '';
|
|
||||||
|
|
||||||
document.getElementById("desktop-expanded-image-link").href = '';
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Text Formatting
|
// Text Formatting
|
||||||
|
|
||||||
// Bold Text
|
// Bold Text
|
||||||
|
@ -961,3 +926,16 @@ $('.expandable-image').click( function(event) {
|
||||||
|
|
||||||
expandDesktopImage(url,url);
|
expandDesktopImage(url,url);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$('.text-expand').click(function(event){
|
||||||
|
if (event.which != 1) {
|
||||||
|
return
|
||||||
|
};
|
||||||
|
id=$(this).data('id');
|
||||||
|
|
||||||
|
|
||||||
|
$('#post-text-'+id).toggleClass('d-none');
|
||||||
|
$('.text-expand-icon-'+id).toggleClass('fa-expand-alt');
|
||||||
|
$('.text-expand-icon-'+id).toggleClass('fa-compress-alt');
|
||||||
|
|
||||||
|
})
|
|
@ -3,18 +3,40 @@
|
||||||
<head>
|
<head>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$('.text-expand').click(function(event){
|
// Expand Images on Desktop
|
||||||
if (event.which != 1) {
|
|
||||||
return
|
function expandDesktopImage(image, link) {
|
||||||
|
|
||||||
|
// Link text
|
||||||
|
|
||||||
|
var linkText = document.getElementById("desktop-expanded-image-link");
|
||||||
|
var imgLink = document.getElementById("desktop-expanded-image-wrap-link");
|
||||||
|
|
||||||
|
var inlineImage = document.getElementById("desktop-expanded-image");
|
||||||
|
|
||||||
|
inlineImage.src = image.replace("100w.gif", "giphy.gif");
|
||||||
|
linkText.href = image;
|
||||||
|
imgLink.href=image;
|
||||||
|
|
||||||
|
if (image.includes("i.ruqqus.ga")) {
|
||||||
|
linkText.textContent = 'Go to website';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
linkText.textContent = 'View original';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
id=$(this).data('id');
|
|
||||||
|
|
||||||
|
// When image modal is closed
|
||||||
|
|
||||||
$('#post-text-'+id).toggleClass('d-none');
|
$('#expandImageModal').on('hidden.bs.modal', function (e) {
|
||||||
$('.text-expand-icon-'+id).toggleClass('fa-expand-alt');
|
|
||||||
$('.text-expand-icon-'+id).toggleClass('fa-compress-alt');
|
|
||||||
|
|
||||||
})
|
// remove image src and link
|
||||||
|
|
||||||
|
document.getElementById("desktop-expanded-image").src = '';
|
||||||
|
|
||||||
|
document.getElementById("desktop-expanded-image-link").href = '';
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
post_comment=function(fullname){
|
post_comment=function(fullname){
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue