Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Matrix of Life
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
Matrix of Life
Commits
77866bbc
Commit
77866bbc
authored
2 years ago
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
load colorPicker early, but send events only after all scripts loaded
parent
9e02bea9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
data_src/index.html
+10
-1
10 additions, 1 deletion
data_src/index.html
data_src/main.js
+6
-15
6 additions, 15 deletions
data_src/main.js
with
16 additions
and
16 deletions
data_src/index.html
+
10
−
1
View file @
77866bbc
...
...
@@ -145,7 +145,7 @@
</div>
<div
class=
"col-6 text-end"
>
<button
type=
"button"
class=
"btn btn-sm btn-danger btnConfirm"
data-action=
"reset"
data-title=
"Factory Reset"
data-text=
"erase all highscores and settings?"
disabled
>
Factory
data-title=
"Factory Reset"
data-text=
"erase all highscores and settings?
(ToDo)
"
disabled
>
Factory
Reset
</button>
</div>
</div>
...
...
@@ -184,6 +184,15 @@
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdn.jsdelivr.net/npm/@jaames/iro@5.5.2/dist/iro.min.js"
integrity=
"sha256-XQju26ya9yEvX99+M2rrLah6xHsjZIGK1LvX/L3RjQ0="
crossorigin=
"anonymous"
></script>
<script>
var
colorPicker
=
new
iro
.
ColorPicker
(
'
#colorpicker
'
,
{
layout
:
[
{
component
:
iro
.
ui
.
Wheel
,
}
]
});
</script>
<script
src=
"main.js"
></script>
</body>
...
...
This diff is collapsed.
Click to expand it.
data_src/main.js
+
6
−
15
View file @
77866bbc
...
...
@@ -12,7 +12,6 @@ var settings = {
var
highscores
=
{};
var
initHighscores
=
true
;
var
uiEnabled
=
false
;
$
(
document
).
ready
(
function
()
{
...
...
@@ -22,6 +21,11 @@ $(document).ready(function () {
$
(
window
).
on
(
'
load
'
,
function
()
{
startSocket
();
colorPicker
.
on
(
'
input:end
'
,
function
(
color
)
{
settings
.
color
=
color
.
rgb
;
sendSettings
();
});
});
$
(
document
).
on
(
'
change
'
,
'
.rangeSetting
'
,
function
()
{
...
...
@@ -39,19 +43,6 @@ $(document).on('change', '.rangeSetting', function () {
sendSettings
();
});
var
colorPicker
=
new
iro
.
ColorPicker
(
'
#colorpicker
'
,
{
layout
:
[
{
component
:
iro
.
ui
.
Wheel
,
}
]
});
colorPicker
.
on
(
'
input:end
'
,
function
(
color
)
{
settings
.
color
=
color
.
rgb
;
sendSettings
();
});
$
(
'
.btnAction
'
).
on
(
'
click
'
,
function
()
{
var
action
=
$
(
this
).
data
(
'
action
'
);
sendAction
(
action
);
...
...
@@ -62,7 +53,7 @@ $('.btnAction').on('click', function () {
$
(
'
.btnConfirm
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#modalConfirm
'
).
find
(
'
.modal-title
'
).
text
(
$
(
this
).
data
(
'
title
'
));
$
(
'
#modalConfirm
'
).
find
(
'
.modal-body
'
).
text
(
'
Do your really want to
'
+
$
(
this
).
data
(
'
text
'
)
+
'
(NFG)
'
);
$
(
'
#modalConfirm
'
).
find
(
'
.modal-body
'
).
text
(
'
Do your really want to
'
+
$
(
this
).
data
(
'
text
'
));
$
(
'
#modalConfirm
'
).
find
(
'
.btnAction
'
).
data
(
'
action
'
,
$
(
this
).
data
(
'
action
'
));
modalConfirm
.
show
();
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment