Skip to content

Commit be8cefd

Browse files
committed
Improve user guide embedded javascript, to communicate back to openshot.org/user-guide correctly. Since we are hosting these docs on a cdn, this is the only secure way to resize the contents of these docs inside an iframe. Also, making external links use target _blank
1 parent 504debc commit be8cefd

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)