Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
postbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wen Wei Li
postbox
Commits
f4ad973c
Commit
f4ad973c
authored
Mar 27, 2020
by
Wen Wei Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pincode layout
parent
0da28b71
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
17 deletions
+38
-17
__pycache__/wifi_utils.cpython-36.pyc
__pycache__/wifi_utils.cpython-36.pyc
+0
-0
app.py
app.py
+3
-3
static/css/main.css
static/css/main.css
+5
-1
static/js/pincode.js
static/js/pincode.js
+22
-5
templates/demo.html
templates/demo.html
+1
-1
templates/pincode.html
templates/pincode.html
+7
-7
No files found.
__pycache__/wifi_utils.cpython-36.pyc
0 → 100644
View file @
f4ad973c
File added
app.py
View file @
f4ad973c
static/css/main.css
View file @
f4ad973c
...
@@ -12,3 +12,7 @@ input:focus{
...
@@ -12,3 +12,7 @@ input:focus{
td
{
td
{
cursor
:
pointer
;
cursor
:
pointer
;
}
}
input
.input_margin
{
margin-right
:
6%
;
}
static/js/pincode.js
View file @
f4ad973c
...
@@ -16,18 +16,35 @@ let myKeyboard = new Keyboard({
...
@@ -16,18 +16,35 @@ let myKeyboard = new Keyboard({
});
});
let
ary_input
=
[];
let
ary_input
=
[];
let
index
=
1
let
index
=
1
;
function
onChange
(
input
)
{
function
onChange
(
input
)
{
if
(
ary_input
.
length
>
6
){
ary_input
.
pop
();
}
console
.
log
(
"
Input changed
"
,
ary_input
);
console
.
log
(
"
Input changed
"
,
ary_input
);
}
}
function
onKeyPress
(
button
)
{
function
onKeyPress
(
button
)
{
console
.
log
(
"
index :
"
,
index
);
console
.
log
(
"
index :
"
,
index
);
n
=
"
slot-
"
+
index
if
(
String
(
button
)
==
"
{bksp}
"
&&
index
>
1
){
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
value
=
'
1
'
;
index
=
index
-
1
;
n
=
"
slot-
"
+
index
;
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
value
=
''
;
ary_input
.
pop
();
}
else
if
(
String
(
button
)
==
"
{bksp}
"
&&
index
==
1
){
console
.
log
(
"
back to the first pin code
"
);
}
else
if
(
index
<
7
){
n
=
"
slot-
"
+
index
;
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
value
=
button
;
index
=
index
+
1
;
index
=
index
+
1
;
ary_input
.
push
(
button
)
ary_input
.
push
(
button
);
}
else
{
console
.
log
(
"
index over 6
"
);
}
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
focus
();
document
.
querySelector
(
'
input[id="
'
+
n
+
'
"]
'
).
focus
();
console
.
log
(
"
Button pressed
"
,
button
);
console
.
log
(
"
Button pressed
"
,
button
);
}
}
templates/demo.html
View file @
f4ad973c
templates/pincode.html
View file @
f4ad973c
...
@@ -31,13 +31,13 @@
...
@@ -31,13 +31,13 @@
{% endblock head %}
{% endblock head %}
{% block content%}
{% block content%}
<body
class=
"bg-light m-5"
>
<body
class=
"
container mx-auto
bg-light m-5"
>
<h2
class=
"text-muted text-center m-5"
>
PinCode Setup
</h2>
<h2
class=
"text-muted text-center m-5"
>
PinCode Setup
</h2>
<center>
<center>
<div
class=
"
col align-items-center
m-5 col-8"
>
<div
class=
"
row col mx-auto
m-5 col-8"
>
<div
class=
"col-
10 inline
"
>
<div
class=
"col-
sm
"
>
{% for i in range(6) %}
{% for i in range(6) %}
<input
type=
"password"
class=
"form-control input
"
id=
"slot-{{loop.index}}"
maxlength=
"1"
>
<input
type=
"password"
class=
"form-control input
float-left col-sm-1 text-center input_margin"
id=
"slot-{{loop.index}}"
disabled=
"true"
maxlength=
"1"
>
{% endfor %}
{% endfor %}
</div>
</div>
<div
class=
"col-2 inline"
>
<div
class=
"col-2 inline"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment