Use promise-based document loader.
authorDave Longley <dlongley@digitalbazaar.com>
Sun, 08 Sep 2013 02:20:11 -0400
changeset 1989 967c329d53d2
parent 1988 f5a4cac779dc
child 1990 441316f4700b
Use promise-based document loader.
playground/playground.js
--- a/playground/playground.js	Sun Sep 08 02:19:56 2013 -0400
+++ b/playground/playground.js	Sun Sep 08 02:20:11 2013 -0400
@@ -480,7 +480,7 @@
     // Add custom document loader that uses a context URL map.
     var jqueryDocumentLoader = jsonld.documentLoaders.jquery($);
     // FIXME: add UI to let users control and set context mapping
-    jsonld.documentLoader = function(url, callback) {
+    jsonld.documentLoader = function(url) {
       if(url in playground.contextMap) {
         $('#using-context-map').show();
         var modified = playground.contextMap[url];
@@ -496,7 +496,7 @@
           url = modified;
         }
       }
-      jqueryDocumentLoader(url, callback);
+      return jqueryDocumentLoader(url);
     };
 
     // set up buttons to load examples