This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
integration-api:example [2018/08/21 15:07] tjotov created |
integration-api:example [2018/08/21 15:09] tjotov |
||
---|---|---|---|
Line 2: | Line 2: | ||
- | <!DOCTYPE html> | + | <script type=" |
- | <html xmlns="http://www.w3.org/1999/xhtml" | + | var aducid |
- | < | + | $(document).ready(function() { |
- | <script type="text/ | + | aducid.setAuthentication(); |
- | <script type="text/javascript" | + | aducid.setStartOperationUrl("/aducid-binder/open" |
+ | aducid.setResultOperationUrl("/ | ||
+ | aducid.setProxyUrl(" | ||
+ | aducid.setRedirectUrl("/ | ||
+ | aducid.processResult = function(result) { | ||
+ | if (result.status == "OK" | ||
+ | alert(" | ||
+ | location.href | ||
+ | } | ||
+ | else { | ||
+ | alert("Error - status: | ||
+ | location.href | ||
+ | } | ||
+ | } | ||
+ | |||
+ | //handle PEIG not installed error | ||
+ | aducid.showPeigError = function() { | ||
+ | alert("peig not found or other error" | ||
+ | } | ||
+ | |||
+ | | ||
+ | | ||
+ | alert(e.data.message); | ||
+ | } | ||
+ | |||
+ | aducid.showQRHint = function(param) { | ||
+ | $('#qr-code-hint' | ||
+ | } | ||
+ | |||
+ | aducid.showRunningHint = function(param) { | ||
+ | $('# | ||
+ | }; | ||
+ | |||
+ | | ||
+ | aducid.setButton($("# | ||
+ | aducid.setQrCode($("# | ||
+ | aducid.setQrHint($("# | ||
+ | |||
+ | //start | ||
+ | aducid.init(); | ||
+ | }); | ||
+ | </ | ||
+ | </head> | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | <img id="qr-code" | ||
+ | <div id="qr-code-hint"></ | ||
+ | |||
+ | </ | ||
+ | </html> | ||
- | |||
- | <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=" | ||
- | |||
- | </ | ||
- | </ | ||