Skip to content

Commit 311e0b9

Browse files
authored
Merge pull request #5010 from OpenShot/fix-user-guide-javascript
Improve user-guide embedded javascript (resize iFrame, external link targets)
2 parents e4c7797 + be8cefd commit 311e0b9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

doc/_templates/layout.html

+20
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
{% extends "!layout.html" %}
22
{% set css_files = css_files + ["_static/tablefix.css"] %}
3+
{%- block footer %}
4+
<script>
5+
$( 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');
20+
});
21+
</script>
22+
{% endblock %}

0 commit comments

Comments
 (0)