diff static/add.js @ 21:8008ec2fd763

fix up link page reloading. tried davisjs; may not need it Ignore-this: d0021609f019f0734e779a61e3e73b62
author Drew Perttula <drewp@bigasterisk.com>
date Thu, 11 Jul 2013 00:45:55 -0700
parents 9fc1f5c8aa4e
children
line wrap: on
line diff
--- a/static/add.js	Sun Mar 17 01:03:43 2013 -0700
+++ b/static/add.js	Thu Jul 11 00:45:55 2013 -0700
@@ -69,10 +69,24 @@
             }
             console.log("from model", uris)
 
-            inputElem.select2("data", uris.map(
-                function (uri) {
-                    return {id: uri, text: "("+uri+")"};
-                }));
+            async.map(uris,
+                      function (uri, cb) {
+                          $.ajax({
+                              url: uri.replace(/^http:/, "https:"),
+                              dataType: "text",
+                              success: function (page) {
+                                  pp = page
+                                  d = $(page).rdfa().databank;
+                                  console.log("from", uri, "extracted", d.size(), "triples");
+                                  "trying to get the rdfa out of this page to attempt prettier label/icon for the listed person"
+                                  console.log(JSON.stringify(d.dump()));
+                              }
+                          });
+                          cb(null, {id: uri, text: "("+uri+")"});
+                      },
+                      function (err, selections) {
+                          inputElem.select2("data", selections);
+                      });
         });
 
     function setModelFromShares(n) {