Mercurial > code > home > repos > href
comparison 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 |
comparison
equal
deleted
inserted
replaced
20:a8887fb93676 | 21:8008ec2fd763 |
---|---|
67 if (!enableModel) { | 67 if (!enableModel) { |
68 return; | 68 return; |
69 } | 69 } |
70 console.log("from model", uris) | 70 console.log("from model", uris) |
71 | 71 |
72 inputElem.select2("data", uris.map( | 72 async.map(uris, |
73 function (uri) { | 73 function (uri, cb) { |
74 return {id: uri, text: "("+uri+")"}; | 74 $.ajax({ |
75 })); | 75 url: uri.replace(/^http:/, "https:"), |
76 dataType: "text", | |
77 success: function (page) { | |
78 pp = page | |
79 d = $(page).rdfa().databank; | |
80 console.log("from", uri, "extracted", d.size(), "triples"); | |
81 "trying to get the rdfa out of this page to attempt prettier label/icon for the listed person" | |
82 console.log(JSON.stringify(d.dump())); | |
83 } | |
84 }); | |
85 cb(null, {id: uri, text: "("+uri+")"}); | |
86 }, | |
87 function (err, selections) { | |
88 inputElem.select2("data", selections); | |
89 }); | |
76 }); | 90 }); |
77 | 91 |
78 function setModelFromShares(n) { | 92 function setModelFromShares(n) { |
79 console.log("from val", inputElem.select2("val"), "new", n) | 93 console.log("from val", inputElem.select2("val"), "new", n) |
80 enableModel = false; | 94 enableModel = false; |