/* * Wise API * * Copyright © 2016 Fogwise AB * * Installation: * * Add this script tag to your website: * * * * Usage: * * 1. Dialpad * * When Wise Dialer is used in Manual mode, it is possible to set the dialpad with a number. * If the dialpad is closed when this function is called, the dialpad will slide open. * A user may then click on the dialpad's Call button to begin dialing. * * Run: * * wise.dialpad.setNumber ("+telephone"); * * 2. Timestamp * * Save a timestamp when a user enters a page. * Timestamps will then be available in a list with time offsets into recorded files for * easier listening. * * Run: * * wise.timestamp ("page name"); * */ var wise = wise || {}; wise.dialpad = { setNumber: function (number) { method = "wise.api.dialpad.setNumber"; console.log(method + ": " + number); wise.api.call(method, number); } }; wise.timestamp = function (label) { var date = new Date().toISOString(); method = "wise.api.timestamp"; console.log(method + ": " + date + "|" + label); wise.api.call(method, date + "|" + label); } wise.api = { call: function (method, argument) { console.log("wise.api.call: " + method + "(" + argument + ")"); top.window.postMessage(method + "#" + argument, "*"); } };