-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddo.json
13 lines (13 loc) · 924 Bytes
/
ddo.json
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"id" : "digitalDataObject",
"title": "Inspect the DDO",
"scripts": {
"alert" : {
"title": "Inspect DDO",
"button_label": "Inspect",
"description": "Gives details about the Digital Data Object.",
"template": "<h4>Digital Data Object</h4><table class ='table table-hover'><thead> <tr><td>Key</td><td>Value</td></tr><thead><tbody><tr>{{#each this}}<td>{{@key}}</td> <td>{{this}}</td></tr>{{/each}}<tbody></table>",
"js": "function recurse(r,e){if(Object(r)!==r)result[e]=r; else if(Array.isArray(r)){for(var t=0,u=r.length;t<u;t++)recurse(r[t],e+'['+t+']'); 0==u&&(result[e]=[])}else{var s=!0; for(var l in r)s=!1,recurse(r[l],e?e+'.'+l:l); s&&e&&(result[e]={})}}var result={}; recurse(window.digitalData,''); var output={}; Object.keys(result).forEach(function(r){result[r]&&(output[r]=result[r])}),tealiumTools.send(output)"
}
}
}