From 8bfa19c50fd97bff57fd15ec1f0859373614727b Mon Sep 17 00:00:00 2001 From: Anna Sobiepanek Date: Thu, 17 Mar 2011 16:16:44 -0400 Subject: [PATCH] added a throw if no src in options [#411] --- plugins/wikipedia/popcorn.wikipedia.js | 6 +++- readme.txt | 47 -------------------------- 2 files changed, 5 insertions(+), 48 deletions(-) delete mode 100644 readme.txt diff --git a/plugins/wikipedia/popcorn.wikipedia.js b/plugins/wikipedia/popcorn.wikipedia.js index 96f1b332..e0a50cf5 100644 --- a/plugins/wikipedia/popcorn.wikipedia.js +++ b/plugins/wikipedia/popcorn.wikipedia.js @@ -87,7 +87,11 @@ var wikiCallback; options._fired = true; }; - Popcorn.getScript("http://" + options.lang + ".wikipedia.org/w/api.php?action=parse&props=text&page=" + options.src.slice( options.src.lastIndexOf("/")+1) + "&format=json&callback=wikiCallback" + _guid); + if ( options.src ) { + Popcorn.getScript("http://" + options.lang + ".wikipedia.org/w/api.php?action=parse&props=text&page=" + options.src.slice( options.src.lastIndexOf("/")+1) + "&format=json&callback=wikiCallback" + _guid); + } else { + throw ("Wikipedia plugin needs a 'src'"); + } }, /** diff --git a/readme.txt b/readme.txt deleted file mode 100644 index aaf8ded2..00000000 --- a/readme.txt +++ /dev/null @@ -1,47 +0,0 @@ -## What is Popcorn.js? ## -An open source JavaScript library which connects and synchronizes the