xmltv2html 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +99 -0
- data/ChangeLog +776 -0
- data/README +41 -0
- data/bin/xmltv2html.rb +1155 -0
- data/contrib/README +3 -0
- data/contrib/kvh/generate_html +68 -0
- data/contrib/kvh/tvlistings +15 -0
- data/contrib/kvh/tvlistings_index +82 -0
- data/contrib/kvh/update-tvlistings +136 -0
- data/popup.js +227 -0
- data/xmltv2html.css +75 -0
- data/xmltv2htmlrc +102 -0
- metadata +64 -0
data/contrib/README
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
tvlisting_dir = "/mnt/part5/www/tvlistings/"
|
6
|
+
|
7
|
+
html_cmd = "/home/kvh/bin/xmltv2html.rb"
|
8
|
+
index_cmd = "/home/kvh/bin/tvlistings_index"
|
9
|
+
|
10
|
+
conf = "/home/kvh/.xmltv2htmlrc"
|
11
|
+
|
12
|
+
files = Dir[tvlisting_dir + "20*.xml"]
|
13
|
+
|
14
|
+
files.each { |f|
|
15
|
+
fd = File.basename(f)
|
16
|
+
|
17
|
+
# $stderr.print f, " ", File.stat(f).zero?,"\n"
|
18
|
+
if File.stat(f).zero? then
|
19
|
+
print "^^^ Zero file - Deleting #{f}\n"
|
20
|
+
if File.delete(f) != 1 then
|
21
|
+
print " Error deleting #{f}\n"
|
22
|
+
end
|
23
|
+
next
|
24
|
+
end
|
25
|
+
output_file = f.gsub(/.xml$/,".html")
|
26
|
+
if File.exists?(output_file) and File.stat(output_file).zero? then
|
27
|
+
print "^^^ Zero file - Deleting #{output_file}\n"
|
28
|
+
if File.delete(output_file) != 1 then
|
29
|
+
print " Error deleting #{output_file}\n"
|
30
|
+
end
|
31
|
+
next
|
32
|
+
end
|
33
|
+
output_file = f.gsub(/.xml$/,".html")
|
34
|
+
if File.exists?(output_file)
|
35
|
+
print "^^^ #{output_file} already exists.\n"
|
36
|
+
next
|
37
|
+
end
|
38
|
+
|
39
|
+
fdd = fd.gsub(/.xml$/,"")
|
40
|
+
|
41
|
+
prevday = nil
|
42
|
+
nextday = nil
|
43
|
+
|
44
|
+
# $stderr.print "#{fdd}\n"
|
45
|
+
# d = Date.new(fdate[0,4].to_i, fdate[4,2].to_i, fdate[6,2].to_i)
|
46
|
+
d = Date.new(fdd[0,4].to_i, fdd[5,2].to_i, fdd[8,2].to_i)
|
47
|
+
nextday = d + 1
|
48
|
+
nextday_file = nextday.strftime("%Y-%m-%d") + ".html"
|
49
|
+
prevday = d - 1
|
50
|
+
prevday_file = prevday.strftime("%Y-%m-%d") + ".html"
|
51
|
+
|
52
|
+
# $stderr.print "prev day #{prevday}; #{prevday_file}\n"
|
53
|
+
# $stderr.print "next day #{nextday}; #{nextday_file}\n"
|
54
|
+
|
55
|
+
|
56
|
+
run_me = html_cmd
|
57
|
+
run_me += " --configfile=" + conf if File.exists?(conf)
|
58
|
+
run_me += " < " + f + " > " + output_file
|
59
|
+
run_me += " --urlprev=" + prevday_file if prevday_file
|
60
|
+
run_me += " --urlnext=" + nextday_file if nextday_file
|
61
|
+
|
62
|
+
print run_me,"\n"
|
63
|
+
status = system(run_me)
|
64
|
+
$stderr.print "Error ",status," occurred while running : ", run_me,"\n\n" if !status
|
65
|
+
|
66
|
+
}
|
67
|
+
|
68
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
echo
|
4
|
+
echo "* Updating TV listings using xmltv from zap2it.com..."
|
5
|
+
~/bin/update-tvlistings
|
6
|
+
|
7
|
+
echo
|
8
|
+
echo "* Generating HTML from the XMLTV output..."
|
9
|
+
~/bin/generate_html
|
10
|
+
|
11
|
+
echo
|
12
|
+
echo "* Generating HTML index..."
|
13
|
+
~/bin/tvlistings_index
|
14
|
+
|
15
|
+
echo
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
tvlisting_dir = "/mnt/part5/www/tvlistings/"
|
6
|
+
#tvlisting_dir = "/var/www/httpd/htdocs/tvlistings/"
|
7
|
+
output = "index.html"
|
8
|
+
$previous_days_to_save = 1
|
9
|
+
|
10
|
+
def delete_zero_files(files)
|
11
|
+
files.each { |f|
|
12
|
+
if File.stat(f).zero? then
|
13
|
+
print "^^^ Zero file - Deleting #{f}\n"
|
14
|
+
if File.delete(f) != 1 then
|
15
|
+
print "^^^ Error deleting #{f}\n"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def delete_old_files(files)
|
22
|
+
today = Date.today
|
23
|
+
files.each { |f|
|
24
|
+
fd = File.basename(f)
|
25
|
+
fd.sub!(/\..*/,'')
|
26
|
+
(y, m, d) = fd.split('-')
|
27
|
+
next unless d
|
28
|
+
#print "#{y}|#{m}|#{d}\n"
|
29
|
+
fdd = Date.new(y.to_i, m.to_i, d.to_i)
|
30
|
+
if (fdd - today) < -$previous_days_to_save then
|
31
|
+
print "^^^ Too old - Deleting #{f}\n"
|
32
|
+
if File.delete(f) != 1 then
|
33
|
+
print "^^^ Error deleting #{f}\n"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
def output_html(files, output)
|
40
|
+
|
41
|
+
out = "<HTML><HEAD><TITLE>TV Listings</TITLE></HEAD>\n"
|
42
|
+
out += "<BODY>\n\n<BR><BR>\n"
|
43
|
+
out += "<UL>\n"
|
44
|
+
|
45
|
+
files.each { |f|
|
46
|
+
fd = File.basename(f)
|
47
|
+
fd.sub!(/\..*/,'')
|
48
|
+
(y, m, d) = fd.split('-')
|
49
|
+
next unless d
|
50
|
+
#print "#{y}|#{m}|#{d}\n"
|
51
|
+
fdd = Date.new(y.to_i, m.to_i, d.to_i)
|
52
|
+
|
53
|
+
out += "<LI><A HREF=\"" + File.basename(f) + "\">"
|
54
|
+
out += File.basename(f) + "</A> --- " + Date::DAYNAMES[fdd.wday]
|
55
|
+
out += "\n"
|
56
|
+
}
|
57
|
+
out += "</UL>\n"
|
58
|
+
out += "<BR>\n"
|
59
|
+
out += "</BODY></HTML>\n"
|
60
|
+
|
61
|
+
out_file = File.open(output,"w+")
|
62
|
+
out_file.print out
|
63
|
+
out_file.close
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
html_files = Dir[tvlisting_dir + "*.html"]
|
68
|
+
delete_zero_files html_files
|
69
|
+
|
70
|
+
xml_files = Dir[tvlisting_dir + "20*.xml"]
|
71
|
+
delete_zero_files xml_files
|
72
|
+
|
73
|
+
html_files = Dir[tvlisting_dir + "*.html"]
|
74
|
+
delete_old_files html_files
|
75
|
+
|
76
|
+
xml_files = Dir[tvlisting_dir + "20*.xml"]
|
77
|
+
delete_old_files xml_files
|
78
|
+
|
79
|
+
html_files = Dir[tvlisting_dir + "*.html"].sort
|
80
|
+
output_html(html_files, tvlisting_dir+output)
|
81
|
+
|
82
|
+
|
@@ -0,0 +1,136 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Listings are save as YYYY-MM-DD.html (2003-07-01.html)
|
4
|
+
#
|
5
|
+
require 'date'
|
6
|
+
|
7
|
+
$days_to_get_in_advance = 3 # listings to view
|
8
|
+
$days_to_get = 7 # --days
|
9
|
+
|
10
|
+
# Where to store the listings
|
11
|
+
$tvlisting_dir = "/mnt/part5/www/tvlistings"
|
12
|
+
$tvlisting_data = $tvlisting_dir + "/data"
|
13
|
+
|
14
|
+
#$grab_cmd="/usr/bin/tv_grab_na_dd "
|
15
|
+
$grab_cmd="/usr/bin/tv_grab_na_dd --days " + $days_to_get.to_s + " "
|
16
|
+
$date_cmd="date +%F"
|
17
|
+
|
18
|
+
#grep 'programme start' tmp1.xml | awk -F\" '{ print $2 }' | awk '{ print $1 }' | sort | head -n 1
|
19
|
+
|
20
|
+
$pretend = false
|
21
|
+
#$pretend = true
|
22
|
+
|
23
|
+
$today = Date.today
|
24
|
+
$offset = 0
|
25
|
+
$got=0
|
26
|
+
|
27
|
+
def archive_data_listings
|
28
|
+
if (File.exists?($tvlisting_data)) and !File.stat($tvlisting_data).zero?
|
29
|
+
$stderr.print "* ${tvlisting_data} exists..."
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
# Get tvlistings for the next # days
|
35
|
+
def get_listings
|
36
|
+
$today.upto($today + $days_to_get_in_advance - 1) { |d|
|
37
|
+
tdate = d.to_s
|
38
|
+
input_file = $tvlisting_dir + "\/" + tdate + ".xml"
|
39
|
+
|
40
|
+
# tdate.sub!(/2003-/,'')
|
41
|
+
# tdate.sub!(/-/,'/')
|
42
|
+
|
43
|
+
$stdout.print " ^^^ Checking for #{input_file}\n"
|
44
|
+
if (! File.exists?(input_file)) or File.stat(input_file).zero?
|
45
|
+
run_me = $grab_cmd
|
46
|
+
run_me += " --offset " + $offset.to_s + " > "
|
47
|
+
output_file = $tvlisting_data + "_" + tdate
|
48
|
+
output_file += "_" + $days_to_get.to_s + ".tmp"
|
49
|
+
# output_file += "_" + $days_to_get_in_advance.to_s + ".tmp"
|
50
|
+
run_me += output_file
|
51
|
+
|
52
|
+
print run_me,"\n"
|
53
|
+
status = system(run_me) if ! $pretend
|
54
|
+
if !status
|
55
|
+
$stderr.print "Error ",status," occurred while running : ", run_me,"\n\n"
|
56
|
+
end
|
57
|
+
new_file = output_file.sub(/tmp/, "xml")
|
58
|
+
cmd = "tv_sort < " + output_file + " > " + new_file
|
59
|
+
print cmd,"\n"
|
60
|
+
status = system(cmd) if ! $pretend
|
61
|
+
if !status
|
62
|
+
$stderr.print "Error ",status," occurred while running : #{cmd}\n\n"
|
63
|
+
end
|
64
|
+
break # Only interested in first file missing
|
65
|
+
end
|
66
|
+
$offset += 1
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# For each 'data' file seperate into 1 day listings
|
71
|
+
def seperate_listings
|
72
|
+
files = Dir[$tvlisting_dir + "/data*.xml"]
|
73
|
+
|
74
|
+
files.each { |f|
|
75
|
+
fd = File.basename(f)
|
76
|
+
# $stdout.print "#{f}\n"
|
77
|
+
# $stdout.print "#{fd}\n"
|
78
|
+
t = fd.sub(/data_/,'')
|
79
|
+
t = t.sub!(/\.xml/,'')
|
80
|
+
# $stdout.print "#{t}\n"
|
81
|
+
(d, count) = t.split("_")
|
82
|
+
# $stdout.print "#{d}\n"
|
83
|
+
# $stdout.print "#{count}\n"
|
84
|
+
(year, month, day) = d.split("-")
|
85
|
+
# $stdout.print "#{year}, #{month}, #{day}\n"
|
86
|
+
|
87
|
+
starting_date = Date.new(year.to_i, month.to_i, day.to_i)
|
88
|
+
starting_date.upto(starting_date + count.to_i - 1) { |d|
|
89
|
+
tdate = d.to_s
|
90
|
+
ndate = (d + 1).to_s
|
91
|
+
input_file = $tvlisting_dir + "\/" + tdate + ".xml"
|
92
|
+
|
93
|
+
$stdout.print "* Checking for #{input_file}..."
|
94
|
+
if (! File.exists?(input_file)) or File.stat(input_file).zero?
|
95
|
+
$stdout.print " not there.\n"
|
96
|
+
cmd = "tv_grep --on-after " + tdate
|
97
|
+
cmd += " --on-before " + ndate
|
98
|
+
cmd += " < " + f
|
99
|
+
cmd += " > " + input_file
|
100
|
+
$stdout.print "#{cmd}\n"
|
101
|
+
status = system(cmd)
|
102
|
+
if !status
|
103
|
+
$stderr.print "Error ",status," occurred while running : #{cmd}\n\n"
|
104
|
+
end
|
105
|
+
else
|
106
|
+
$stdout.print " found it!\n"
|
107
|
+
end
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
def delete_old_files(files)
|
114
|
+
files.each { |f|
|
115
|
+
print "^^^ Deleting #{f}\n"
|
116
|
+
if File.delete(f) != 1 then
|
117
|
+
print "^^^ Error deleting #{f}\n"
|
118
|
+
end
|
119
|
+
}
|
120
|
+
end
|
121
|
+
|
122
|
+
get_listings
|
123
|
+
seperate_listings
|
124
|
+
|
125
|
+
data_files = Dir[$tvlisting_dir + "/data*.tmp"]
|
126
|
+
delete_old_files data_files
|
127
|
+
data_files = Dir[$tvlisting_dir + "/data*.xml"]
|
128
|
+
delete_old_files data_files
|
129
|
+
|
130
|
+
#if $got > 0
|
131
|
+
# $stdout.print " ^^^ Downloaded #{$got} days of TV listings.\n"
|
132
|
+
#else
|
133
|
+
# $stdout.print " ^^^ TV listings are current.\n"
|
134
|
+
#end
|
135
|
+
|
136
|
+
|
data/popup.js
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
<!--
|
2
|
+
/*
|
3
|
+
Pleas leave this notice.
|
4
|
+
DHTML tip message version 1.2 copyright Essam Gamal 2003 (http://migoicons.tripod.com, migoicons@hotmail.com)
|
5
|
+
All modifications are done in the style.js you should not modify this file. Created on : 06/03/2003
|
6
|
+
Script featured on and can be found at Dynamic Drive (http://www.dynamicdrive.com)
|
7
|
+
*/
|
8
|
+
|
9
|
+
var ua = navigator.userAgent
|
10
|
+
var ps = navigator.productSub
|
11
|
+
var dom = (document.getElementById)? 1:0
|
12
|
+
var ie4 = (document.all&&!dom)? 1:0
|
13
|
+
var ie5 = (document.all&&dom)? 1:0
|
14
|
+
var nn4 =(navigator.appName.toLowerCase() == "netscape" && parseInt(navigator.appVersion) == 4)
|
15
|
+
var nn6 = (dom&&!ie5)? 1:0
|
16
|
+
var sNav = (nn4||nn6||ie4||ie5)? 1:0
|
17
|
+
var cssFilters = ((ua.indexOf("MSIE 5.5")>=0||ua.indexOf("MSIE 6")>=0)&&ua.indexOf("Opera")<0)? 1:0
|
18
|
+
var Style=[],Text=[],Count=0,sbw=0,move=0,hs="",mx,my,scl,sct,ww,wh,obj,sl,st,ih,iw,vl,hl,sv,evlh,evlw,tbody
|
19
|
+
var HideTip = "eval(obj+sv+hl+';'+obj+sl+'=0;'+obj+st+'=-800')"
|
20
|
+
var doc_root = ((ie5&&ua.indexOf("Opera")<0||ie4)&&document.compatMode=="CSS1Compat")? "document.documentElement":"document.body"
|
21
|
+
var PX = (nn6)? "px" :""
|
22
|
+
|
23
|
+
if(sNav) {
|
24
|
+
window.onresize = ReloadTip
|
25
|
+
document.onmousemove = MoveTip
|
26
|
+
if(nn4) document.captureEvents(Event.MOUSEMOVE)
|
27
|
+
}
|
28
|
+
if(nn4||nn6) {
|
29
|
+
mx = "e.pageX"
|
30
|
+
my = "e.pageY"
|
31
|
+
scl = "window.pageXOffset"
|
32
|
+
sct = "window.pageYOffset"
|
33
|
+
if(nn4) {
|
34
|
+
obj = "document.TipLayer."
|
35
|
+
sl = "left"
|
36
|
+
st = "top"
|
37
|
+
ih = "clip.height"
|
38
|
+
iw = "clip.width"
|
39
|
+
vl = "'show'"
|
40
|
+
hl = "'hide'"
|
41
|
+
sv = "visibility="
|
42
|
+
}
|
43
|
+
else obj = "document.getElementById('TipLayer')."
|
44
|
+
}
|
45
|
+
if(ie4||ie5) {
|
46
|
+
obj = "TipLayer."
|
47
|
+
mx = "event.x"
|
48
|
+
my = "event.y"
|
49
|
+
scl = "eval(doc_root).scrollLeft"
|
50
|
+
sct = "eval(doc_root).scrollTop"
|
51
|
+
if(ie5) {
|
52
|
+
mx = mx+"+"+scl
|
53
|
+
my = my+"+"+sct
|
54
|
+
}
|
55
|
+
}
|
56
|
+
if(ie4||dom){
|
57
|
+
sl = "style.left"
|
58
|
+
st = "style.top"
|
59
|
+
ih = "offsetHeight"
|
60
|
+
iw = "offsetWidth"
|
61
|
+
vl = "'visible'"
|
62
|
+
hl = "'hidden'"
|
63
|
+
sv = "style.visibility="
|
64
|
+
}
|
65
|
+
if(ie4||ie5||ps>=20020823) {
|
66
|
+
ww = "eval(doc_root).clientWidth"
|
67
|
+
wh = "eval(doc_root).clientHeight"
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
ww = "window.innerWidth"
|
71
|
+
wh = "window.innerHeight"
|
72
|
+
evlh = eval(wh)
|
73
|
+
evlw = eval(ww)
|
74
|
+
sbw=15
|
75
|
+
}
|
76
|
+
|
77
|
+
function applyCssFilter(){
|
78
|
+
if(cssFilters&&FiltersEnabled) {
|
79
|
+
var dx = " progid:DXImageTransform.Microsoft."
|
80
|
+
TipLayer.style.filter = "revealTrans()"+dx+"Fade(Overlap=1.00 enabled=0)"+dx+"Inset(enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=in enabled=0)"+dx+"Iris(irisstyle=PLUS,motion=out enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=in enabled=0)"+dx+"Iris(irisstyle=DIAMOND,motion=out enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=in enabled=0)"+dx+"Iris(irisstyle=CROSS,motion=out enabled=0)"+dx+"Iris(irisstyle=STAR,motion=in enabled=0)"+dx+"Iris(irisstyle=STAR,motion=out enabled=0)"+dx+"RadialWipe(wipestyle=CLOCK enabled=0)"+dx+"RadialWipe(wipestyle=WEDGE enabled=0)"+dx+"RadialWipe(wipestyle=RADIAL enabled=0)"+dx+"Pixelate(MaxSquare=35,enabled=0)"+dx+"Slide(slidestyle=HIDE,Bands=25 enabled=0)"+dx+"Slide(slidestyle=PUSH,Bands=25 enabled=0)"+dx+"Slide(slidestyle=SWAP,Bands=25 enabled=0)"+dx+"Spiral(GridSizeX=16,GridSizeY=16 enabled=0)"+dx+"Stretch(stretchstyle=HIDE enabled=0)"+dx+"Stretch(stretchstyle=PUSH enabled=0)"+dx+"Stretch(stretchstyle=SPIN enabled=0)"+dx+"Wheel(spokes=16 enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=0,motion=reverse enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=forward enabled=0)"+dx+"GradientWipe(GradientSize=1.00,wipestyle=1,motion=reverse enabled=0)"+dx+"Zigzag(GridSizeX=8,GridSizeY=8 enabled=0)"+dx+"Alpha(enabled=0)"+dx+"Dropshadow(OffX=3,OffY=3,Positive=true,enabled=0)"+dx+"Shadow(strength=3,direction=135,enabled=0)"
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
function stm(t,s) {
|
85
|
+
if(sNav) {
|
86
|
+
if(t.length<2||s.length<25) {
|
87
|
+
var ErrorNotice = "DHTML TIP MESSAGE VERSION 1.2 ERROR NOTICE.\n"
|
88
|
+
if(t.length<2&&s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array and Text Array of this tip.\nTheir should be 25 entries in every Style Array even though empty and 2 in every Text Array. You defined only "+s.length+" entries in the Style Array and "+t.length+" entry in the Text Array. This tip won't be viewed to avoid errors")
|
89
|
+
else if(t.length<2) alert(ErrorNotice+"It looks like you removed an entry or more from the Text Array of this tip.\nTheir should be 2 entries in every Text Array. You defined only "+t.length+" entry. This tip won't be viewed to avoid errors.")
|
90
|
+
else if(s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array of this tip.\nTheir should be 25 entries in every Style Array even though empty. You defined only "+s.length+" entries. This tip won't be viewed to avoid errors.")
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
var ab = "" ;var ap = ""
|
94
|
+
var titCol = (s[0])? "COLOR='"+s[0]+"'" : ""
|
95
|
+
var txtCol = (s[1])? "COLOR='"+s[1]+"'" : ""
|
96
|
+
var titBgCol = (s[2])? "BGCOLOR='"+s[2]+"'" : ""
|
97
|
+
var txtBgCol = (s[3])? "BGCOLOR='"+s[3]+"'" : ""
|
98
|
+
var titBgImg = (s[4])? "BACKGROUND='"+s[4]+"'" : ""
|
99
|
+
var txtBgImg = (s[5])? "BACKGROUND='"+s[5]+"'" : ""
|
100
|
+
var titTxtAli = (s[6] && s[6].toLowerCase()!="left")? "ALIGN='"+s[6]+"'" : ""
|
101
|
+
var txtTxtAli = (s[7] && s[7].toLowerCase()!="left")? "ALIGN='"+s[7]+"'" : ""
|
102
|
+
var add_height = (s[15])? "HEIGHT='"+s[15]+"'" : ""
|
103
|
+
if(!s[8]) s[8] = "Verdana,Arial,Helvetica"
|
104
|
+
if(!s[9]) s[9] = "Verdana,Arial,Helvetica"
|
105
|
+
if(!s[12]) s[12] = 1
|
106
|
+
if(!s[13]) s[13] = 1
|
107
|
+
if(!s[14]) s[14] = 200
|
108
|
+
if(!s[16]) s[16] = 0
|
109
|
+
if(!s[17]) s[17] = 0
|
110
|
+
if(!s[18]) s[18] = 10
|
111
|
+
if(!s[19]) s[19] = 10
|
112
|
+
hs = s[11].toLowerCase()
|
113
|
+
if(ps==20001108){
|
114
|
+
if(s[2]) ab="STYLE='border:"+s[16]+"px solid"+" "+s[2]+"'"
|
115
|
+
ap="STYLE='padding:"+s[17]+"px "+s[17]+"px "+s[17]+"px "+s[17]+"px'"}
|
116
|
+
var closeLink=(hs=="sticky")? "<TD ALIGN='right'><FONT SIZE='"+s[12]+"' FACE='"+s[8]+"'><A HREF='javascript:void(0)' ONCLICK='stickyhide()' STYLE='text-decoration:none;color:"+s[0]+"'><B>Close</B></A></FONT></TD>":""
|
117
|
+
var title=(t[0]||hs=="sticky")? "<TABLE WIDTH='100%' BORDER='0' CELLPADDING='5' CELLSPACING='0'><TR><TD "+titTxtAli+"><FONT SIZE='"+s[12]+"' FACE='"+s[8]+"' "+titCol+"><B>"+t[0]+"</B></FONT></TD>"+closeLink+"</TR></TABLE>" : ""
|
118
|
+
var txt="<TABLE "+titBgImg+" "+ab+" WIDTH='"+s[14]+"' BORDER='0' CELLPADDING='"+s[16]+"' CELLSPACING='0' "+titBgCol+" ><TR><TD>"+title+"<TABLE WIDTH='100%' "+add_height+" BORDER='0' CELLPADDING='"+s[17]+"' CELLSPACING='0' "+txtBgCol+" "+txtBgImg+"><TR><TD "+txtTxtAli+" "+ap+" VALIGN='top'><FONT SIZE='"+s[13]+"' FACE='"+s[9]+"' "+txtCol +">"+t[1]+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
|
119
|
+
if(nn4) {
|
120
|
+
with(eval(obj+"document")) {
|
121
|
+
open()
|
122
|
+
write(txt)
|
123
|
+
close()
|
124
|
+
}
|
125
|
+
}
|
126
|
+
else eval(obj+"innerHTML=txt")
|
127
|
+
tbody = {
|
128
|
+
Pos:s[10].toLowerCase(),
|
129
|
+
Xpos:s[18],
|
130
|
+
Ypos:s[19],
|
131
|
+
Transition:s[20],
|
132
|
+
Duration:s[21],
|
133
|
+
Alpha:s[22],
|
134
|
+
ShadowType:s[23].toLowerCase(),
|
135
|
+
ShadowColor:s[24],
|
136
|
+
Width:parseInt(eval(obj+iw)+3+sbw)
|
137
|
+
}
|
138
|
+
if(ie4) {
|
139
|
+
TipLayer.style.width = s[14]
|
140
|
+
tbody.Width = s[14]
|
141
|
+
}
|
142
|
+
Count=0
|
143
|
+
move=1
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
function MoveTip(e) {
|
149
|
+
if(move) {
|
150
|
+
var X,Y,MouseX = eval(mx),MouseY = eval(my); tbody.Height = parseInt(eval(obj+ih)+3)
|
151
|
+
tbody.wiw = parseInt(eval(ww+"+"+scl)); tbody.wih = parseInt(eval(wh+"+"+sct))
|
152
|
+
switch(tbody.Pos) {
|
153
|
+
case "left" : X=MouseX-tbody.Width-tbody.Xpos; Y=MouseY+tbody.Ypos; break
|
154
|
+
case "center": X=MouseX-(tbody.Width/2); Y=MouseY+tbody.Ypos; break
|
155
|
+
case "float": X=tbody.Xpos+eval(scl); Y=tbody.Ypos+eval(sct); break
|
156
|
+
case "fixed": X=tbody.Xpos; Y=tbody.Ypos; break
|
157
|
+
default: X=MouseX+tbody.Xpos; Y=MouseY+tbody.Ypos
|
158
|
+
}
|
159
|
+
|
160
|
+
if(tbody.wiw<tbody.Width+X) X = tbody.wiw-tbody.Width
|
161
|
+
if(tbody.wih<tbody.Height+Y+sbw) {
|
162
|
+
if(tbody.Pos=="float"||tbody.Pos=="fixed") Y = tbody.wih-tbody.Height-sbw
|
163
|
+
else Y = MouseY-tbody.Height
|
164
|
+
}
|
165
|
+
if(X<0) X=0
|
166
|
+
eval(obj+sl+"=X+PX;"+obj+st+"=Y+PX")
|
167
|
+
ViewTip()
|
168
|
+
}
|
169
|
+
}
|
170
|
+
|
171
|
+
function ViewTip() {
|
172
|
+
Count++
|
173
|
+
if(Count == 1) {
|
174
|
+
if(cssFilters&&FiltersEnabled) {
|
175
|
+
for(Index=28; Index<31; Index++) { TipLayer.filters[Index].enabled = 0 }
|
176
|
+
for(s=0; s<28; s++) { if(TipLayer.filters[s].status == 2) TipLayer.filters[s].stop() }
|
177
|
+
if(tbody.Transition == 51) tbody.Transition = parseInt(Math.random()*50)
|
178
|
+
var applyTrans = (tbody.Transition>-1&&tbody.Transition<24&&tbody.Duration>0)? 1:0
|
179
|
+
var advFilters = (tbody.Transition>23&&tbody.Transition<51&&tbody.Duration>0)? 1:0
|
180
|
+
var which = (applyTrans)?0:(advFilters)? tbody.Transition-23:0
|
181
|
+
if(tbody.Alpha>0&&tbody.Alpha<100) {
|
182
|
+
TipLayer.filters[28].enabled = 1
|
183
|
+
TipLayer.filters[28].opacity = tbody.Alpha
|
184
|
+
}
|
185
|
+
if(tbody.ShadowColor&&tbody.ShadowType == "simple") {
|
186
|
+
TipLayer.filters[29].enabled = 1
|
187
|
+
TipLayer.filters[29].color = tbody.ShadowColor
|
188
|
+
}
|
189
|
+
else if(tbody.ShadowColor&&tbody.ShadowType == "complex") {
|
190
|
+
TipLayer.filters[30].enabled = 1
|
191
|
+
TipLayer.filters[30].color = tbody.ShadowColor
|
192
|
+
}
|
193
|
+
if(applyTrans||advFilters) {
|
194
|
+
eval(obj+sv+hl)
|
195
|
+
if(applyTrans) TipLayer.filters[0].transition = tbody.Transition
|
196
|
+
TipLayer.filters[which].duration = tbody.Duration
|
197
|
+
TipLayer.filters[which].apply()
|
198
|
+
}
|
199
|
+
}
|
200
|
+
eval(obj+sv+vl)
|
201
|
+
if(cssFilters&&FiltersEnabled&&(applyTrans||advFilters)) TipLayer.filters[which].play()
|
202
|
+
if(hs == "sticky") move=0
|
203
|
+
}
|
204
|
+
}
|
205
|
+
|
206
|
+
function stickyhide() {
|
207
|
+
eval(HideTip)
|
208
|
+
}
|
209
|
+
|
210
|
+
function ReloadTip() {
|
211
|
+
if(nn4&&(evlw!=eval(ww)||evlh!=eval(wh))) location.reload()
|
212
|
+
else if(hs == "sticky") eval(HideTip)
|
213
|
+
}
|
214
|
+
|
215
|
+
function htm() {
|
216
|
+
if(sNav) {
|
217
|
+
if(hs!="keep") {
|
218
|
+
move=0;
|
219
|
+
if(hs!="sticky") eval(HideTip)
|
220
|
+
}
|
221
|
+
}
|
222
|
+
}
|
223
|
+
|
224
|
+
|
225
|
+
//-->
|
226
|
+
|
227
|
+
|
data/xmltv2html.css
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
|
2
|
+
body {
|
3
|
+
background-color: white;
|
4
|
+
color: black;
|
5
|
+
font-family: Arial, Helvetica, sans-serif;
|
6
|
+
font-size: 100%;
|
7
|
+
}
|
8
|
+
|
9
|
+
.channel
|
10
|
+
{
|
11
|
+
color: yellow;
|
12
|
+
background-color: red;
|
13
|
+
}
|
14
|
+
.time
|
15
|
+
{
|
16
|
+
color: white;
|
17
|
+
background-color: blue;
|
18
|
+
text-align: left;
|
19
|
+
}
|
20
|
+
.programme
|
21
|
+
{
|
22
|
+
color: red;
|
23
|
+
background-color: white;
|
24
|
+
}
|
25
|
+
.sports-event
|
26
|
+
{
|
27
|
+
color: red;
|
28
|
+
background-color: #99FF99;
|
29
|
+
}
|
30
|
+
.news
|
31
|
+
{
|
32
|
+
color: red;
|
33
|
+
background-color: #66CCFF;
|
34
|
+
}
|
35
|
+
.favorite
|
36
|
+
{
|
37
|
+
color: red;
|
38
|
+
background-color: yellow;
|
39
|
+
font-weight: bolder;
|
40
|
+
font-style: italic;
|
41
|
+
}
|
42
|
+
|
43
|
+
.date_in_time
|
44
|
+
{
|
45
|
+
color: yellow;
|
46
|
+
background-color: blue;
|
47
|
+
font-style: italic;
|
48
|
+
text-align: right;
|
49
|
+
font-size: smaller;
|
50
|
+
}
|
51
|
+
|
52
|
+
.info
|
53
|
+
{
|
54
|
+
color: green;
|
55
|
+
# background-color: blue;
|
56
|
+
font-style: italic;
|
57
|
+
font-weight: bolder;
|
58
|
+
}
|
59
|
+
.dummy
|
60
|
+
{
|
61
|
+
color: green;
|
62
|
+
background-color: white;
|
63
|
+
}
|
64
|
+
|
65
|
+
a.links {
|
66
|
+
text-decoration: none;
|
67
|
+
background: white;
|
68
|
+
color: red;
|
69
|
+
font-weight: bolder;
|
70
|
+
}
|
71
|
+
a.links:hover {
|
72
|
+
text-decoration: underline;
|
73
|
+
}
|
74
|
+
|
75
|
+
|