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
Next 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:44]
tjotov [Communication]
Line 168: Line 168:
 </sxh> </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 205:
 </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 298:
     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 305:
     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