Merge branch 'wikiPlugin' into 0.3

This commit is contained in:
Anna Sobiepanek 2011-02-02 16:47:21 -05:00
Родитель 83e286e0c5 70274cee3b
Коммит 33ecf35d89
3 изменённых файлов: 25 добавлений и 21 удалений

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

@ -14,6 +14,7 @@
start: 0, // seconds
end: 10, // seconds
src: 'http://en.wikipedia.org/wiki/Cape_Town',
title: "this is an article",
target: 'wikidiv'
} )
.wikipedia({

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

@ -76,7 +76,7 @@ var wikiCallback;
options._link.setAttribute( 'href', options.src );
options._link.setAttribute( 'target', '_blank' );
// add the title of the article to the link
options._link.innerHTML = data.parse.displaytitle;
options._link.innerHTML = options.title || data.parse.displaytitle;
// get the content of the wiki article
options._desc = document.createElement( 'p' );
// get the article text and remove any special characters

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

@ -1,7 +1,7 @@
test("Popcorn wikipedia Plugin", function () {
var popped = Popcorn("#video"),
expects = 7,
expects = 9,
count = 0,
theArticle = document.getElementById('wikidiv'),
wikiInterval,
@ -30,6 +30,7 @@ test("Popcorn wikipedia Plugin", function () {
start: 5, // seconds
end: 10, // seconds
src: 'http://en.wikipedia.org/wiki/Cape_Town',
title: "this is an article",
target: 'wikidiv'
} )
.wikipedia({
@ -48,6 +49,8 @@ test("Popcorn wikipedia Plugin", function () {
plus();
equals (theArticle.childElementCount, 2, "wikidiv now contains two child elements" );
plus();
equals (theArticle.childElement[0].innerHTML, "this is an article", "wikidiv has the right title" );
plus();
equals (theArticle.childElement[1].innerHTML, "Cape Town metropolitan municipality. It is the provincial capital and primate city ...", "wikidiv has the right content" );
plus();
clearInterval( wikiInterval );