Added plain text searching to Twitter plug-in, updates to support Opera [#792]

This commit is contained in:
Christopher De Cairos 2011-11-01 10:38:58 -04:00
Родитель d8975c5251 537c044e7c
Коммит 518f28db91
2 изменённых файлов: 64 добавлений и 5 удалений

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

@ -97,7 +97,6 @@
width = options.width || 250,
height = options.height || 200,
profile = /^@/.test( src ),
hash = /^#/.test( src ),
widgetOptions = {
version: 2,
// use this id to connect it to the div
@ -138,7 +137,7 @@
new TWTR.Widget( widgetOptions ).render().setUser( src ).start();
} else if ( hash ) {
} else {
widgetOptions.type = "search";
widgetOptions.search = src;

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

@ -8,13 +8,15 @@ test( "Popcorn Twitter Plugin", function() {
expect( expects );
Popcorn.plugin.debug = true;
function plus() {
if ( ++count === expects ) {
start();
}
}
stop();
stop( 20000 );
ok( "twitter" in popped, "twitter is a method of the popped instance" );
plus();
@ -40,14 +42,16 @@ test( "Popcorn Twitter Plugin", function() {
setupId = popped.getLastTrackEventId();
popped.exec( 1, function() {
ok( /display: inline;/.test( twitterdiv.innerHTML ), "Div contents are displayed" );
ok( /display: inline/.test( twitterdiv.innerHTML ), "Div contents are displayed" );
plus();
ok( /twtr-widget/.test( twitterdiv.innerHTML ), "A Twitter widget exists" );
plus();
});
popped.exec( 2, function() {
ok( /display: none;/.test( twitterdiv.innerHTML ), "Div contents are hidden again" );
ok( /display: none/.test( twitterdiv.innerHTML ), "Div contents are hidden again" );
plus();
popped.pause().removeTrackEvent( setupId );
@ -56,5 +60,61 @@ test( "Popcorn Twitter Plugin", function() {
});
popped.play();
});
test( "Popcorn Twitter Plugin", function() {
var popped = Popcorn( "#video" ),
expects = 4,
count = 0,
twitterdiv = document.getElementById( "twitterdiv" );
expect( expects );
Popcorn.plugin.debug = true;
function plus() {
if ( ++count === expects ) {
start();
}
}
stop( 20000 );
popped.twitter({
start: 4,
end: 5,
title: "bieber hash",
src: "#oilspill",
target: "twitterdiv"
});
popped.twitter({
start: 5,
end: 6,
title: "plain text search",
src: "processing.js",
target: "twitterdiv"
});
popped.exec( 4, function() {
ok( /display: inline/.test( twitterdiv.innerHTML ), "Div contents are displayed" );
plus();
ok( /twtr-widget/.test( twitterdiv.innerHTML ), "A Twitter widget exists" );
plus();
});
popped.exec( 5, function() {
ok( /display: inline/.test( twitterdiv.innerHTML ), "Div contents are displayed" );
plus();
ok( /twtr-widget/.test( twitterdiv.innerHTML ), "A Twitter widget exists" );
plus();
popped.pause();
});
popped.play( 4 );
});