diff options
-rw-r--r-- | _projectCommon.php | 10 | ||||
-rw-r--r-- | emf/_projectCommon.php | 11 |
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>'); |