Skip to content

Commit 1862ede

Browse files
authored
Merge pull request #5012 from OpenShot/fix-user-guide-javascript
Switching to a more dynamic system of iFrame resizing for openshot.org
2 parents 311e0b9 + cf11f95 commit 1862ede

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

doc/_templates/footer.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{%- if hasdoc('copyright') %}
1919
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
2020
{%- else %}
21-
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }} - <a href="http://www.openshot.org/">www.openshot.org</a>.{% endtrans %}
21+
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }} - <a data-iframe-height href="http://www.openshot.org/">www.openshot.org</a>.{% endtrans %}
2222
{%- endif %}
2323
{%- endif %}
2424

@@ -48,4 +48,4 @@
4848

4949
{%- block extrafooter %} {% endblock %}
5050

51-
</footer>
51+
</footer>

doc/_templates/layout.html

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
{% extends "!layout.html" %}
22
{% set css_files = css_files + ["_static/tablefix.css"] %}
33
{%- block footer %}
4+
<script src="//cdn.openshot.org/static/vendor/iframeSizer/iframeResizer.contentWindow.min.js"></script>
45
<script>
56
$( document ).ready(function() {
6-
console.log( "OpenShot Documentation page ready" );
7-
const height = document.body.scrollHeight;
8-
const href = location.href;
9-
if (window.parent) {
10-
location.href.includes('index.html')
11-
window.parent.postMessage(
12-
{height, href}
13-
);
14-
}
15-
});
16-
17-
<!-- Adds target=_blank to external links -->
18-
$(document).ready(function () {
19-
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
7+
<!-- Adds target=_blank to external links -->
8+
$('a[href^="http://"], a[href^="https://"]').not('a[class*=internal]').attr('target', '_blank');
209
});
2110
</script>
2211
{% endblock %}

0 commit comments

Comments
 (0)