// Checking if the css file is already included
for ( ; k < len; k++ ){
- if ( links[ k ].href == "http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css" ) {
+ if ( links[ k ].href === "http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css" ) {
dontLoad = true;
}
}
}
};
+ // Default to vertical orientation if empty or incorrect input
+ if( !options.orientation || ( options.orientation.toLowerCase() !== "vertical" &&
+ options.orientation.toLowerCase() !== "horizontal" ) ) {
+ options.orientation = "vertical";
+ }
+
newdiv.style.display = "none";
newdiv.id = "_feed" + i;
newdiv.style.width = "100%";
*/
start: function( event, options ){
newdiv.setAttribute( "style", "display:inline" );
- // Default to vertical orientation if empty or incorrect input
- if( !options.orientation || ( options.orientation.toLowerCase() !== "vertical" &&
- options.orientation.toLowerCase() !== "horizontal" ) ) {
- options.orientation = "vertical";
- }
},
/**
* @member webpage
},
options: {
start: {
- elem:"input",
- type:"text",
- label:"In"
+ elem: "input",
+ type: "text",
+ label: "In"
},
end: {
- elem:"input",
- type:"text",
- label:"Out"
+ elem: "input",
+ type: "text",
+ label: "Out"
},
target: "feed-container",
url: {
- elem:"input",
- type:"text",
- label:"url"
+ elem: "input",
+ type: "text",
+ label: "url"
},
title: {
- elem:"input",
- type:"text",
- label:"title"
+ elem: "input",
+ type: "text",
+ label: "title"
},
orientation: {
- elem:"select",
- options:["Vertical","Horizontal"],
- label:"orientation"
+ elem: "select",
+ options: [ "Vertical","Horizontal" ],
+ label: "orientation"
}
}
});
test("Popcorn Google Feed Plugin", function () {
- var popped = Popcorn("#video"),
- expects = 11,
+ var popped = Popcorn( "#video" ),
+ expects = 12,
setupId,
count = 0;
expect(expects);
function plus() {
- if ( ++count===expects) {
+ if ( ++count === expects) {
start();
}
}
stop();
- ok ('googlefeed' in popped, "googlefeed is a method of the popped instance");
+ ok ( 'googlefeed' in popped, "googlefeed is a method of the popped instance" );
plus();
ok ( document.getElementById('feed').innerHTML === "", "initially, there is nothing inside the feed" );
plus();
target: "feed",
url: "http://zenit.senecac.on.ca/~chris.tyler/planet/rss20.xml",
title: "Planet Feed",
- orientation: "Vertical"
})
.googlefeed({
start: 2, // seconds
setupId = popped.getLastTrackEventId();
popped.exec( 1, function() {
- ok(google.load, "Google Feed is available");
+ ok( google.load, "Google Feed is available");
plus();
- ok(GFdynamicFeedControl, "Dynamic Feed Control Available");
+ ok( GFdynamicFeedControl, "Dynamic Feed Control Available");
plus();
- ok (document.getElementById('_feed1'), "First feed is on the page" );
+ ok ( document.getElementById('_feed1'), "First feed is on the page" );
plus();
- equals (document.getElementById('_feed1').offsetParent.id, "feed", "First feed is inside the 'feed' div" );
+ equals ( document.getElementById('_feed1').offsetParent.id, "feed", "First feed is inside the 'feed' div" );
+ plus();
+ equals( popped.data.trackEvents.byStart[1].orientation, "vertical", "Defaulting to vertical orientation" );
plus();
});
popped.exec( 2, function() {
- ok (document.getElementById('_feed2'), "Second feed is on the page" );
+ ok ( document.getElementById('_feed2'), "Second feed is on the page" );
plus();
- equals (document.getElementById('_feed2').offsetParent.id, "feed1", "Second feed is inside the 'feed2' div" );
+ equals ( document.getElementById('_feed2').offsetParent.id, "feed1", "Second feed is inside the 'feed2' div" );
plus();
});
popped.exec( 3, function() {
- ok (document.getElementById('_feed2').style.display === "none" &&
+ ok ( document.getElementById('_feed2').style.display === "none" &&
document.getElementById('_feed1').style.display === "none", "Both feeds are no lnger visible" );
plus();