]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
added a throw if no src in options [#411]
authorAnna Sobiepanek <annaopensource@gmail.com>
Thu, 17 Mar 2011 20:16:44 +0000 (16:16 -0400)
committerAnna Sobiepanek <annaopensource@gmail.com>
Thu, 17 Mar 2011 20:16:44 +0000 (16:16 -0400)
plugins/wikipedia/popcorn.wikipedia.js
readme.txt [deleted file]

index 96f1b332dff39e04d6c0c1468e1b0b7e078e63c5..e0a50cf510de40880703e6324d694d2f378d24f1 100644 (file)
@@ -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 (file)
index aaf8ded..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-## What is Popcorn.js? ##
-An open source JavaScript library which connects and synchronizes the <video> tag to other resources, such as these maps.
-
-* Project page: https://wiki.mozilla.org/PopcornOpenVideoAPI
-
-* Source code on Github: https://github.com/annasob/popcorn-js/
-
-## What does the OpenMap plugin add? ##
-You can add clickable markers with custom icons
-
-As an alternative to Google Maps, the OpenMap plugin offers:
-
-* An interactive map using OpenLayers.js - free, open source, and compatible with many mapping formats - http://openlayers.org
-
-* ROADMAP using OpenStreetMap - a free, open data source which is editable by anyone.  Due to its free license, it has received data from many governmental, commercial, and academic sources.  Editors can use Yahoo and Bing Maps to trace information onto the map.  In many parts of the world, OpenStreetMap has better coverage and more up-to-date data than major providers such as Google Maps.  - http://opensteetmap.org
-
-* SATELLITE using NASA Landsat / World Wind - satellite images in the public domain
-
-* TERRAIN using USGS Topographic Maps in the public domain
-
-## Sample code for Popcorn.js ##
-popped.openmap({
-  start: 0,
-  end: 15,
-  type: 'ROADMAP', // OpenStreetMap
-  target: 'map',
-  lat: 43.665429,
-  lng: -79.403323,
-  zoom: 10
-})
-.openmap( {
-  start: 0,
-  end: 30,
-  type: 'SATELLITE', // NASA World Wind / LANDSAT
-  target: 'map2',
-  location: 'Boston, MA',
-  zoom: 9,
-  markers: [
-    {
-      lat: 42.358544,
-      lng: -71.05957,
-      icon: 'http://google-maps-icons.googlecode.com/files/vegetarian.png',
-      text: 'Clickable markers',
-      size: 10
-    }
-  ]
-});
\ No newline at end of file