Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
archery
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
archery
Commits
1d768fd2
Commit
1d768fd2
authored
Nov 05, 2014
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coloring scorecards option is now remembered using HTML5 local storage
parent
671118ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
coffee/scores.coffee
coffee/scores.coffee
+11
-2
templates/match/scores.latte
templates/match/scores.latte
+2
-1
templates/match/view.latte
templates/match/view.latte
+1
-6
No files found.
coffee/scores.coffee
View file @
1d768fd2
num
=
(
s
)
->
if
s
==
''
or
isNaN
(
parseInt
(
s
))
then
0
else
parseInt
(
s
)
num
=
(
s
)
->
if
s
==
''
or
isNaN
(
parseInt
(
s
))
then
0
else
parseInt
(
s
)
$
->
$
->
$
(
'.match'
).
each
->
$
(
'.match
-editable
'
).
each
->
table
=
$
(
@
)
table
=
$
(
@
)
match_total
=
table
.
find
(
'.match-total'
)
match_total
=
table
.
find
(
'.match-total'
)
match_avg
=
table
.
find
(
'.match-avg'
)
match_avg
=
table
.
find
(
'.match-avg'
)
...
@@ -45,7 +45,6 @@ $ ->
...
@@ -45,7 +45,6 @@ $ ->
cell
=
$
(
@
).
closest
(
'td'
)
cell
=
$
(
@
).
closest
(
'td'
)
cls
=
cell
.
attr
(
'class'
).
replace
(
/\s*val-\d+\s*/
,
''
)
cls
=
cell
.
attr
(
'class'
).
replace
(
/\s*val-\d+\s*/
,
''
)
console
.
log
cell
.
attr
(
'class'
),
cls
cell
.
attr
(
'class'
,
cls
).
addClass
(
'val-'
+
$
(
@
).
val
())
cell
.
attr
(
'class'
,
cls
).
addClass
(
'val-'
+
$
(
@
).
val
())
inputs
.
filter
(
'[value=""]:first'
).
focus
()
inputs
.
filter
(
'[value=""]:first'
).
focus
()
...
@@ -62,3 +61,13 @@ $ ->
...
@@ -62,3 +61,13 @@ $ ->
$
(
'#toggle-colored'
).
on
'click'
,
->
$
(
'#toggle-colored'
).
on
'click'
,
->
$
(
@
).
toggleClass
(
'active'
).
blur
()
$
(
@
).
toggleClass
(
'active'
).
blur
()
$
(
'#match'
).
toggleClass
(
'colored'
)
$
(
'#match'
).
toggleClass
(
'colored'
)
if
$
(
'#match'
).
hasClass
(
'colored'
)
and
window
.
hasOwnProperty
(
'localStorage'
)
localStorage
.
setItem
(
'colored-scores'
,
true
)
console
.
log
localStorage
.
getItem
(
'colored-scores'
)
else
localStorage
.
removeItem
(
'colored-scores'
)
if
window
.
hasOwnProperty
(
'localStorage'
)
and
localStorage
.
getItem
(
'colored-scores'
)
$
(
'#match'
).
addClass
(
'colored'
)
$
(
'#toggle-colored'
).
addClass
(
'active'
)
templates/match/scores.latte
View file @
1d768fd2
...
@@ -18,7 +18,8 @@
...
@@ -18,7 +18,8 @@
<form method="post" action="match/{$match->id}/scores">
<form method="post" action="match/{$match->id}/scores">
<table id="match" class="table table-bordered table-condensed match {$match->discipline}">
<table id="match" class="table table-bordered table-condensed match
{$match->discipline} match-editable">
<thead>
<thead>
<tr>
<tr>
<th class="separator"></th>
<th class="separator"></th>
...
...
templates/match/view.latte
View file @
1d768fd2
...
@@ -99,10 +99,5 @@
...
@@ -99,10 +99,5 @@
{/block}
{/block}
{block scripts}
{block scripts}
<script type="text/javascript">
<script src="js/scores.js"></script>
$('#toggle-colored').click(function() {
$(this).toggleClass('active').blur();
$('#match').toggleClass('colored');
});
</script>
{/block}
{/block}
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