This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
integration-api:example [2018/08/21 15:07] tjotov |
integration-api:example [2018/08/21 15:08] tjotov |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Web Integration API - Example ====== | ====== Web Integration API - Example ====== | ||
- | < | + | <script type=" |
- | < | + | |
- | <html xmlns=" | + | |
- | < | + | |
- | <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(); | + | <button id=" |
- | }); | + | </ |
- | </ | + | <img id=" |
- | </ | + | <div id=" |
- | < | + | |
- | + | </ | |
- | < | + | </ |
- | < | + | |
- | <button id=" | + | |
- | </ | + | |
- | <img id=" | + | |
- | <div id=" | + | |
- | + | ||
- | </ | + | |
- | </html> | + | |
- | + | ||
- | </code> | + |