embedded.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. include '../auth.php';
  3. ?>
  4. <html>
  5. <head>
  6. <title>Image Viewer</title>
  7. <script src="../script/jquery.min.js"></script>
  8. <link rel="stylesheet" href="../script/tocas/tocas.css">
  9. <script type='text/javascript' src="../script/tocas/tocas.js"></script>
  10. </head>
  11. <body style="background:rgba(34,34,34,1);overflow:hidden;">
  12. <img id="display" src="<?php echo $_GET['filepath'];?>" style="object-fit: scale-down !important;max-width:100%;height:98%;"></img>
  13. <script>
  14. var imageWidth = $('#display').css('width').replace("px","");
  15. var imageHeight = $('#display').css('height').replace("px","");
  16. var inVDI = !(!parent.isFunctionBar);
  17. var displayName = "<?php echo $_GET['filename'];?>";
  18. $(window).resize(function() {
  19. clearTimeout(window.resizedFinished);
  20. window.resizedFinished = setTimeout(function(){
  21. //Resize finish, adjust the css accordingly
  22. adjustImgWidth();
  23. }, 100);
  24. });
  25. function adjustImgWidth(){
  26. var vw = $('#display').width();
  27. var sw = $( window ).width();
  28. var center = parseInt((sw - vw) / 2);
  29. $('#display').css("left",center);
  30. }
  31. $(document).ready(function(){
  32. setTimeout(function(){adjustImgWidth();}, 100);
  33. if (inVDI){
  34. //If it is currently in VDI, force the current window size and resize properties
  35. var windowID = $(window.frameElement).parent().attr("id");
  36. parent.setWindowIcon(windowID + "","file image outline");
  37. parent.changeWindowTitle(windowID + "",displayName);
  38. }
  39. });
  40. </script>
  41. </body>
  42. </html>