]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
fixed as per review comments [#460]
authorAnna Sobiepanek <annaopensource at gmail.com>
Tue, 17 May 2011 18:13:17 +0000 (14:13 -0400)
committerAnna Sobiepanek <annaopensource at gmail.com>
Tue, 17 May 2011 18:13:17 +0000 (14:13 -0400)
plugins/openmap/popcorn.openmap.js
plugins/openmap/popcorn.openmap.unit.html
plugins/openmap/popcorn.openmap.unit.js

index 528f0338d414c8e89b4733473d0dca61b9836c00..ed3740f9491638c68ec1420b8fdf99cbdc313985 100644 (file)
@@ -1,5 +1,4 @@
 // PLUGIN: OPENMAP
-var openmapCallback;
 ( function ( Popcorn ) {
   
   /**
index 32e9d0bf87286430aef19e5c074b49ffeb28ff61..aa9dc9a83d2a2af13f7ae22c219220e103f14d2e 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-  <title>Popcorn API</title>
+  <title>Popcorn Open Map Test</title>
   <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
   <script src="../../test/qunit/qunit.js"></script>
   <!-- 
index bb9bc76437a35dffc66fe360192806db17a5ac4b..05000b69a529796c03811781a73a69610925ccab 100644 (file)
@@ -66,51 +66,40 @@ test( "Popcorn OpenMap Plugin", function () {
 
   setupId = popped.getLastTrackEventId();
 
- 
   popped.exec( 4, function() {
-    if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok(OpenLayers, "OpenLayers is available");
-      plus();
-      ok (document.getElementById('openmapdiv1'), "First map is on the page" );
-      plus();
-      equals (document.getElementById('openmapdiv1').offsetParent.id, "map", "First map is inside the 'map' div" );
-      plus();
-    }
-  } );
-  popped.exec( 4, function() {
-    if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok (document.getElementById('openmapdiv2'), "Second map is on the page" );
-      plus();
-      equals (document.getElementById('openmapdiv2').offsetParent.id, "map2", "Second map is inside the 'map2' div" );
-      plus();
-    }
-  } );
-  popped.exec( 4, function() {
-    if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok (document.getElementById('openmapdiv3'), "Third map is on the page" );
-      plus();
-      equals (document.getElementById('openmapdiv3').offsetParent.id, "map3", "Third map is inside the 'map3' div" );
-      plus();
-    }
-  } );
-  popped.exec( 4, function() {
-    if( popped.currentTime() > 3 && popped.currentTime() <= 5 ) {
-      ok (document.getElementById('openmapdiv4'), "Fourth map is on the page" );
-      plus();
-      equals (document.getElementById('openmapdiv4').offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
-      plus();
-    }
-  } );
-  popped.exec( 6, function() {
-    if( popped.currentTime() > 5  ) {
-      ok (document.getElementById('openmapdiv2').style.display === "none" && 
-          document.getElementById('openmapdiv3').style.display === "none" && 
-          document.getElementById('openmapdiv4').style.display === "none" &&
-          document.getElementById('openmapdiv1').style.display === "none", "All three maps are no longer visible" );
-      plus();
-      popped.pause().removeTrackEvent( setupId );
-      ok( !document.getElementById('actualmap3'), "removed map was properly destroyed" );
-      plus();
-    }
+    ok(OpenLayers, "OpenLayers is available");
+    plus();
+    ok (document.getElementById('openmapdiv1'), "First map is on the page" );
+    plus();
+    equals (document.getElementById('openmapdiv1').offsetParent.id, "map", "First map is inside the 'map' div" );
+    plus();
+  } )
+  .exec( 4, function() {
+    ok (document.getElementById('openmapdiv2'), "Second map is on the page" );
+    plus();
+    equals (document.getElementById('openmapdiv2').offsetParent.id, "map2", "Second map is inside the 'map2' div" );
+    plus();
+  } )
+  .exec( 4, function() {
+    ok (document.getElementById('openmapdiv3'), "Third map is on the page" );
+    plus();
+    equals (document.getElementById('openmapdiv3').offsetParent.id, "map3", "Third map is inside the 'map3' div" );
+    plus();
+  } )
+  .exec( 4, function() {
+    ok (document.getElementById('openmapdiv4'), "Fourth map is on the page" );
+    plus();
+    equals (document.getElementById('openmapdiv4').offsetParent.id, "map4", "Fourth map is inside the 'map4' div" );
+    plus();
+  } )
+  .exec( 6, function() {
+    ok (document.getElementById('openmapdiv2').style.display === "none" && 
+        document.getElementById('openmapdiv3').style.display === "none" && 
+        document.getElementById('openmapdiv4').style.display === "none" &&
+        document.getElementById('openmapdiv1').style.display === "none", "All three maps are no longer visible" );
+    plus();
+    popped.pause().removeTrackEvent( setupId );
+    ok( !document.getElementById('actualmap3'), "removed map was properly destroyed" );
+    plus();
   } );
 } );