Merge commit 'a131fcceab7' into 0.2

This commit is contained in:
Anna Sobiepanek 2011-01-10 16:49:06 -05:00
Родитель 655a65c77b a131fcceab
Коммит e06cf709d6
2 изменённых файлов: 30 добавлений и 14 удалений

Просмотреть файл

@ -4,10 +4,7 @@
<title>Popcorn Twitter Plug-in Demo</title>
<script src="../../popcorn.js"></script>
<!--
script "http://widgets.twimg.com/j/2/widget.js" is needed for the Twitter widget
-->
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script src="popcorn.twitter.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
@ -33,7 +30,6 @@
</head>
<body>
<h1 id="qunit-header">Popcorn Twitter Plug-in Demo</h1>
<p>A script src="http://widgets.twimg.com/j/2/widget.js" must be loaded before popcorn.twitter.js</p>
<p>Twitter profile '@stevesong' widget will appear at 5 seconds and disappear at 15 seconds.</p>
<p>More Twitter hash '#oilspill' widget will appear at 20 seconds and disappear at 45 seconds.</p>
<div>

Просмотреть файл

@ -29,6 +29,16 @@
} )
*
*/
if ( !window.TWTR ) {
var head = document.getElementsByTagName("head")[0] || document.documentElement,
script = document.createElement("script");
script.src = "http://widgets.twimg.com/j/2/widget.js";
head.insertBefore( script, head.firstChild );
}
Popcorn.plugin( "twitter" , {
manifest: {
@ -93,21 +103,31 @@
};
// create widget
if ( profile ) {
var isReady = function( that ) {
if ( window.TWTR ) {
if ( profile ) {
widgetOptions.type = "profile";
widgetOptions.type = "profile";
new TWTR.Widget( widgetOptions ).render().setUser( src ).start();
new TWTR.Widget( widgetOptions ).render().setUser( src ).start();
} else if ( hash ) {
} else if ( hash ) {
widgetOptions.type = "search";
widgetOptions.search = src;
widgetOptions.subject = src;
widgetOptions.type = "search";
widgetOptions.search = src;
widgetOptions.subject = src;
new TWTR.Widget( widgetOptions ).render().start();
new TWTR.Widget( widgetOptions ).render().start();
}
}
} else {
setTimeout( function() {
isReady( that );
}, 1);
}
};
isReady( this );
},
/**