diff --git a/ruqqus/assets/js/all_js.js b/ruqqus/assets/js/all_js.js index da6fe04ba..fa2e15af2 100644 --- a/ruqqus/assets/js/all_js.js +++ b/ruqqus/assets/js/all_js.js @@ -751,41 +751,6 @@ myId = getId(myUrl); $('#ytEmbed').html(''); -// 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 // Bold Text @@ -960,4 +925,17 @@ $('.expandable-image').click( function(event) { var url= $(this).data('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'); + }) \ No newline at end of file diff --git a/ruqqus/templates/default.html b/ruqqus/templates/default.html index 497b33c15..1926257f0 100644 --- a/ruqqus/templates/default.html +++ b/ruqqus/templates/default.html @@ -3,18 +3,40 @@