// Fingerprint app // =============================================== // Takes in data obj, an element to append to, and utility functions // // Data is a boolean // - true: fingerprint safari and mobile users using their UA // - false: create a new uuid for safari / mobile users // // Example data: // true // var fingerprint = (function(){ 'use strict' var template = getTemplate(); function newFingerprint(d, t, fns){ return new Fingerprint(d, t, fns); } function Fingerprint(d, t, fns){ var e = getElementFromString(template, fns.getAppName('fingerprint')), row = new ToggleRow(e, updateToggle, { 'status' : d.status, 'headerClass' : 'medium', 'removeAppFn' : removeAction }), eles = new Elements(e, { 'status': { 'target' : row }, }); this.exit = exit; t.appendChild(e); function updateToggle(e){ d.status = e; } function removeAction(e){ fns.removeApp("fingerprint"); } function exit(){ if(!!e) removeChild(t, e); if(!!eles) eles.exit(); e = eles = null; } } function getTemplate(){ return '

{{ . }}:

'; } return newFingerprint; })();