Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Helming2018-05-29 12:04:45 -0400
committerJonas Helming2018-05-29 12:04:45 -0400
commit6e34e1b17cf8bf88a77288faf4371b60d3ed6971 (patch)
tree70e41025f0de3e3e5582c214ace9bd8aa388654e
parentcdf467a73ad9e32b52c697491d89530d6c720489 (diff)
downloadmodeling-6e34e1b17cf8bf88a77288faf4371b60d3ed6971.tar.gz
modeling-6e34e1b17cf8bf88a77288faf4371b60d3ed6971.tar.xz
modeling-6e34e1b17cf8bf88a77288faf4371b60d3ed6971.zip
Removed static loading of Twitter Script
-rw-r--r--_projectCommon.php10
-rw-r--r--emf/_projectCommon.php11
2 files changed, 17 insertions, 4 deletions
diff --git a/_projectCommon.php b/_projectCommon.php
index 0a4cd85d..6c904d3e 100644
--- a/_projectCommon.php
+++ b/_projectCommon.php
@@ -56,7 +56,7 @@ $Nav->addCustomNav("Mailing Lists", "http://www.eclipse.org/mail/index_project.p
$App->AddExtraHtmlHeader('<meta name="twitter:dnt" content="on">');
$App->AddExtraHtmlHeader("<link rel=\"stylesheet\" type=\"text/css\" href=\"/modeling/includes/common.css\"/>\n");
-$App->AddExtraHtmlHeader('<script src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>');
+
$App->AddExtraHtmlHeader('<script>
// via https://stackoverflow.com/questions/5968196/check-cookie-if-cookie-exists
function getCookie(name) {
@@ -78,6 +78,14 @@ return decodeURI(dc.substring(begin + prefix.length, end));
}
function createTimeline() {
+ $.getScript(
+ "https://platform.twitter.com/widgets.js",
+ function () { createWidget() }
+ );
+}
+
+
+function createWidget() {
var twitterContainer = document.getElementById("twitter-timeline");
twttr.widgets.createTimeline(
"503883842478809088",
diff --git a/emf/_projectCommon.php b/emf/_projectCommon.php
index e284d724..aee2e9f8 100644
--- a/emf/_projectCommon.php
+++ b/emf/_projectCommon.php
@@ -123,7 +123,6 @@ $App->AddExtraHtmlHeader('<meta name="twitter:dnt" content="on">');
$App->AddExtraHtmlHeader("<link rel=\"stylesheet\" type=\"text/css\" href=\"/modeling/includes/common.css\"/>\n");
-$App->AddExtraHtmlHeader('<script src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>');
$App->AddExtraHtmlHeader('<script>
// via https://stackoverflow.com/questions/5968196/check-cookie-if-cookie-exists
function getCookie(name) {
@@ -145,6 +144,14 @@ return decodeURI(dc.substring(begin + prefix.length, end));
}
function createTimeline() {
+ $.getScript(
+ "https://platform.twitter.com/widgets.js",
+ function () { createWidget() }
+ );
+}
+
+
+function createWidget() {
var twitterContainer = document.getElementById("twitter-timeline");
twttr.widgets.createTimeline(
"503883842478809088",
@@ -155,8 +162,6 @@ twttr.widgets.createTimeline(
);
twitterContainer.innerText = "";
}
-
-
</script>');

Back to the top