Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Commit a3ffb57

Browse files
author
Ian Maffett
committed
Add docs for lock screen plugin
1 parent f824f96 commit a3ffb57

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

docs/plugins/af.lockscreen.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#Lockscreen
2+
3+
The lockscreen enables developers of hybrid apps to present a lock screen to users.
4+
Users are required to enter a 4 digit pin to unlock it. This can easily be bypassed
5+
on web browsers
6+
7+
```
8+
$(document.body).lockScreen(opts)
9+
```
10+
11+
## Properties
12+
13+
#### Attributes
14+
You can object of options
15+
16+
```
17+
logo (string) image to show above password box
18+
roundKeyboard (boolean) When set to true, rounded keys are shown
19+
20+
21+
```
22+
23+
#### Functions
24+
25+
```
26+
renderKeyboard(function) Function to render the keyboard. This returns a string
27+
validatePassword(function) Function to validate the password. It accepts a string and returns a boolean
28+
29+
30+
```
31+
32+
33+
## Methods
34+
```
35+
show () Show the lockscreen
36+
hide () Hide the lockscreen
37+
```
38+
39+
## Events
40+
```
41+
none
42+
```
43+
44+
## Examples
45+
46+
Here are two examples. The first shows the lock screen. The second uses the cordova device pause/resume events to show it
47+
48+
```
49+
var lock=$(document.body).lockScreen();
50+
lock.validatePassword=function(pass){
51+
pass=parseInt(pass,10);
52+
return pass==1111;
53+
}
54+
lock.show();
55+
```
56+
57+
Now we force showing on the cordova device pause/resume events
58+
59+
```
60+
61+
function showLockScreen(){
62+
var lock=$(document.body).lockScreen();
63+
lock.validatePassword=function(pass){
64+
pass=parseInt(pass,10);
65+
return pass==1111;
66+
}
67+
lock.show();
68+
}
69+
70+
$(document).on("pause resume",showLockScreen,false);
71+
72+
```

0 commit comments

Comments
 (0)