User Tools

Site Tools


web-integration:client-side

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
web-integration:client-side [2019/08/05 12:41]
tjotov [Advance methods]
web-integration:client-side [2019/08/05 12:46]
tjotov [Communication]
Line 161: Line 161:
 </sxh> </sxh>
  
-=== Redirect URL for iOS typically provided by server side controler ===+=== Redirect URL set by GUI === 
 +This is usuallly set by server side but can be also managed from client side. Server side has higher priority.
 <sxh java> <sxh java>
     aducid.setRedirectUrl = function(param) {     aducid.setRedirectUrl = function(param) {
Line 168: Line 169:
 </sxh> </sxh>
  
 +=== Error redirect URL set by GUI ===
 +This is usuallly set by server side but can be also managed from client side. Server side has higher priority.
 +<sxh java>
 +    aducid.setErrorPage = function(param) {
 +        errorPage = param;
 +    }
 +</sxh>
 +
 +=== Final action ===
 +What API should do when operation finishes (not processed on iOS as we use returnUrl directly there)
 +<sxh java>
 +    aducid.processResult = function(result) {
 +        alert(result);
 +    }
 +</sxh>
 +
 +=== Use push ===
 +Tell Web API if it should use push (QR code was used previously).
 +<sxh java>
 +    this.setPush = function(param) {
 +        push = param == true;
 +    }
 +</sxh>
 ==== UI methods ==== ==== UI methods ====
 === Tell server to generate QR / or not to reduce payload === === Tell server to generate QR / or not to reduce payload ===
Line 190: Line 214:
 </sxh> </sxh>
  
 +=== Button bound operation ===
 +<sxh java>
 +    aducid.setButton = function(param) {
 +        aducidButton = param;
 +        param.click(function() {
 +            if (currentRequest != null) instance.startOperation();
 +            else instance.init(true);
 +        });
 +    }
 +</sxh>
 +=== Text hint shown before operation started ===
 +<sxh java>
 +    aducid.showQRHint = function(param) {
 +        if (qrHint != null) qrHint.html(localize("aducid_common_authenticateComment"));
 +    }
 +</sxh>
  
 +=== How API can hide text hint ===
 +<sxh java>
 +    aducid.hideQRHint = function(param) {
 +        if (qrHint != null) qrHint.html("");
 +    }
 +
 +=== Text hint shown after operation started ===
 +<sxh java>
 +    aducid.showRunningHint = function(param) {
 +        if (qrHint != null) qrHint.html(localize("aducid_common_authenticationProgress"));
 +    }
 +</sxh>
 +
 +=== How API can hide text hint ===
 +<sxh java>
 +    aducid.hideRunningHint = function(param) {
 +        if (qrHint != null) qrHint.html("");
 +    }
 +</sxh>
 +=== Auxiliary method to animate operation in progress ===
 +<sxh java>
 +    aducid.startAnimation = function() {
 +        if (qrCode != null) {
 +            qrCode.show();
 +            qrCode.attr("src", "/aducid-resources/img/running.gif");
 +        }
 +    }
 +</sxh>
 +    
 +=== Stop animation ===
 +<sxh java>
 +    aducid.stopRunningAnimation = function() {
 +        if (qrCode == null) return;
 +        qrCode.hide();
 +    }
 +</sxh>
 ==== Advanced methods ==== ==== Advanced methods ====
 === Init Params === === Init Params ===
Line 231: Line 307:
     aducid.getSessionBinding = function() {     aducid.getSessionBinding = function() {
         return localStorage['session-binding'];         return localStorage['session-binding'];
-    } 
-</sxh> 
- 
- 
- 
-=== The most important method === 
-What API should do when operation finishes (not processed on iOS as we use returnUrl directly there) 
-<sxh java> 
-    aducid.processResult = function(result) { 
-        alert(result); 
     }     }
 </sxh> </sxh>
Line 248: Line 314:
     aducid.showPeigError = function() {     aducid.showPeigError = function() {
         alert("peig error - override this function")         alert("peig error - override this function")
-    } 
-</sxh> 
- 
-=== Auxiliary method to animate operation in progress === 
-<sxh java> 
-    aducid.startAnimation = function() { 
-        if (qrCode != null) { 
-            qrCode.show(); 
-            qrCode.attr("src", "/aducid-resources/img/running.gif"); 
-        } 
-    } 
-</sxh> 
-     
-=== Stop animation === 
-<sxh java> 
-    aducid.stopRunningAnimation = function() { 
-        if (qrCode == null) return; 
-        qrCode.hide(); 
     }     }
 </sxh> </sxh>
web-integration/client-side.txt · Last modified: 2020/02/29 10:53 by mpospisek