Skip to content

Commit

Permalink
Switching to a more dynamic system of iFrame resizing for openshot.org
Browse files Browse the repository at this point in the history
  • Loading branch information
jonoomph committed Nov 30, 2022
1 parent be8cefd commit cf11f95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
4 changes: 2 additions & 2 deletions doc/_templates/footer.html
Expand Up @@ -18,7 +18,7 @@
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }} - <a href="http://www.openshot.org/">www.openshot.org</a>.{% endtrans %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }} - <a data-iframe-height href="http://www.openshot.org/">www.openshot.org</a>.{% endtrans %}
{%- endif %}
{%- endif %}

Expand Down Expand Up @@ -48,4 +48,4 @@

{%- block extrafooter %} {% endblock %}

</footer>
</footer>
17 changes: 3 additions & 14 deletions doc/_templates/layout.html
@@ -1,22 +1,11 @@
{% extends "!layout.html" %}
{% set css_files = css_files + ["_static/tablefix.css"] %}
{%- block footer %}
<script src="//cdn.openshot.org/static/vendor/iframeSizer/iframeResizer.contentWindow.min.js"></script>

This comment has been minimized.

Copy link
@ip1981

ip1981 Dec 11, 2022

Hitting external resources is bad for documentation which might be used offline.

<script>
$( document ).ready(function() {
console.log( "OpenShot Documentation page ready" );
const height = document.body.scrollHeight;
const href = location.href;
if (window.parent) {
location.href.includes('index.html')
window.parent.postMessage(
{height, href}
);
}
});

<!-- Adds target=_blank to external links -->
$(document).ready(function () {
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
<!-- Adds target=_blank to external links -->
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
});
</script>
{% endblock %}

0 comments on commit cf11f95

Please sign in to comment.