m |
m |
||
Line 1: | Line 1: | ||
β | This widget allows you to [https://dev.twitter.com/ | + | <noinclude>__NOTOC__ |
+ | This widget allows you to '''[https://dev.twitter.com/docs/embedded-tweets embed a tweet]''' on your wiki page. | ||
β | + | Created by [https://www.mediawikiwidgets.org/User:Pablog Pablo Castellano]. | |
β | |||
β | + | == Using this widget == | |
β | + | For information on how to use this widget, see [https://www.mediawikiwidgets.org/Tweet widget description page on MediaWikiWidgets.org]. | |
β | |||
β | + | == Copy to your site == | |
β | + | To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''. | |
β | + | </noinclude><includeonly> | |
β | + | <!--{if isset($id)}--> | |
β | + | <!--{counter name="tweetcounter" assign="tweetincluded"}--> | |
β | + | <div id="twitter-<!--{$tweetincluded}-->-<!--{$id}-->"></div> | |
β | }}</ | + | <!--{if $tweetincluded eq 1}--> |
β | + | <script> | |
β | + | if (typeof window.twttr === 'undefined') { | |
β | + | window.twttr = (function (d,s,id) { | |
β | + | var t, js, fjs = d.getElementsByTagName(s)[0]; | |
β | + | if (d.getElementById(id)) return; js=d.createElement(s); js.id=id; | |
β | + | js.src="//platform.twitter.com/widgets.js"; | |
β | + | fjs.parentNode.insertBefore(js, fjs); | |
β | + | return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); | |
β | + | }(document, "script", "twitter-wjs")); | |
β | + | } | |
β | + | </script> | |
β | + | <!--{/if}--> | |
β | + | <script> | |
β | + | twttr.ready(function (twttr) { | |
β | + | twttr.widgets.createTweet( | |
β | + | "<!--{$id}-->", | |
β | + | document.getElementById("twitter-<!--{$tweetincluded}-->-<!--{$id}-->"), | |
β | + | { | |
β | + | align: <!--{if $align}-->'<!--{$align}-->'<!--{else}-->undefined<!--{/if}-->, | |
β | + | conversation: '<!--{if $conversation}--><!--{$conversation}--><!--{else}-->all<!--{/if}-->', | |
β | + | cards: '<!--{if $cards}--><!--{$cards}--><!--{else}-->visible<!--{/if}-->', | |
β | + | width: <!--{if $width}-->'<!--{$width}-->'<!--{else}-->undefined<!--{/if}-->, | |
β | { | + | linkColor: '<!--{if $linkColor}--><!--{$linkColor}--><!--{else}-->blue<!--{/if}-->', |
+ | theme: '<!--{if $theme}--><!--{$theme}--><!--{else}-->light<!--{/if}-->' | ||
+ | } | ||
+ | ); | ||
+ | }); | ||
+ | </script> | ||
+ | <!--{else}--> | ||
+ | <b style="color:red">No id supplied for Tweet!</b> | ||
+ | <!--{/if}--> | ||
+ | </includeonly> |
This widget allows you to embed a tweet on your wiki page.
Created by Pablo Castellano.
For information on how to use this widget, see widget description page on MediaWikiWidgets.org.
To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Tweet.