This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
integration-api:example [2018/08/21 15:09] tjotov |
integration-api:example [2018/08/21 15:12] tjotov |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Web Integration API - Example ====== | ====== Web Integration API - Example ====== | ||
+ | <code html> | ||
- | <script type="text/ | + | <html xmlns="http://www.w3.org/1999/xhtml" |
- | var aducid = new ADUCID(); | + | |
- | $(document).ready(function() { | + | |
- | aducid.setAuthentication(); | + | |
- | aducid.setStartOperationUrl("/ | + | |
- | aducid.setResultOperationUrl("/ | + | |
- | aducid.setProxyUrl("/ | + | |
- | aducid.setRedirectUrl("/ | + | |
- | aducid.processResult = function(result) { | + | |
- | if (result.status == " | + | |
- | alert(" | + | |
- | location.href = result.redirect; | + | |
- | } | + | |
- | else { | + | |
- | alert(" | + | |
- | location.href = result.redirect; | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | | + | |
- | aducid.showPeigError = function() { | + | |
- | alert(" | + | |
- | } | + | |
- | + | ||
- | //handle communication or other error | + | |
- | aducid.handleError = function(e) { | + | |
- | alert(e.data.message); | + | |
- | } | + | |
- | + | ||
- | aducid.showQRHint = function(param) { | + | |
- | $('# | + | |
- | } | + | |
- | + | ||
- | aducid.showRunningHint = function(param) { | + | |
- | $('# | + | |
- | }; | + | |
- | + | ||
- | | + | |
- | aducid.setButton($("# | + | |
- | aducid.setQrCode($("# | + | |
- | aducid.setQrHint($("# | + | |
- | + | ||
- | //start | + | |
- | aducid.init(); | + | |
- | }); | + | |
- | </ | + | |
- | </ | + | |
- | < | + | |
- | + | ||
- | < | + | |
- | < | + | |
- | < | + | |
- | </ | + | |
- | <img id=" | + | |
- | <div id=" | + | |
- | + | ||
- | </ | + | |
- | </html> | + | |
+ | < | ||
+ | <script type=" | ||
+ | <script type=" | ||
+ | <script type=" | ||
+ | var aducid = new ADUCID(); | ||
+ | $(document).ready(function() { | ||
+ | aducid.setAuthentication(); | ||
+ | aducid.setStartOperationUrl("/ | ||
+ | aducid.setResultOperationUrl("/ | ||
+ | aducid.setProxyUrl("/ | ||
+ | aducid.setRedirectUrl("/ | ||
+ | aducid.processResult = function(result) { | ||
+ | if (result.status == " | ||
+ | alert(" | ||
+ | location.href = result.redirect; | ||
+ | } | ||
+ | else { | ||
+ | alert(" | ||
+ | location.href = result.redirect; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | //handle PEIG not installed error | ||
+ | aducid.showPeigError = function() { | ||
+ | alert(" | ||
+ | } | ||
+ | |||
+ | //handle communication or other error | ||
+ | aducid.handleError = function(e) { | ||
+ | alert(e.data.message); | ||
+ | } | ||
+ | |||
+ | aducid.showQRHint = function(param) { | ||
+ | $('# | ||
+ | } | ||
+ | |||
+ | aducid.showRunningHint = function(param) { | ||
+ | $('# | ||
+ | }; | ||
+ | |||
+ | //GUI mapping | ||
+ | aducid.setButton($("# | ||
+ | aducid.setQrCode($("# | ||
+ | aducid.setQrHint($("# | ||
+ | |||
+ | //start | ||
+ | aducid.init(); | ||
+ | }); | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <img id=" | ||
+ | <div id=" | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | </ |