Load widgets.js only in case consent has been given
diff --git a/emfforms/index.html b/emfforms/index.html
index a50f670..c4a4cf9 100644
--- a/emfforms/index.html
+++ b/emfforms/index.html
@@ -16,7 +16,6 @@
<script src="public/javascripts/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="public/javascripts/bootstrap.js" type="text/javascript"></script>
- <script src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script src="public/javascripts/common.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="//www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css" />
<script src="public/javascripts/cookieconsent.js" type="text/javascript"></script>
@@ -447,11 +446,17 @@
(function(w) {
w.cookieconsent.init(function() {
if (getCookie("eclipse_cookieconsent_status") === "allow") {
- createTimeline();
+ $.getScript(
+ "https://platform.twitter.com/widgets.js",
+ function () { createTimeline() }
+ );
}
});
if (getCookie("eclipse_cookieconsent_status") === "allow") {
- createTimeline();
+ $.getScript(
+ "https://platform.twitter.com/widgets.js",
+ function() { createTimeline() }
+ );
}
})(window)
</script>
diff --git a/index.html b/index.html
index 9f7e3fc..9f40ea9 100644
--- a/index.html
+++ b/index.html
@@ -15,7 +15,6 @@
<script src="public/javascripts/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="public/javascripts/bootstrap.js" type="text/javascript"></script>
- <script src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<script src="public/javascripts/common.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="//www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css" />
<script src="public/javascripts/cookieconsent.js" type="text/javascript"></script>
@@ -528,11 +527,17 @@
(function(w) {
w.cookieconsent.init(function() {
if (getCookie("eclipse_cookieconsent_status") === "allow") {
- createTimeline();
+ $.getScript(
+ "https://platform.twitter.com/widgets.js",
+ function () { createTimeline() }
+ );
}
});
if (getCookie("eclipse_cookieconsent_status") === "allow") {
- createTimeline();
+ $.getScript(
+ "https://platform.twitter.com/widgets.js",
+ function() { createTimeline() }
+ );
}
})(window)
</script>