Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvgids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Taddeüs Kroes
tvgids
Commits
80ebb944
Commit
80ebb944
authored
11 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Added option to select default channel list, and added 2 hours of margin on the edges
parent
93036496
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
guide.coffee
+6
-5
6 additions, 5 deletions
guide.coffee
index.php
+6
-0
6 additions, 0 deletions
index.php
settings.coffee
+9
-5
9 additions, 5 deletions
settings.coffee
settings.php
+4
-2
4 additions, 2 deletions
settings.php
style.sass
+8
-2
8 additions, 2 deletions
style.sass
with
33 additions
and
14 deletions
guide.coffee
+
6
−
5
View file @
80ebb944
...
...
@@ -2,12 +2,12 @@
# Config
#
FETCH_URL
=
'programs.php'
HOUR_WIDTH
=
200
CHANNEL_LABEL_WIDTH
=
180
STORAGE_CHANNELS
=
'tvgids-channels'
STORAGE_PROGRAMS
=
'tvgids-programs'
DEFAULT_CHANNELS
=
_
.
map
([
1
,
2
,
3
,
4
,
31
,
46
,
92
,
36
,
37
,
34
,
29
,
18
],
String
)
HOURS_BEFORE
=
HOURS_AFTER
=
2
#
# Utils
...
...
@@ -81,7 +81,7 @@ ChannelList = Backbone.Collection.extend(
fetchPrograms
:
(
day
)
->
$
(
'#loading-screen'
).
show
()
$
.
getJSON
(
FETCH_URL
'programs.php'
channels
:
Settings
.
get
(
'favourite_channels'
).
join
(
','
),
day
:
day
(
channels
)
->
_
.
each
channels
,
(
programs
,
id
)
->
...
...
@@ -144,10 +144,11 @@ ProgramView = Backbone.View.extend(
@
$fav
.
attr
(
'title'
,
'Als favoriet instellen'
)
@
updateFavlink
()
left
=
time2px
(
Math
.
max
(
0
,
seconds_today
(
@
model
.
get
(
'start'
))))
left
=
time2px
(
Math
.
max
(
-
HOURS_BEFORE
*
60
*
60
,
seconds_today
(
@
model
.
get
(
'start'
))))
width
=
time2px
(
seconds_today
(
@
model
.
get
(
'end'
)))
-
left
@
$el
.
css
(
left
:
left
+
'px'
left
:
((
HOURS_BEFORE
*
HOUR_WIDTH
)
+
left
)
+
'px'
width
:
(
width
-
10
)
+
'px'
)
...
...
@@ -265,7 +266,7 @@ AppView = Backbone.View.extend(
if
Settings
.
get
(
'day'
)
==
0
left
=
time2px
(
seconds_today
(
Date
.
now
()))
+
CHANNEL_LABEL_WIDTH
-
1
@
$
(
'.indicator'
)
.
css
(
'
left
'
,
left
+
'px'
)
.
css
(
left
:
((
HOURS_BEFORE
*
HOUR_WIDTH
)
+
left
)
+
'px'
)
.
height
(
@
$
(
'.channels'
).
height
()
-
2
)
.
show
()
else
...
...
This diff is collapsed.
Click to expand it.
index.php
+
6
−
0
View file @
80ebb944
...
...
@@ -20,6 +20,9 @@ function getwday($day) {
<div
class=
"indicator"
></div>
<div
class=
"timeline-bg"
></div>
<div
class=
"timeline"
>
<div
class=
"hour"
>
22:00
</div>
<div
class=
"hour"
>
23:00
</div>
<div
class=
"hour"
>
00:00
</div>
<div
class=
"hour"
>
01:00
</div>
<div
class=
"hour"
>
02:00
</div>
...
...
@@ -44,6 +47,9 @@ function getwday($day) {
<div
class=
"hour"
>
21:00
</div>
<div
class=
"hour"
>
22:00
</div>
<div
class=
"hour"
>
23:00
</div>
<div
class=
"hour"
>
00:00
</div>
<div
class=
"hour"
>
01:00
</div>
</div>
</div>
<div
id=
"channel-labels"
class=
"channel-labels"
></div>
...
...
This diff is collapsed.
Click to expand it.
settings.coffee
+
9
−
5
View file @
80ebb944
STORAGE_NAME
=
'tvgids-channels'
STORAGE_CHANNELS
=
'tvgids-channels'
DEFAULT_CHANNELS
=
_
.
map
([
1
,
2
,
3
,
4
,
31
,
46
,
92
,
36
,
37
,
34
,
29
,
18
],
String
)
visible
=
if
localStorage
.
hasOwnProperty
(
STORAGE_
NAME
)
\
then
localStorage
.
getItem
(
STORAGE_
NAME
).
split
(
';'
)
\
visible
=
if
localStorage
.
hasOwnProperty
(
STORAGE_
CHANNELS
)
\
then
localStorage
.
getItem
(
STORAGE_
CHANNELS
).
split
(
';'
)
\
else
_
.
pluck
(
CHANNELS
,
'id'
)
_
.
each
CHANNELS
,
(
channel
)
->
...
...
@@ -20,8 +21,11 @@ _.each CHANNELS, (channel) ->
$
(
'#select-channels'
).
submit
(
e
)
->
e
.
preventDefault
()
selected
=
(
$
(
i
).
val
()
for
i
in
$
(
'input'
,
@
)
when
$
(
i
).
is
(
':checked'
))
localStorage
.
setItem
(
STORAGE_
NAME
,
selected
.
join
(
';'
))
localStorage
.
setItem
(
STORAGE_
CHANNELS
,
selected
.
join
(
';'
))
setall
=
(
c
)
->
$
(
'#select-channels input'
).
prop
(
'
checked
'
,
c
).
change
()
setall
=
(
c
)
->
$
(
'#select-channels input'
).
prop
(
checked
:
c
).
change
()
$
(
'#select-all'
).
click
->
setall
(
true
)
$
(
'#select-none'
).
click
->
setall
(
false
)
$
(
'#select-default'
).
click
->
$
(
'#select-channels input'
).
each
->
$
(
@
).
prop
(
checked
:
_
.
contains
(
DEFAULT_CHANNELS
,
$
(
@
).
val
())).
change
()
This diff is collapsed.
Click to expand it.
settings.php
+
4
−
2
View file @
80ebb944
...
...
@@ -26,8 +26,10 @@ function getwday($day) {
<form
id=
"select-channels"
class=
"select-channels"
>
<div
class=
"options"
></div>
<button
id=
"select-all"
>
Selecteer alle
</button>
<button
id=
"select-none"
>
Selecteer geen
</button>
<span
class=
"select-label"
>
Selecteer:
</span>
<button
id=
"select-all"
>
Alle
</button>
<button
id=
"select-none"
>
Geen
</button>
<button
id=
"select-default"
>
Standaard
</button>
</form>
<script
src=
"lib/jquery-1.10.2.min.js"
type=
"text/javascript"
></script>
...
...
This diff is collapsed.
Click to expand it.
style.sass
+
8
−
2
View file @
80ebb944
...
...
@@ -3,6 +3,8 @@ $hour-width: 200px
$channel-height
:
34px
$header-height
:
64px
$channel-label-width
:
180px
$hours-before
:
2
$hours-after
:
2
html
,
body
width
:
100%
...
...
@@ -56,7 +58,7 @@ html, body
background-color
:
#fdfdfd
.timeline
width
:
24
*
$hour-width
width
:
(
$hours-before
+
24
+
$hours-after
)
*
$hour-width
height
:
26px
position
:
absolute
top
:
38px
...
...
@@ -78,7 +80,7 @@ html, body
.channels
margin
:
$header-height
0
0
(
$channel-label-width
-
1px
)
width
:
24
*
$hour-width
width
:
(
$hours-before
+
24
+
$hours-after
)
*
$hour-width
overflow
:
hidden
.channel
...
...
@@ -219,3 +221,7 @@ $details-width: 480px
strong
display
:
inline-block
width
:
70px
.select-label
margin-left
:
10px
font
:
13px
/
17px
Arial
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