This repository was archived by the owner on Apr 16, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Original file line number Diff line number Diff line change
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
+ ```
You can’t perform that action at this time.
0 commit comments