Compare commits

..

52 Commits

Author SHA1 Message Date
hummypkg
742a56485a catch more dlna database errors, bump to version 0.9.1
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@717 2a923420-c742-0410-a762-8d5b09965624
2012-02-05 20:07:49 +00:00
hummypkg
fa9905d8bd replace glob with readdir in some cases. Move paste button to clipboard
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@711 2a923420-c742-0410-a762-8d5b09965624
2012-02-01 21:02:43 +00:00
hummypkg
a3ecbe1d3f add system inuse
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@705 2a923420-c742-0410-a762-8d5b09965624
2012-01-30 21:59:18 +00:00
hummypkg
924bc72832 update to 0.9.0-2, fix vlc icons, require fixed jim
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@694 2a923420-c742-0410-a762-8d5b09965624
2012-01-28 11:15:22 +00:00
hummypkg
909605b074 fix deletions from non-mediaroot paths
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@691 2a923420-c742-0410-a762-8d5b09965624
2012-01-27 21:54:39 +00:00
hummypkg
f62904edb4 vlc working + media
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@690 2a923420-c742-0410-a762-8d5b09965624
2012-01-25 23:19:57 +00:00
hummypkg
8d36fe22dd checkpoint webif
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@687 2a923420-c742-0410-a762-8d5b09965624
2012-01-22 19:47:47 +00:00
hummypkg
2e0d49537d update jim documentation
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@686 2a923420-c742-0410-a762-8d5b09965624
2012-01-22 19:46:30 +00:00
hummypkg
572e31efcc only show transmission/mediatomb icons if running, fix pkgdev toggle
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@681 2a923420-c742-0410-a762-8d5b09965624
2012-01-21 01:27:06 +00:00
hummypkg
8ec03f2636 add SSL server support
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@679 2a923420-c742-0410-a762-8d5b09965624
2012-01-19 21:15:52 +00:00
hummypkg
95bef6f458 add network name
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@678 2a923420-c742-0410-a762-8d5b09965624
2012-01-18 22:15:20 +00:00
hummypkg
44038eb7a1 fix another size issue
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@677 2a923420-c742-0410-a762-8d5b09965624
2012-01-18 00:07:25 +00:00
hummypkg
ae607a6071 hover over synopsis, fix sizes, fix delete
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@676 2a923420-c742-0410-a762-8d5b09965624
2012-01-18 00:02:55 +00:00
hummypkg
c5de79b214 Streamline deletion. Touch files into dustbin.
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@674 2a923420-c742-0410-a762-8d5b09965624
2012-01-16 22:28:20 +00:00
hummypkg
fa839705fc rename default bin
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@672 2a923420-c742-0410-a762-8d5b09965624
2012-01-14 23:08:54 +00:00
hummypkg
3d75b93f1a allow deletions from inside dustbin
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@666 2a923420-c742-0410-a762-8d5b09965624
2012-01-14 00:29:44 +00:00
hummypkg
602f96e1ac support variable dustbin name
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@663 2a923420-c742-0410-a762-8d5b09965624
2012-01-14 00:12:07 +00:00
hummypkg
3312a76cc6 dynamic dustbin
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@661 2a923420-c742-0410-a762-8d5b09965624
2012-01-13 23:28:48 +00:00
hummypkg
88026872d9 add dustbin folder image
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@658 2a923420-c742-0410-a762-8d5b09965624
2012-01-13 21:34:24 +00:00
hummypkg
ce2dfa8338 update delete system
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@657 2a923420-c742-0410-a762-8d5b09965624
2012-01-13 21:23:03 +00:00
hummypkg
6e2a0f3e2b dustbin support + bugfix
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@648 2a923420-c742-0410-a762-8d5b09965624
2012-01-10 19:51:45 +00:00
hummypkg
ccb513be49 0.8.11
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@639 2a923420-c742-0410-a762-8d5b09965624
2012-01-08 21:10:38 +00:00
hummypkg
84b5cb9506 reinstate delete, add failed recordings
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@638 2a923420-c742-0410-a762-8d5b09965624
2012-01-08 20:54:07 +00:00
hummypkg
337a2add7a verson 0.8.10
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@636 2a923420-c742-0410-a762-8d5b09965624
2012-01-07 22:30:41 +00:00
hummypkg
4706fe6bcd disable delete
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@635 2a923420-c742-0410-a762-8d5b09965624
2012-01-07 22:30:19 +00:00
hummypkg
88d78a7d42 more verbose message
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@634 2a923420-c742-0410-a762-8d5b09965624
2012-01-06 23:57:31 +00:00
hummypkg
b442fef333 upgradable packages come first
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@632 2a923420-c742-0410-a762-8d5b09965624
2012-01-06 23:44:55 +00:00
hummypkg
f771f55017 fix pkg upgrade tab
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@631 2a923420-c742-0410-a762-8d5b09965624
2012-01-06 23:39:15 +00:00
hummypkg
267ba4fade fix avail
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@630 2a923420-c742-0410-a762-8d5b09965624
2012-01-06 23:27:35 +00:00
hummypkg
c2ec779465 allow restart cancel, improve logfile list
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@629 2a923420-c742-0410-a762-8d5b09965624
2012-01-05 22:42:45 +00:00
hummypkg
75b31696c5 dynamic databases
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@600 2a923420-c742-0410-a762-8d5b09965624
2012-01-03 12:12:07 +00:00
hummypkg
f54d162298 update to 0.8.9
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@594 2a923420-c742-0410-a762-8d5b09965624
2011-12-29 01:17:55 +00:00
hummypkg
2a0bcbc81e minor tweaks for IE9
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@593 2a923420-c742-0410-a762-8d5b09965624
2011-12-29 01:17:32 +00:00
hummypkg
4d3183ea61 working copy/paste
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@592 2a923420-c742-0410-a762-8d5b09965624
2011-12-29 00:57:18 +00:00
hummypkg
7c038a1776 checkpoint
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@588 2a923420-c742-0410-a762-8d5b09965624
2011-12-28 21:36:35 +00:00
hummypkg
822de81971 checkpoint - working on clipboard
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@587 2a923420-c742-0410-a762-8d5b09965624
2011-12-28 14:11:10 +00:00
hummypkg
09e71400a2 updates
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@585 2a923420-c742-0410-a762-8d5b09965624
2011-12-27 18:43:40 +00:00
hummypkg
18cafc8c39 handle ar/pad icons
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@576 2a923420-c742-0410-a762-8d5b09965624
2011-12-19 22:52:17 +00:00
hummypkg
593b7dbb89 fix bugs, show AR/Pad status
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@572 2a923420-c742-0410-a762-8d5b09965624
2011-12-19 15:57:03 +00:00
hummypkg
de47e46fe7 fix scheduling problem
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@566 2a923420-c742-0410-a762-8d5b09965624
2011-12-18 21:17:03 +00:00
hummypkg
509c98ee74 update
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@564 2a923420-c742-0410-a762-8d5b09965624
2011-12-14 13:55:58 +00:00
hummypkg
ddb63e68b7 7 days, not 7 hours
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@562 2a923420-c742-0410-a762-8d5b09965624
2011-12-13 22:55:42 +00:00
hummypkg
5de2ba1c37 fix bug
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@561 2a923420-c742-0410-a762-8d5b09965624
2011-12-13 21:00:27 +00:00
hummypkg
43f6281410 add flatten support
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@560 2a923420-c742-0410-a762-8d5b09965624
2011-12-12 23:45:58 +00:00
hummypkg
8166af0f1b fix IE error, fix typo in anacrontab
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@559 2a923420-c742-0410-a762-8d5b09965624
2011-12-12 21:11:08 +00:00
hummypkg
25344c5ff4 add audio extraction
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@554 2a923420-c742-0410-a762-8d5b09965624
2011-12-09 20:33:57 +00:00
hummypkg
b6ce0e3b16 fix sorting of backups
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@553 2a923420-c742-0410-a762-8d5b09965624
2011-12-09 10:57:13 +00:00
hummypkg
a189b524ab automatic daily schedule backups
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@551 2a923420-c742-0410-a762-8d5b09965624
2011-12-09 10:35:21 +00:00
hummypkg
84b00010a8 update icons
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@550 2a923420-c742-0410-a762-8d5b09965624
2011-12-09 10:12:02 +00:00
hummypkg
993958d346 update icons
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@549 2a923420-c742-0410-a762-8d5b09965624
2011-12-09 10:11:41 +00:00
hummypkg
1045587fbd fix error on default browse directory
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@545 2a923420-c742-0410-a762-8d5b09965624
2011-12-06 00:13:41 +00:00
hummypkg
659fd40fe9 update to 0.8.3
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@543 2a923420-c742-0410-a762-8d5b09965624
2011-12-05 21:45:24 +00:00
121 changed files with 5247 additions and 1587 deletions

View File

@@ -1,11 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 0.8.2
Version: 0.9.1
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4-1),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.7),hmt(>=1.1.1),ssmtp
Replaces: af123-webif
Conflicts: af123-webif
Suggests: ffmpeg,webif-iphone,nicesplice
Depends: mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2
Suggests: ffmpeg,webif-iphone
Description: An evolving web interface for the Humax.

17
CONTROL/postinst Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
export tmpf=/tmp/cronf.$$
# Add anacron jobs
ana=$PKG_ROOT/etc/anacrontab
grep -v 'backup/backup.jim' $ana > $tmpf
(
cat $tmpf
echo "1 8 sched_backup /mod/var/mongoose/cgi-bin/backup/backup.jim"
) > $ana
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
exit 0

10
CONTROL/prerm Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
export tmpf=/tmp/cronf.$$
ana=/mod/etc/anacrontab
grep -v 'backup/backup.jim' $ana > $tmpf
cp $tmpf $ana
exit 0

View File

@@ -13,12 +13,23 @@ puts ""
cgi_input
#cgi_dump
if {![dict exists $_cgi file]} {
puts "No filename supplied."
exit
set now [clock seconds]
set file [file tail [cgi_get file \
[clock format $now -format "auto-%Y-%b-%d-%H:%M"]]]
if {[string match {auto-*} $file]} {
# Delete any automatic backups over 7 days old.
set mt $(7 * 86400)
foreach af [glob -nocomplain "$dir/auto-*"] {
set aft [file mtime $af]
set diff $($now - $aft)
if {$diff > $mt} {
puts "Removing $af"
file delete $af
}
}
}
set file [file tail [dict get $_cgi file]]
set ffile "/$dir/$file.rbk"
if {[file exists $ffile]} {

View File

@@ -20,7 +20,18 @@ if {![file isdirectory $dir]} {
exit
}
set backups [glob -nocomplain "$dir/*.rbk"]
proc s_time {a b} {
file stat $a l
set at $l(ctime)
file stat $b l
set bt $l(ctime)
if {$at < $bt} { return -1 }
if {$at > $bt} { return 1 }
return 0
}
set backups [lsort -command s_time [glob -nocomplain "$dir/*.rbk"]]
if {![llength $backups]} {
empty

View File

@@ -106,7 +106,7 @@ foreach line $data {
puts " $chan"
if {!$hsvc} {
if {$hsvc eq ""} {
puts " Cannot map channel name to service."
continue
}

View File

@@ -2,32 +2,80 @@
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class pretty_size system.class
require ts.class pretty_size system.class settings.class escape
puts "Content-Type: text/html"
puts ""
set nicesplice [system pkginst nicesplice]
set flatten [system pkginst flatten]
set ignore {.nts .thm .hmt .hmi}
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov}
set ignore {.nts .thm .hmi}
set include {.ts .avi .mpg .mpeg .wmv .mkv .mp3 .mp4 .mov .hmt}
cgi_input
#cgi_dump
#set env(REQUEST_URI) ''
#set _cgi(dir) "/media/My Video/\[Don't Die Young\]"
if {![dict exists $env REQUEST_URI]} {
set env(REQUEST_URI) ""
set _cgi(dir) "/media/My Video/"
}
if {![dict exists $env QUERY_STRING]} { set env(QUERY_STRING) "root" }
set order [cgi_get order -]
if {$order eq "-"} {
set order [[settings new] sortorder]
} else {
[settings new] sortorder $order
}
set model [system model]
set dustbin [system dustbin 1]
proc icon {img {hover ""} {extra ""}} {
puts -nonewline "<img src=$img class=va height=21 $extra"
if {$hover ne ""} {
puts -nonewline " alt=\"$hover\" title=\"$hover\""
}
puts ">"
}
proc directory {file bfile} {
global flatten
regsub -all " +" $bfile "" tbfile
puts "<div class=va>"
puts "<img border=0 class=va id=\"img$tbfile\"
src=/images/711_1_09_Media_Folder.png>"
set img "/images/711_1_09_Media_Folder.png"
if {$bfile eq $::dustbin} { set img "/img/Dustbin_Folder.png" }
puts "<img border=0 class=va id=\"img$tbfile\" src=$img>"
puts "<input class=\"fs fsdir\" type=checkbox>"
puts "<a href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
file=\"$file\">"
puts "<a class=dbf
href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
file=\"[cgi_quote_url $file]\">"
puts "$bfile</a><span class=filesize id=\"$tbfile\">
</span></div>"
</span>"
set noflat 0
if $flatten {
if {[string match {\[*\]} [file tail $file]]} { set noflat 1 }
if {[file exists "$file/.noflatten"]} { set noflat 1 }
if $noflat { icon "/img/flat-tyre.png" "No-flatten" }
}
puts -nonewline "
<a href=#>
<img class=\"dopt va\" border=0 width=45 "
if $flatten { puts -nonewline "noflat=$noflat " }
puts "
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
"
puts "
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
"
puts "</div>"
}
proc entry {file} {{i 0}} {
@@ -51,6 +99,12 @@ proc entry {file} {{i 0}} {
set type ts
set ts [ts fetch $file 1]
set img Video_TS
} elseif {$ext eq ".hmt"} {
if {[file exists "${base}.ts"]} { continue }
# Sole hmt file indicates failure to track.
set type bad
set ts 0
set img Video_Failed
} else {
set type gen
set ts 0
@@ -60,22 +114,25 @@ proc entry {file} {{i 0}} {
set new 0
if {$type eq "ts"} {
if {[$ts flag "New"] > 0} { set new 1 }
} else {
if {![file exists "[file rootname $file].hmi"]} { set new 1 }
} elseif {$type eq "gen"} {
if {![file exists "${base}.hmi"]} { set new 1 }
}
if {$new} { append img _New }
set fscl "fs"
set synopsis ""
if {$type eq "ts"} {
set fscl "fs fsts"
set synopsis [cgi_quote_html [$ts get synopsis]]
}
puts "
<div class=\"va bf\" id=[incr i]>
<img class=va border=0 src=/img/$img.png>
<input class=\"$fscl\" type=checkbox>
<a class=bf file=\"$file\" type=$type href=#>
<a class=bf title=\"$synopsis\"
file=\"[cgi_quote_url $file]\" type=$type href=#>
$bfile
</a>
"
@@ -90,6 +147,7 @@ proc entry {file} {{i 0}} {
set odencd 1
set def unknown
set bx 0
set dlna 0
if {$type eq "ts"} {
# HD / SD
if {[$ts get definition] eq "HD"} {
@@ -99,32 +157,33 @@ proc entry {file} {{i 0}} {
set def SD
set img "172_1_26_SD"
}
puts "<img class=va src=/images/$img.png height=21>"
icon "/images/$img.png"
# Locked
if {[$ts flag "Locked"] > 0} {
set locked 1
puts "<img class=va src=/images/178_1_00_Icon_Lock.png
height=21>"
icon "/images/178_1_00_Icon_Lock.png" "Locked"
}
# Encrypted
if {[$ts flag "Encrypted"] > 0} {
set encd 1
puts "<img class=va
src=/images/749_1_26_Video_Encryption.png
height=21>"
icon "/images/749_1_26_Video_Encryption.png" ""
}
if {![$ts flag "ODEncrypted"]} {
puts "<img class=va src=/img/Decrypted.png height=21>"
set odencd 0
icon "/img/Decrypted.png" "Decrypted"
}
# Guidance
if {[$ts flag "Guidance"] > 0} {
puts "<img class=va
src=/images/174_1_26_GuidancePolicy.png
height=21>"
icon "/images/174_1_26_GuidancePolicy.png"
}
# Indexed
if {$::model eq "HDR" && [llength [$ts dlnaloc]]} {
icon "/img/dlna.png" "Indexed by DLNA Server"
set dlna 1
}
set bx [$ts get bookmarks]
@@ -136,7 +195,7 @@ proc entry {file} {{i 0}} {
<a href=#>
<img class=\"opt va\" border=0 width=45 type=$type did=$i
locked=$locked encd=$encd def=$def new=$new bx=$bx
odencd=$odencd
odencd=$odencd dlna=$dlna
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
@@ -154,99 +213,21 @@ header
puts {
<link href=/css/jquery.contextMenu.css rel=stylesheet type=text/css />
<script type="text/javascript" src="/js/jquery.contextMenu.js"></script>
<ul id=optmenu class=contextMenu>
<li class=delete><a href=#delete>Delete</a></li>
<li><a href=#lock>Toggle Lock</a></li>
<li><a href=#enc>Toggle Enc</a></li>
<li><a href=#new>Toggle New</a></li>
<li><a href=#rename>Rename</a></li>
<li><a href=#download>Download</a></li>
}
if {[system model] eq "HDR"} {
puts { <li class="separator"><a href=#decrypt>Decrypt</a></li> }
}
if $nicesplice {
puts { <li class="cut separator"><a href=#crop>Crop</a></li> }
}
puts {
</ul>
<div id=renameform title="Rename media file" style="display: none">
<form id=renameform_form>
<input type=hidden name="renameorig" id="renameorig" value="">
<input type=hidden name="titleorig" id="titleorig" value="">
<table border=0>
<tr>
<th>
<label for="rename">
<b>New Filename</b>
</label>
</th>
<td>
<input type=text name="rename" id="rename"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<th>
<label for="renametitle" style="padding-top: 0.5em">
<b>New EPG Title</b>
</label>
</th>
<td>
<input type=text name="renametitle" id="renametitle"
value="" size=70 maxlength=48
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<td colspan=2 id=synopsis style="font-style: italic"></td>
</tr>
</table>
</form>
</div>
<div id=savestreamform title="Save streamed content"
style="display: none">
<div class=pre id=savestream_detail></div>
<form id=savestream_form>
}
puts "<input type=hidden name=dir value=\"$dir\">"
puts {
<table border=0>
<tr>
<th>
<label for="savestream_name">
<b>Filename</b>
</label>
</th>
<td>
<input type=text name="savestream_name"
id="savestream_name"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
<img id=savestream_spin src=/img/loading.gif>
</td>
</tr>
</table>
</form>
</div>
<div id=dialogue></div>
<div id=confirm title="Confirmation Required"></div>
<link href=/css/jquery.bar.css rel=stylesheet type=text/css />
<script type="text/javascript" src="/js/jquery.bar.js"></script>
<script type=text/javascript src=/cgi-bin/browse/browse.js></script>
<link type=text/css rel=stylesheet href=/cgi-bin/browse/style.css />
}
puts "<span style=\"display:none\" id=dir>$dir</span>"
source /mod/var/mongoose/cgi-bin/browse/assets.jim
# Breadcrumb path
puts "
<fieldset style=\"margin: 1em\">
<span style=\"display:none\" id=dir>$dir</span>
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
"
# Breadcrumb path
set stub ""
foreach part [split $dir /] {
if {$stub eq "/"} { set name $part } else { set name "/$part" }
@@ -268,24 +249,79 @@ if {$parent ne ""} {
"
}
# Strip double slashes
regsub -all -- {\/+} "$dir/*" "/" dir
proc s_time {a b} {
set ad [file isdirectory $a]
set bd [file isdirectory $b]
# Escape square brackets (for glob)
regsub -all {([\\[])} $dir {\\\1} dir
if {$ad && !$bd} { return -1 }
if {$bd && !$ad} { return 1 }
if {$ad && $bd} {
if {$a < $b} { return -1 }
if {$a > $b} { return 1 }
return 0
}
foreach file [lsort [glob -nocomplain "$dir"]] {
entry $file
file stat $a l
set at $l(ctime)
file stat $b l
set bt $l(ctime)
if {$at < $bt} { return -1 }
if {$at > $bt} { return 1 }
return 0
}
set files [readdir -nocomplain $dir]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort $files] }
}
foreach file $files { entry "$dir/$file" }
puts "<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>"
# Sort icons
puts "<div id=sortdiv>"
set sortlist {{0 sort_name name} {1 sort_date date}}
foreach sl $sortlist {
lassign $sl index img descr
if {$index} { puts " | " }
set tag "Currently sorting"
if {$order != $index} {
puts "
<a href=$env(REQUEST_URI)?$env(QUERY_STRING)&order=$index>"
set tag "Sort"
}
puts "<img class=va border=0 src=/img/$img.gif> $tag by $descr"
if {$order != $index} {
puts "</a>"
}
}
puts "</div>"
puts "</fieldset>"
puts {
<fieldset class=left style="margin: 0 1em 1em 1em">
<legend style="font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em; color: #1e5bbd;">
File Clipboard
</legend>
<div id=clipboard>
<img src=/img/loading.gif> <i>Loading...</i>
</div>
</fieldset>
}
puts "<div class=brow>"
puts {
<button id=copy>Copy</button>
<button id=cut>Cut</button>
<button id=delete>Delete</button>
<button id=newdir>New Folder</button>
<div id=deletewait class=blood style="display: none">
<img src=/img/loading.gif>Deleting may take some time, please be patient...
</div>

View File

@@ -0,0 +1,161 @@
#!/mod/bin/jimsh
puts {
<div id=jbar></div>
<ul id=optmenu class=contextMenu style="width: 160px">
<li class=delete><a href=#delete>Delete</a></li>
<li class=cut><a href=#cut>Cut to clipboard</a></li>
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
<li class=separator><a href=#rename>Rename</a></li>
<li><a href=#download>Download</a></li>
}
if {$model eq "HDR"} {
puts { <li class="separator"><a href=#decrypt>Decrypt</a></li> }
}
if {[system pkginst ffmpeg]} {
puts { <li><a href=#audio>Extract Audio</a></li> }
}
if $nicesplice {
puts { <li class="cut"><a href=#crop>Crop</a></li> }
}
puts {
<li class=separator><a href=#lock>Toggle Lock</a></li>
<li><a href=#enc>Toggle Enc</a></li>
<li><a href=#new>Toggle New</a></li>
</ul>
<ul id=doptmenu class=contextMenu style="width: 160px">
<li class=delete><a href=#delete>Delete</a></li>
<li class=cut><a href=#cut>Cut to clipboard</a></li>
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
<li class=separator><a href=#rename>Rename</a></li>
}
if $flatten {
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
}
puts {
</ul>
<div id=renameform title="Rename media file" style="display: none">
<form id=renameform_form>
<input type=hidden name="renameorig" id="renameorig" value="">
<input type=hidden name="titleorig" id="titleorig" value="">
<table border=0>
<tr>
<th>
<label for="rename">
<b>New Filename</b>
</label>
</th>
<td>
<input type=text name="rename" id="rename"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<th>
<label for="renametitle" style="padding-top: 0.5em">
<b>New Medialist Title</b>
</label>
</th>
<td>
<input type=text name="renametitle" id="renametitle"
value="" size=70 maxlength=48
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<td colspan=2 id=synopsis style="font-style: italic"></td>
</tr>
</table>
</form>
</div>
<div id=drenameform title="Rename directory" style="display: none">
<form id=drenameform_form>
<input type=hidden name="renameorig" id="drenameorig" value="">
<table border=0>
<tr>
<th>
<label for="drename">
<b>New Directory Name</b>
</label>
</th>
<td>
<input type=text name="rename" id="drename"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
</td>
</tr>
</table>
</form>
</div>
<div id=savestreamform title="Save streamed content"
style="display: none">
<div class=pre id=savestream_detail></div>
<form id=savestream_form>
}
puts "<input type=hidden name=dir value=\"$dir\">"
puts {
<table border=0>
<tr>
<th>
<label for="savestream_name">
<b>Filename</b>
</label>
</th>
<td>
<input type=text name="savestream_name"
id="savestream_name"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
<img id=savestream_spin src=/img/loading.gif>
</td>
</tr>
</table>
</form>
</div>
<div id=newdirform title="New Folder" style="display: none">
<form id=newdirform_form>
}
puts "<input type=hidden name=dir value=\"$dir\">"
puts {
<table border=0>
<tr>
<th>
<label for="newdirname">
<b>New Folder Name</b>
</label>
</th>
<td>
<input type=text name="newdirname" id="newdirname"
value="" size=70 maxlength=255
class="text ui-widget-content ui-corner-all">
</td>
</tr>
</table>
</form>
</div>
<div id=dialogue></div>
<div id=confirm title="Confirmation Required"></div>
<div id=pwdialogue style="display: none">
<center>
<img src=/img/loading.gif>
<br><br>
Please wait...
<div id=pwfeedback></div>
</center>
</div>
}

View File

@@ -0,0 +1,109 @@
#!/mod/bin/jimsh
package require sqlite3
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class system.class
puts "Content-Type: text/html\r\n\r\n"
cgi_input
#cgi_dump
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
if {[cgi_get do] eq "it"} {
set xstart [clock milliseconds]
set base [file rootname $rfile]
set shname [file tail $base]
puts "Processing $shname"
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
-i $rfile -f mp3 \
-vn -acodec copy "${base}.mp3"]
if {[system pkginst id3v2]} {
puts [exec /mod/bin/id3v2 \
--song "[$ts get title]" \
--comment "[$ts get synopsis]" \
--album "[$ts get channel_name]" \
--year "[clock format [$ts get start] -format {%Y}]" \
"${base}.mp3"]
}
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
puts "Time taken: $xtime"
exit
}
header
puts "
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
<script type=\"text/javascript\" src=\"/js/jquery.progressbar.js\"></script>
<table class=keyval cellpadding=5>
<tr><th>File:</th><td>$rfile</td></tr>
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
</table>
"
puts {
<div style="margin-top: 10px"></div>
<div id=audiodiv><button id=audioit>Perform audio extraction</button></div>
<div id=progressdiv style="display: none">
Extracting audio: <div id=progressbar></div>
}
puts "<button id=back
dir=\"[cgi_quote_url $dir]\"
rfile=\"[cgi_quote_url $rfile]\"
style=\"display: none\">Back to media list</button>"
puts {
<div id=output class=pre style="margin-top: 10px"></div>
</div>
<script type=text/javascript>
var handle = 0;
function update()
{
$.get('/cgi-bin/browse/audio_progress.jim?file='
+ $('#back').attr('rfile'), function(data) {
if (handle)
$('#progressbar').reportprogress(data);
});
}
$(document).ready(function() {
$('#progressbar').reportprogress(0);
$('#back').button().click(function() {
window.location = '/cgi-bin/browse.jim?dir=' + $(this).attr('dir');
});
$('#audioit').button().click(function() {
$('#audiodiv').hide('slow');
$('#progressdiv').show('slow');
handle = setInterval("update()", 1000);
$('#output').load(document.URL + '&do=it', function() {
clearInterval(handle);
handle = 0;
$('#back').show();
$('#progressbar').reportprogress(100);
});
});
});
</script>
</div>
}

View File

@@ -0,0 +1,26 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class
puts "Content-Type: text/html\r\n\r\n"
cgi_input
#cgi_dump
set tsfile [cgi_get file]
set rfile [file normalize $tsfile]
set bfile [file rootname $rfile]
if {![file exists "${bfile}.mp3"]} {
puts "0"
} else {
set sz [file size $rfile]
set nsz [expr [file size "${bfile}.mp3"] / 0.3]
set perc [expr $nsz * 100 / $sz]
if {$perc > 100} { set perc 100 }
puts $perc
}

View File

@@ -19,11 +19,68 @@
};
})(jQuery);
var dir;
function disableall()
{
$('button,a,input').disable();
}
function reloadclipboard()
{
$('#clipboard')
.empty()
.html('<img src=/img/loading.gif> <i>Loading...</i>')
.load('/cgi-bin/browse/clipboard.jim', function() {
// Start Clipboard post-load actions
if ($('#clipclear').length)
$('#paste').enable();
else
$('#paste').disable();
$('#clipclear').button().click(function() {
$.get('/cgi-bin/browse/clipboard.jim?act=clear', function() {
reloadclipboard();
});
});
$('a.clipdel').click(function() {
$.get('/cgi-bin/browse/clipboard.jim?act=remove&path=' +
$(this).attr('path'), function() {
reloadclipboard();
});
});
$('#paste').button()
.click(function() {
disableall();
$('#pwdialogue').dialog({
title: "Pasting from clipboard",
modal: true, autoOpen: true,
height: 'auto', width: 'auto',
show: 'scale', hide: 'fade',
draggable: false, resizable: false,
closeOnEscape: false,
open: function() {
$('.ui-dialog-titlebar-close').hide();
}
});
$('#pwfeedback').load(
'/cgi-bin/browse/clipboard.jim?act=paste&dir='
+ encodeURIComponent(dir), function() {
$('#pwdialogue').dialog('close');
window.location.reload(true);
});
});
// End Clipboard post-load actions
});
}
function epginfo_callback(data, status, xhr)
{
var width = 85;
@@ -75,16 +132,17 @@ function new_folder_callback(data, status, xhr)
$.each(data, set_folder_new);
}
function delete_callback(file, type, id)
function delete_callback(file, dir, id)
{
var el = 'div.bf#' + id;
var results = el + ' .results';
var url = '/cgi-bin/browse/delete.jim?file=' +
encodeURIComponent(file) + '&type=' + type;
$(results)
.html('<img src=/img/loading.gif>Deleting, please wait...')
.slideDown('slow')
.load(url, function() {
.load('/cgi-bin/browse/delete.jim', {
'dir': dir,
'files': [decodeURIComponent(file)]
}, function() {
$(el).delay(3000).slideUp(300, function() {
$(el).remove();
});
@@ -93,19 +151,19 @@ function delete_callback(file, type, id)
function lock_callback(file, type, id)
{
var url = '/cgi-bin/browse/lock.jim?file=' + encodeURIComponent(file);
var url = '/cgi-bin/browse/lock.jim?file=' + file;
$.get(url, function() { window.location.reload(true); });
}
function enc_callback(file, type, id)
{
var url = '/cgi-bin/browse/enc.jim?file=' + encodeURIComponent(file);
var url = '/cgi-bin/browse/enc.jim?file=' + file;
$.get(url, function() { window.location.reload(true); });
}
function new_callback(file, type, id)
{
var url = '/cgi-bin/browse/new.jim?file=' + encodeURIComponent(file);
var url = '/cgi-bin/browse/new.jim?file=' + file;
$.get(url, function() { window.location.reload(true); });
}
@@ -116,6 +174,20 @@ function rename_submit()
function() { window.location.reload(true); });
}
function drename_submit()
{
var s = $('#drenameform_form').serialize();
$.get('/cgi-bin/browse/rename.jim?' + s,
function() { window.location.reload(true); });
}
function newdir_submit()
{
var s = $('#newdirform_form').serialize();
$.get('/cgi-bin/browse/mknewdir.jim?' + s,
function() { window.location.reload(true); });
}
function savestream_submit()
{
var s = $('#savestream_form').serialize();
@@ -141,7 +213,7 @@ function confirm_action(action, callback, file, type, id)
});
$('#confirm').empty().html(
'Are you sure you wish to ' + action + '<br>' +
'<i>' + bfile + '</i> ?'
'<i>' + decodeURIComponent(bfile) + '</i> ?'
);
$confirm.dialog('open');
}
@@ -152,7 +224,7 @@ function preparemenu(el, menu)
{
if (el.attr('def') == 'HD')
{
$('#optmenu').enableContextMenuItems('#enc');
$(menu).enableContextMenuItems('#enc');
if (el.attr('encd') == 1)
$(menu).changeContextMenuItem('#enc',
'Remove Enc');
@@ -162,50 +234,68 @@ function preparemenu(el, menu)
}
if (el.attr('bx') > 0)
$('#optmenu').enableContextMenuItems('#crop');
$(menu).enableContextMenuItems('#crop');
else
$('#optmenu').disableContextMenuItems('#crop');
$(menu).disableContextMenuItems('#crop');
$('#optmenu').enableContextMenuItems('#new');
$(menu).enableContextMenuItems('#new');
if (el.attr('new') == 1)
$(menu).changeContextMenuItem('#new', 'Mark watched');
else
$(menu).changeContextMenuItem('#new', 'Mark new');
$('#optmenu').enableContextMenuItems('#lock');
$(menu).enableContextMenuItems('#lock');
if (el.attr('locked') == 1)
{
$(menu).changeContextMenuItem('#lock', 'Unlock');
$('#optmenu').disableContextMenuItems('#delete');
$(menu).disableContextMenuItems('#delete');
}
else
{
$(menu).changeContextMenuItem('#lock', 'Lock');
$('#optmenu').enableContextMenuItems('#delete');
$(menu).enableContextMenuItems('#delete');
}
if (el.attr('odencd') == 1)
$('#optmenu').enableContextMenuItems('#decrypt');
if (el.attr('odencd') == 1 && el.attr('dlna') == 1)
$(menu).enableContextMenuItems('#decrypt');
else
$('#optmenu').disableContextMenuItems('#decrypt');
$(menu).disableContextMenuItems('#decrypt');
if (el.attr('odencd') == 1)
$(menu).disableContextMenuItems('#audio');
else
$(menu).enableContextMenuItems('#audio');
}
else
{
$('#optmenu').enableContextMenuItems('#delete');
$('#optmenu').disableContextMenuItems('#lock');
$('#optmenu').disableContextMenuItems('#enc');
$('#optmenu').disableContextMenuItems('#new');
$('#optmenu').disableContextMenuItems('#decrypt');
$('#optmenu').disableContextMenuItems('#crop');
$(menu).enableContextMenuItems('#delete');
$(menu).disableContextMenuItems('#lock');
$(menu).disableContextMenuItems('#enc');
$(menu).disableContextMenuItems('#new');
$(menu).disableContextMenuItems('#decrypt');
$(menu).disableContextMenuItems('#audio');
$(menu).disableContextMenuItems('#crop');
}
}
function preparedmenu(el, menu)
{
if (el.attr('noflat') != undefined)
{
if (el.attr('noflat') > 0)
$(menu).changeContextMenuItem('#flat', 'Allow Flatten');
else
$(menu).changeContextMenuItem('#flat',
'Prevent Flatten');
}
}
$(document).ready(function() {
dir = $('#dir').text();
var menuclick = function(action, el, pos)
{
var file = $(el).parent().prevAll('a.bf').last().attr('file');
@@ -217,7 +307,18 @@ var menuclick = function(action, el, pos)
{
case 'delete':
confirm_action('delete', delete_callback, file,
type, id);
dir, id);
break;
case 'copy':
if (!confirm('Are you sure? Copying recordings takes a long time!'))
break;
// Fallthrough
case 'cut':
$.get('/cgi-bin/browse/clipboard.jim?act=add&mode=' + action +
'&path=' + file, function() {
reloadclipboard();
});
break;
case 'lock':
@@ -236,8 +337,8 @@ var menuclick = function(action, el, pos)
break;
case 'rename':
$('#rename').val(bfile);
$('#renameorig').val(file);
$('#rename').val(decodeURIComponent(bfile));
$('#renameorig').val(decodeURIComponent(file));
$('#titleorig').val('');
$('#renametitle').val('');
@@ -247,7 +348,7 @@ var menuclick = function(action, el, pos)
if (type == 'ts')
{
$.getJSON('/cgi-bin/browse/epgtitle.jim?file=' +
encodeURIComponent(file), epginfo_callback);
file, epginfo_callback);
}
$('#renameform').dialog('open');
@@ -255,17 +356,81 @@ var menuclick = function(action, el, pos)
case 'download':
window.location.href = '/cgi-bin/browse/download.jim?file=' +
encodeURIComponent(file);
file;
break;
case 'crop':
window.location.href = '/cgi-bin/browse/crop.jim?file=' +
encodeURIComponent(file);
file;
break;
case 'decrypt':
window.location.href = '/cgi-bin/browse/decrypt.jim?file=' +
encodeURIComponent(file);
file;
break;
case 'audio':
window.location.href = '/cgi-bin/browse/audio.jim?file=' +
file;
break;
default:
alert('Unhandled action: ' + action);
break;
}
};
var dmenuclick = function(action, el, pos)
{
var direl = $(el).parent().parent();
var file = $(el).parent().prevAll('a.dbf').last().attr('file');
var bfile = file.replace(/.*\//g, '');
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
var results = $(el).parent().next('div.results');
switch (action)
{
case 'delete':
if (confirm('Are you sure you wish to delete "' +
decodeURIComponent(file) +
'" and all files within it?'))
{
$(results)
.html('<img src=/img/loading.gif>' +
'Deleting, please wait...')
.slideDown('slow')
.load('/cgi-bin/browse/delete.jim', {
'dir': dir,
'files': [decodeURIComponent(file)]
}, function() {
$(direl).delay(3000).slideUp(300, function() {
$(direl).remove();
});
});
}
break;
case 'copy':
if (!confirm('Are you sure? Copying directories can take a very long time!'))
break;
// Fallthrough
case 'cut':
$.get('/cgi-bin/browse/clipboard.jim?act=add&mode=' + action +
'&path=' + file, function() {
reloadclipboard();
});
break;
case 'rename':
$('#drename').val(decodeURIComponent(bfile));
$('#drenameorig').val(decodeURIComponent(file));
$('#drenameform').dialog('open');
break;
case 'flat':
var url = '/cgi-bin/browse/flat.jim?file=' + file;
$.get(url, function() { window.location.reload(true); });
break;
default:
@@ -284,9 +449,25 @@ var menuclick = function(action, el, pos)
menuclick
);
$('img.dopt').contextMenu(
{
menu: 'doptmenu',
leftButton: true,
beforeShow: preparedmenu
},
dmenuclick
);
// Disable items which are not yet implemented.
$('#optmenu').disableContextMenuItems('#title');
var $buttons = {
"Close" : function() {$(this).dialog('close');}
};
var $buttonsp = $.extend(
{"Play" : function() { doplay(); }},
$buttons);
// Create reusable dialogue.
var $dialog = $('#dialogue').dialog({
title: "Media Details",
@@ -294,23 +475,43 @@ var menuclick = function(action, el, pos)
height: 600, width: 700,
show: 'scale', hide: 'fade',
draggable: true, resizable: true,
buttons: {
"Close": function() {
$(this).dialog('close');
}
},
buttons: $buttons,
close: function(e,u) { $('#dialogue').empty().html(
'<img src="/img/loading.gif" alt="loading">'); }
});
function doplay()
{
var file = $dialog.attr('file');
var type = $dialog.attr('type');
disableall();
window.location = '/cgi-bin/browse/play.jim?' +
'dir=' + encodeURIComponent(dir) +
'&file=' + file;
}
// Bind dialogue open to filenames.
$('a.bf').click(function(e) {
e.preventDefault();
var file = $(this).attr('file');
var type = $(this).attr('type');
var url = '/cgi-bin/browse/file.jim?file=' +
encodeURIComponent(file) + '&type=' + type;
$('#dialogue').load(url);
var opt = $(this).nextAll('a').find('img.opt');
var url = '/cgi-bin/browse/file.jim?file=' + file
+ '&type=' + type;
$dialog.load(url);
$dialog.attr('file', file);
$dialog.attr('type', type);
if (type == 'ts' &&
(opt.attr('odencd') == 0 || opt.attr('dlna') == 1))
$dialog.dialog("option", "buttons", $buttonsp);
else
$dialog.dialog("option", "buttons", $buttons);
$dialog.dialog('open');
});
@@ -327,6 +528,19 @@ var menuclick = function(action, el, pos)
close: function() { $('#rename').val(''); }
});
$('#drenameform').dialog({
autoOpen: false,
height: 'auto', width: 'auto',
modal: true,
buttons: {
"Update": drename_submit,
"Close": function() {
$(this).dialog('close');
}
},
close: function() { $('#drename').val(''); }
});
$('#savestreamform').dialog({
autoOpen: false,
height: 'auto', width: 'auto',
@@ -347,8 +561,6 @@ var menuclick = function(action, el, pos)
show: 'fade', hide: 'fade',
draggable: false, resizable: false
});
var dir = $('#dir').text();
// Load folder sizes
$.getJSON('/cgi-bin/browse/sizes.jim?dir=' + encodeURIComponent(dir),
@@ -358,6 +570,9 @@ var menuclick = function(action, el, pos)
$.getJSON('/cgi-bin/browse/newdir.jim?dir=' + encodeURIComponent(dir),
new_folder_callback);
// Load clipboard
reloadclipboard();
// Uncheck everything
$('input.fs:checked').attr('checked', false);
@@ -389,7 +604,7 @@ var menuclick = function(action, el, pos)
.click(function() {
var files = new Array();
var els = $('input.fsts:checked + a').each(function() {
files.push(encodeURIComponent($(this).attr('file')));
files.push($(this).attr('file'));
});
//console.log("%o", files);
window.location.href = '/cgi-bin/browse/join.jim?files=' +
@@ -400,7 +615,7 @@ var menuclick = function(action, el, pos)
.click(function() {
var files = new Array();
var els = $('input.fs:checked + a').each(function() {
files.push(encodeURIComponent($(this).attr('file')));
files.push(decodeURIComponent($(this).attr('file')));
});
//console.log("%o", files);
var str = 'Are you sure you want to delete ' + files.length +
@@ -411,20 +626,74 @@ var menuclick = function(action, el, pos)
{
disableall();
$('#deletewait').slideDown('slow');
window.location.href =
'/cgi-bin/browse/mdelete.jim?dir=' +
encodeURIComponent(dir) + '&files=' +
files.join();
$('#pwdialogue').dialog({
title: "Deleting",
modal: true, autoOpen: true,
height: 'auto', width: 'auto',
show: 'scale', hide: 'fade',
draggable: false, resizable: false,
closeOnEscape: false,
open: function() {
$('.ui-dialog-titlebar-close').hide();
}
});
$('#pwfeedback').load(
'/cgi-bin/browse/delete.jim', {
'dir': dir,
'files': files
}, function() {
$('#pwdialogue').dialog('close');
window.location.reload(true);
});
}
});
$('#copy,#cut').button().disable()
.click(function() {
var files = new Array();
var els = $('input.fs:checked + a').each(function() {
files.push(decodeURIComponent($(this).attr('file')));
});
//console.log("%o", files);
var action = $(this).attr('id');
if (action == 'copy' && !confirm('Are you sure? ' +
'Copying recordings can take a very long time!'))
return;
$.post('/cgi-bin/browse/clipboard.jim', {
'act': 'add',
'dir': dir,
'mode': action,
'path': files
}, function() {
reloadclipboard();
$('input.fs:checked').attr('checked', false);
});
});
$('#newdir').button().click(function() {
$('#newdirform').dialog({
autoOpen: true,
height: 'auto', width: 'auto',
modal: true,
buttons: {
"Create": newdir_submit,
"Cancel": function() {
$(this).dialog('close');
}
},
close: function() { $('#newdirname').val(''); }
});
});
$('input.fs').change(function() {
var num = $('input.fs:checked').size();
if (num > 0)
$('#delete').enable();
$('#delete,#cut,#copy').enable();
else
$('#delete').disable();
$('#delete,#cut,#copy').disable();
var num = $('input.fsts:checked').size();
if (num > 1)
$('#join').enable();

View File

@@ -0,0 +1,119 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/setup
require clipboard.class ts.class
puts "Content-Type: text/html; no-cache"
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
puts "Pragma: nocache"
puts ""
cgi_input 1
#cgi_dump
set cb [[clipboard new {path "/tmp/webif-browse.cb"}] load]
set action [cgi_get act list]
switch $action {
list {
if {![$cb size]} {
puts "<i>Clipboard is empty</i>"
break
}
puts "<div class=cliplist>"
foreach file [$cb get items] {
set img "page_white_copy"
if {[$file get action] eq "cut"} {
set img "cut"
}
set path [$file get path]
set xpath [cgi_quote_html $path]
puts "<span title=\"$xpath\" alt=\"$xpath\">"
puts "<img src=/img/context/$img.png>"
set dfile [file tail $path]
if {[string length $dfile] > 25} {
set dfile "[string range $dfile 0 22]..."
}
if {[file isdirectory $path]} {
puts "<img height=16
src=/images/711_1_09_Media_Folder.png>"
}
puts [cgi_quote_html $dfile]
puts "<a class=clipdel href=# alt=\"Remove\" title=\"Remove\"
path=\"[cgi_quote_url $path]\">
<img border=0 src=/img/close.png height=16></a>"
puts "</span>"
}
puts "</div>"
puts "<button id=paste>Paste to current folder</button>"
puts "<button id=clipclear>Empty clipboard</button>"
}
add {
if {[set path [cgi_get path]] eq "0"} {
puts "No path."
exit
}
set dir [cgi_unquote_input [cgi_get dir]]
set mode [cgi_get mode copy]
foreach p $path {
set p [cgi_unquote_input $p]
if {$dir ne "0" && ![string match "$dir/*" $p]} {
puts "$p not in directory<br>"
continue
}
if {![$cb present $p]} {
$cb add $mode $p
puts "Added $p for $mode<br>"
}
}
$cb save
}
remove {
$cb remove [cgi_unquote_input [cgi_get path]]
$cb save
}
clear {
$cb clear
$cb save
}
paste {
set dir [cgi_unquote_input [cgi_get dir]]
foreach item [$cb get items] {
set path [$item get path]
set file [file tail $path]
set mode [$item get action]
puts "Pasting $file"
if {[file isdirectory $path]} {
# Directory
if {$mode eq "cut"} {
catch {file rename $path "$dir/$file"}
} else {
catch {puts [exec /mod/bin/busybox/cp -r \
$path $dir]}
}
} else {
set root [file rootname $path]
# Protect special characters in root.
# In particular [] characters which are used a lot
# for torrent names.
regsub -all {([\\["$])} $root {\\\1} root
foreach f [glob -nocomplain "${root}.*"] {
if {$mode eq "cut"} {
catch {file rename $f \
"$dir/[file tail $f]"}
} else {
catch {file copy $f \
"$dir/[file tail $f]"}
}
}
}
}
$cb clear
$cb save
}
}

View File

@@ -9,8 +9,7 @@ puts "Content-Type: text/html\r\n\r\n"
cgi_input
#cgi_dump
set tsfile [cgi_get file]
set rfile [file normalize $tsfile]
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]

View File

@@ -10,14 +10,14 @@ puts "Content-Type: text/html\r\n\r\n"
cgi_input
#cgi_dump
set tsfile [cgi_get file]
set rfile [file normalize $tsfile]
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc] url
if {[cgi_get do] eq "it"} {
set xstart [clock milliseconds]
set base [file rootname $rfile]
set origdir "$dir/_original"
@@ -51,6 +51,9 @@ if {[cgi_get do] eq "it"} {
exec /mod/bin/hmt -encrypted "$dir/$shname.hmt"
}
set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
puts "Time taken: $xtime"
exit
}
@@ -70,6 +73,7 @@ puts "
if {$url eq ""} {
puts "This file has not been indexed by the media server.
Cannot decrypt."
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
exit
}

View File

@@ -1,28 +1,101 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/ts.class
source /mod/var/mongoose/lib/setup
require ts.class pretty_size system.class tdelete
puts "Content-Type: text/html"
puts ""
puts "Content-Type: text/html\r\n"
cgi_input
#cgi_dump
set file [dict get $_cgi file]
set type [dict get $_cgi type]
set dir [cgi_get dir]
regsub -all {([\\["$])} $dir {\\\1} dir
if {$type eq "ts"} {
set ts [ts fetch $file]
if {[$ts delete]} {
puts "Successfully deleted $file."
} else {
puts "Problem deleting $file, [$ts get error]"
}
exit
#puts "DIR: ($dir)"
if {[system pkginst undelete]} {
set dustbin [system dustbin]
} else {
set dustbin ""
}
file delete $file
file delete "[file rootname $file].hmi"
puts "Successfully deleted $file."
proc bindir {file} {
global dustbin
set dir [file dirname $file]
regsub "^[system mediaroot]" $dir $dustbin ndir
if {$dir eq $ndir} { set ndir $dustbin }
system mkdir_p $ndir
return $ndir
}
proc touch {file} {
exec /mod/bin/busybox/touch $file
}
puts "<div id=deleting class=blood><img src=/img/loading.gif>Deleting...</div>"
puts "<ul style=\"list-style-type: square\">"
foreach file [cgi_get files] {
puts -nonewline "<li>\"$file\"..."
if {![string match "$dir/*" $file]} {
puts "Error - outside directory."
continue
}
if {$dustbin ne "" && [string first $dustbin $file] > -1} {
set ldustbin ""
} else {
set ldustbin $dustbin
}
set done 0
if {[file isdirectory $file]} {
puts -nonewline "Directory..."
if {$ldustbin ne ""} {
set ndir "[bindir $file]/[file tail $file]"
while {[file isdirectory $ndir]} { append ndir "_" }
file rename $file $ndir
touch $ndir
} else {
tdelete $file
}
puts -nonewline "Done..."
set done 1
} elseif {[string match {*.ts} $file]} {
set ts [ts fetch $file]
# Check TS validity
if {![catch {$ts get file}]} {
if {$ldustbin ne ""} {
$ts move [bindir $file] 1
} else {
if {[$ts delete]} {
puts "Successfully deleted $file."
} else {
puts "Problem deleting $file, [$ts get error]"
}
}
set done 1
}
# else treat as normal file.
}
if {!$done} {
if {$ldustbin ne ""} {
set nfile "[bindir $file]/[file tail $file]"
file rename $file $nfile
touch $nfile
} else {
tdelete $file
}
catch {file delete "[file rootname $file].hmi"}
puts -nonewline "Done..."
}
puts "</li>"
}
puts "</ul>"

View File

@@ -11,20 +11,23 @@ cgi_input
#cgi_dump
set file [cgi_get file]
set rfile [file normalize $file]
set ts [ts fetch $file]
# Default to just downloading the raw file.
set url $file
set mime "video/ts"
# If it's encrypted on disk and the DLNA option is available, then use
# the server to perform decryption on the fly.
if {[$ts flag "ODEncrypted"] > 0} {
set dlna [$ts dlnaloc]
if {[llength $dlna]} { lassign $dlna url mime }
if {[string match {*.ts} $file]} {
if {![catch {set ts [ts fetch $file]}]} {
#puts "DLNA: $dlna"
# If it's encrypted on disk and the DLNA option is available,
# then use the server to perform decryption on the fly.
if {[$ts flag "ODEncrypted"] > 0} {
set dlna [$ts dlnaloc]
if {[llength $dlna]} { lassign $dlna url mime }
#puts "DLNA: $dlna"
}
}
}
puts "Content-Type: text/plain"

View File

@@ -65,22 +65,28 @@ if {$type eq "ts"} {
<th>Start Time</th>
<td>"
puts [clock format [$ts get start] -format "%c %Z"]
puts "<font class=also>(Scheduled: [
clock format [$ts get schedstart] -format "%c %Z"])</font>"
puts "</td>
</tr><tr>
<th>End Time</th>
<td>"
puts [clock format [$ts get end] -format "%c %Z"]
puts "<font class=also>(Scheduled: [clock format \
[expr [$ts get schedstart] + [$ts get scheddur]] \
-format "%c %Z"])</font>"
puts "</td>
</tr><tr>
<th>Duration</th>
<td>[$ts duration] minute(s).</td>
<td>[$ts duration] minute(s).
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
</font></td>
</tr><tr>
<th>Size</th>
<td>$sz</td>
"
set dlna [$ts dlnaloc]
lassign $dlna url
if {[llength $dlna]} {
lassign [$ts dlnaloc] url
if {$url ne ""} {
puts "</tr><tr><th>DLNA&nbsp;URL</th>
<td><a href=\"$url\">$url</a></td>"
}

View File

@@ -0,0 +1,28 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/ts.class
puts "Content-Type: text/html"
puts ""
cgi_input
#cgi_dump
set dir [cgi_get file]
if {![file isdirectory $dir]} { exit }
set noflat 0
if {[string match {\[*\]} [file tail $dir]]} {
set ndir [string range [file tail $dir] 1 end-1]
file rename $dir "[file dirname $dir]/$ndir"
puts "Unflagged directory as noflatten."
exit
}
if {[file exists "$dir/.noflatten"]} {
file delete "$dir/.noflatten"
puts "Unflagged directory as noflatten."
} else {
close [open "$dir/.noflatten" w]
puts "Flagged directory as noflatten."
}

View File

@@ -21,6 +21,7 @@ span.pl { padding-left: 2em; }
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
<script type="text/javascript" src="/js/jquery.progressbar.js"></script>
<script type="text/javascript" src="/js/touchbridge.js"></script>
<p><b>
Drag the files below into order, enter a name for the resulting file and then

View File

@@ -1,55 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class pretty_size
puts "Content-Type: text/html\r\n\r\n"
header
cgi_input 1
#cgi_dump
set dir [cgi_unquote_input [cgi_get dir]]
puts "<div id=deleting class=blood><img src=/img/loading.gif>Deleting...</div>"
puts "<ul style=\"list-style-type: square\">"
foreach file [split [cgi_get files] ","] {
set file [cgi_unquote_input $file]
puts -nonewline "<li>\"$file\"..."
if {[file isdirectory $file]} {
puts -nonewline "Directory..."
puts [exec /mod/bin/busybox/rm -rf $file]
puts -nonewline "Done..."
} elseif {[string match {*.ts} $file]} {
set ts [ts fetch $file]
if {[catch {$ts delete} msg]} {
puts -nonewline "Error loading TS file..."
} else {
puts -nonewline "Done..."
}
} else {
if {[catch {file delete $ts} msg]} {
puts -nonewline "Error: $msg"
} else {
catch {file delete "[file rootname $file].hmi"}
puts -nonewline "Done..."
}
}
puts "</li>"
}
puts "</ul>"
puts "<button id=back dir=\"$dir\">Back to media list</button>";
puts {
<script type=text/javascript>
$('#deleting').slideUp('slow');
$('#back').button().click(function() {
window.location.href = '/cgi-bin/browse.jim?dir=' +
encodeURIComponent($('#back').attr('dir'));
});
</script>
}
footer

View File

@@ -0,0 +1,15 @@
#!/mod/bin/jimsh
package require cgi
puts "Content-Type: text/html"
puts ""
cgi_input
#cgi_dump
set dir [cgi_get dir -]
set name [cgi_get newdirname "New Folder"]
file mkdir "$dir/$name"

View File

@@ -0,0 +1,51 @@
#!/mod/bin/jimsh
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class pretty_size
puts "Content-Type: text/html\r\n"
cgi_input
#cgi_dump
header
set rfile [cgi_get file]
set ts [ts fetch $rfile]
if {[catch {$ts get file}]} {
puts "Invalid TS file, '$rfile'"
exit
}
if {![$ts flag "ODEncrypted"]} {
set url $rfile
} else {
lassign [$ts dlnaloc] url
if {$url eq ""} {
alert("Media is encrypted and not indexed by the DLNA Server.");
}
}
puts "
<span id=url style=\"display: none\">$url</span>
"
puts {
<script language="javascript" src="/js/jquery-vlc.js"></script>
<link rel="stylesheet" type="text/css" href="/css/vlc.css" />
<script type=text/javascript src=play.js></script>
<fieldset class=cleft style="margin: 0 1em 1em 1em">
<legend>VLC Player</legend>
}
puts "<span class=also>Now playing: $rfile, [$ts duration] minutes.</span>"
puts {
<div id=vlc></div>
<div class=also id=info style="float: right">
</div>
</fieldset>
}

View File

@@ -0,0 +1,13 @@
$(document).ready(function() {
var url = $('#url').text();
var vlc = VLCobject.embedPlayer('vlc', 800, 450, true);
vlc.play(encodeURI(url));
if (window.console)
console.log("Playing: %o", url);
});

View File

@@ -16,11 +16,10 @@ set dir [dict get $_cgi dir]
#9.4G /media/My Video/Archive
#1.4G /media/My Video/CSI_ Crime Scene Investigation
puts "{"
foreach line [split [exec /mod/bin/busybox/du -h "$dir/"] "\n"] {
set fields [split $line "\t"]
set size [lindex $fields 0]
set node [file tail [lindex $fields 1]]
# set node [lindex [split [lindex $fields 1] /] end]
regsub -all {([\\["$])} $dir {\\\1} xdir
foreach line [split [exec /mod/bin/busybox/du -h -d 1 "$dir/"] "\n"] {
lassign [split $line "\t"] size node
regsub -- "^$xdir/" $node "" node
puts "\"$node\" : \"$size\","
}

View File

@@ -0,0 +1,17 @@
div.brow
{
float: left;
clear: left;
}
div.cliplist span
{
display: block;
}
#clipclear
{
margin-top: 1em;
}

View File

@@ -32,17 +32,19 @@ puts "
<th>Frequency</th>
<th>Signal Strength</th>
<th>Signal Quality</th>
<th>Network</th>
<th>Mux</th>
<th>Channels</th>
<th>&gt;799</th>
</tr>
"
foreach tw [$db query {
select tsIdx, usTsID, ulFrequency, ucLevel, ucQuality
from TBL_TS
select tsIdx, szNetName, usTsID, ulFrequency, ucLevel, ucQuality
from TBL_TS join TBL_NET using (netIdx)
order by ulFrequency
}] {
lassign $tw x tsIdx x usTsID x ulFrequency x ucLevel x ucQuality
lassign $tw \
x tsIdx x netName x usTsID x ulFrequency x ucLevel x ucQuality
altrow
puts "
@@ -51,6 +53,7 @@ foreach tw [$db query {
"
puts "<td>[progressbar $ucLevel]</td>"
puts "<td>[progressbar $ucQuality]</td>"
puts "<td>[string range $netName 3 end]</td>"
set channels [$db query {
select usLcn, szSvcName, szPrvName, aucDefaultAuthority
@@ -59,7 +62,7 @@ foreach tw [$db query {
order by usLcn
} $tsIdx]
set mux "???"
set mux "Local"
set ehs 0
foreach chan $channels {
lassign $chan x lcn x name
@@ -72,6 +75,7 @@ foreach tw [$db query {
"ITV3" { set mux "COM4/SDN" }
"Dave" { set mux "COM5/ARQ A" }
"Film4" { set mux "COM6/ARQ B" }
"Movies4Men" { set mux "Local" }
}
}
puts "<td>$mux</td>"

View File

@@ -8,13 +8,8 @@ require altrow
puts "Content-Type: text/html"
puts ""
set databases {
/var/lib/humaxtv/rsvp.db
/var/lib/humaxtv/rsv.db
/var/lib/humaxtv/setup.db
/var/lib/humaxtv/channel.db
/mnt/hd2/dms_cds.db
}
set databases [glob /var/lib/humaxtv/*.db]
lappend databases "/mnt/hd2/dms_cds.db"
header

View File

@@ -13,8 +13,6 @@ cgi_input
set dir [cgi_get dir "/media/My Video"]
set doit [cgi_get doit 0]
# Strip double slashes
header
puts "<fieldset style=\"display: inline\">
@@ -28,11 +26,10 @@ puts "<fieldset style=\"display: inline\">
</tr>
"
regsub -all -- {\/+} "$dir/*" "/" sdir
set seen {}
foreach file [lsort [glob -nocomplain "$sdir"]] {
foreach file [readdir $dir] {
set file "$dir/$file"
if {[file extension $file] ne ".hmt"} { continue }
altrow
set ts [ts fetch $file 1]
@@ -40,6 +37,7 @@ foreach file [lsort [glob -nocomplain "$sdir"]] {
puts "<td nowrap>$base</td>"
set syn [$ts get synopsis]
regsub -nocase -all -- {^new series\.* *} $syn "" syn
regsub -nocase -all -- {^cbeebies\. *} $syn "" syn
regsub -all -- { *[:].*$} $syn "" syn
if {[string length $syn] > 40} {
lassign [split $syn "."] v w

View File

@@ -18,18 +18,6 @@ set record [lindex [epg fetch dump -service $service -event $event] 0]
$record get_channel_info
set others [$record othertimes]
puts {
<style type=text/css>
font.also
{
font-size: 0.9em;
font-style: italic;
color: #333;
background: transparent;
}
</style>
}
puts "
<table class=keyval>
<tr>

View File

@@ -79,7 +79,8 @@ if {[llength $pkgs] > 0} {
"
foreach pkg $pkgs {
if {$filter && ![dict exists $::pkgmeta $pkg]} { continue }
if {$type ne "upgr" && $filter && \
![dict exists $::pkgmeta $pkg]} { continue }
pkgrow [pkg load $pkg]
}
puts "</table>"
@@ -90,7 +91,7 @@ if {[llength $pkgs] > 0} {
puts "<i>No packages "
switch $type {
inst { puts "are installed." }
upgr { puts "are available for upgrade." }
upgr { puts "are available for upgrade; try updating the package list from the Internet using the button above." }
avail { puts "are available for installation." }
}
puts "</i>"

View File

@@ -8,6 +8,12 @@ puts "Content-Type: text/html"
puts ""
cgi_input
if {[cgi_get act] eq "cancel"} {
file delete /tmp/.restartpending
exit
}
if {[cgi_get now] eq "yes"} {
# - Busybox reboot does sync the disk but may still not be clean enough.
puts "Restarting."

View File

@@ -17,12 +17,23 @@ set event [rsv slot $table $slot]
set rsvicon [$event icon]
if {$rsvicon ne ""} {
set rsvicon "<img src='images/$rsvicon' height=20>
set rsvicon "<img src='images/$rsvicon' height=20>"
if {[$event get ersvtype] == 3} {
if {[$event padded]} {
set padding "<- [expr [$event get ulPreOffset] / 60], [expr [$event get ulPostOffset] / 60] ->"
append rsvicon \
"<img src=/img/pad.png height=20
title=\"$padding\" alt=\"$padding\">"
} else {
append rsvicon \
"<img src=/img/ar.png height=20>"
}
}
}
set RKIcon [$event RKIcon]
if {$RKIcon ne ""} {
set RKIcon "<img src='images/$RKIcon' height=20>
set RKIcon "<img src='images/$RKIcon' height=20>"
}
if {[$event get ucRecKind] == 4} {
@@ -115,7 +126,7 @@ foreach ev [split [$event get szEventToRecord] "|"] {
}
puts "</td></tr>"
puts "<tr><th>Accepted</th><td>"
if {[$event get aulEventToRecordInfo] != ""} {
if {[$event get aulEventToRecordInfo] ne ""} {
puts "Yes"
}
puts "</td></tr>"

View File

@@ -11,6 +11,17 @@ puts ""
cgi_input
#cgi_dump
if {[cgi_get act] eq "https"} {
if {[cgi_get val off] eq "off"} {
file delete /mod/etc/mongoose.cert
puts "HTTPS Server will be disabled after next reboot."
} else {
exec /mod/sbin/mongoose_mkcert
puts "HTTPS Server will be enabled after next reboot."
}
exit
}
set settings [settings new]
set hostname [$settings hostname]
@@ -53,9 +64,6 @@ handle_str_update hostname $hostname Hostname
_handle_update ascii smtp_server $smtp_server "SMTP Server"
handle_int_update channel_group $channel_group "Channel Group"
handle_str_update epg_style $epg_style "EPG Type"
if {[dict exists $_cgi pkgdevoff] && ![dict exists $_cgi pkgdev]} {
set _cgi(pkgdev) 0
}
handle_int_update pkgdev $pkgdev "Development Package Display"
set acluser [cgi_get acluser "-"]
@@ -89,6 +97,7 @@ if {$aclact ne "-" && $acluser ne "-"} {
header
puts {
<script type="text/javascript" src="/cgi-bin/settings.js"></script>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" src="/js/jconfirmaction.jquery.js"></script>
<link href=/css/jconfirmaction.jquery.css rel=stylesheet type=text/css />
@@ -96,26 +105,6 @@ puts {
<link href=/css/iphone-style-checkboxes.css rel=stylesheet type=text/css />
}
puts {
<script type=text/javascript>
$(document).ready(function () {
$(":submit").button();
$('form.auto').each(function(i, el) {
var id = $(this).attr('id');
var output = '#' + id + '_output'
$(this).ajaxForm({
target: output,
success: function() {
$(output).css('font-style', 'italic');
$(output).show('slow');
$(output).delay(2000).fadeOut('slow');
}
});
});
});
</script>
}
puts "
<fieldset style=\"display: inline\">
<legend>
@@ -140,6 +129,17 @@ puts "
</tr>
"
puts -nonewline "
<tr>
<th class=key>HTTPS web server?</th>
<td><input id=https_toggle name=https type=checkbox value=yes"
if {[file exists /mod/etc/mongoose.cert]} { puts -nonewline " checked" }
puts ">
<div id=https_output></div>
</td>
</tr>
"
puts "
<tr>
<form class=auto id=epg_style method=get action=$env(REQUEST_URI)>
@@ -315,34 +315,21 @@ $('button.pwchange').click(function(el) {
</script>
}
puts "
puts -nonewline "
<br><br>
<fieldset style=\"display: inline\">
<legend> Advanced Settings </legend>
<table>
"
puts "
<tr>
<form class=auto id=pkgdev method=get action=$env(REQUEST_URI)>
<th class=key>Show development and advanced packages?</th>
<td><input name=pkgdevoff value=0 type=hidden>
<input name=pkgdev id=pkgdev value=1 type=checkbox
<td><input name=pkgdev id=pkgdev value=1 type=checkbox
"
if {$pkgdev} { puts " checked" }
puts {
>
<small>
<input id=pkgdev_submit value="save" type=submit>
</small>
<div id=pkgdev_output></div>
if {$pkgdev} { puts -nonewline " checked" }
puts ">
</td>
</form>
</tr>
}
puts "
</table>
<div id=pkgdev_output></div>
</fieldset>
"

View File

@@ -0,0 +1,77 @@
(function($)
{
$.fn.enable = function()
{
return this.each(function() {
$(this)
.removeClass('ui-state-disabled')
.removeProp('disabled');
});
};
$.fn.disable = function()
{
return this.each(function() {
$(this)
.addClass('ui-state-disabled')
.prop('disabled', true);
});
};
})(jQuery);
$(document).ready(function () {
$(":submit").button();
$(":checkbox").iphoneStyle();
$('form.auto').each(function(i, el) {
var id = $(this).attr('id');
var output = '#' + id + '_output'
$(this).ajaxForm({
target: output,
success: function() {
$(output).css('font-style', 'italic');
$(output).show('slow');
$(output).delay(2000).fadeOut('slow');
}
});
});
$('#pkgdev').change(function() {
var arg = '0';
if ($(this).attr('checked'))
arg = '1';
$(this).disable();
$('#pkgdev_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?pkgdev=' + arg,
function() {
$('#pkgdev').enable();
$('#pkgdev_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#https_toggle').change(function() {
var arg = 'off';
if ($(this).attr('checked'))
arg = 'on';
$(this).disable();
$('#https_output')
.empty()
.html('<img src=/img/loading.gif>Please Wait...')
.show('slow')
.load('/cgi-bin/settings.jim?act=https&val=' + arg,
function() {
$('#https_toggle').enable();
$('#https_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
});

View File

@@ -0,0 +1,48 @@
.jbar{
height:50px;
width:100%;
background-color: #ffffcc;
color: #ff4000;
position:fixed;
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=95);
opacity: 0.95;
-moz-opacity: 0.95;
text-align:center;
left:0px;
z-index:9999999;
margin:0px;
padding:0px;
}
.jbar-top{
top:0px;
border-top:2px solid #fff;
border-bottom: 1px solid #ebebeb;
}
.jbar-bottom{
bottom:0px;
border-bottom:2px solid #fff;
border-top: 1px solid #ebebeb;
color:#777;
}
.jbar-content{
line-height:46px;
font-size: 18px;
font-family:'Lucida Grande',sans-serif;
}
a.jbar-cross{
position:absolute;
width:31px;
height:31px;
background:transparent url(/images/cross.png) no-repeat top left;
cursor:pointer;
right:10px;
}
a.jbar-cross:hover{
background-image: url(/images/cross_hover.png)
}
.jbar-top a.jbar-cross{
top:8px;
}
.jbar-bottom a.jbar-cross{
bottom:8px;
}

View File

@@ -13,6 +13,19 @@ html>body
font-size: small;
}
.left, .cleft
{
float: left;
}
.cleft
{
clear: left;
}
fieldset.left, fieldset.cleft
{
display: inline;
}
div.container
{
position: relative;
@@ -82,6 +95,12 @@ table.borders, table.borders td, table.borders th
color: black;
}
.hover
{
background: #f6ff5b;
color: black;
}
table td,table th
{
font-size: small;
@@ -296,3 +315,11 @@ div.cut
font-size: 12px;
}
.also
{
font-size: 0.9em;
font-style: italic;
color: #333;
background: transparent;
}

View File

@@ -10,6 +10,16 @@ table.tablesorter .header {
height: auto;
}
table.tablesorter .headerplain {
background-image: url(/img/tsort/bgplain.png);
background-repeat: no-repeat;
border-left: 1px solid #FFF;
border-right: 1px solid #000;
border-top: 1px solid #FFF;
padding-top: 8px;
height: auto;
}
table.tablesorter .headerSortUp {
background-image: url(/img/tsort/asc.png);
background-repeat: no-repeat;

View File

@@ -0,0 +1,60 @@
.x-vlc-slider {
background:#C7F2FF;
text-align:center;
}
.x-vlc-slider-thumb {
background:#4EAECC;
width:3px;
}
.x-vlc-main {
}
.x-vlc-toolbar {
color:black;
}
.x-vlc-toolbar * {
vertical-align:top;
}
.x-vlc-btn {
padding-right:10px;
}
.x-vlc-btn-fullscreen {
background:url(/img/vlc/fullscreen2.gif) no-repeat;
}
.x-vlc-btn-plus {
background:url(/img/vlc/plus2.gif) no-repeat;
}
.x-vlc-btn-moins {
background:url(/img/vlc/moins2.gif) no-repeat;
}
.x-vlc-btn:hover {
color:red;
}
.x-vlc-btn-play {
background:url(/img/vlc/play2.gif) no-repeat;
}
.x-vlc-btn-stop {
background:url(/img/vlc/stop2.gif) no-repeat;
}
.x-vlc-btn-pause {
background:url(/img/vlc/pause2.gif) no-repeat;
}
.x-vlc-timer {
width:100px;
font-size:12px;
vertical-align:top;
text-align:center
}
.x-vlc-about {
font-size:10px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -0,0 +1 @@
Channel 5 +1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1 @@
Channel 5 +1.png

View File

@@ -0,0 +1 @@
blank.png

View File

@@ -0,0 +1 @@
blank.png

View File

@@ -0,0 +1 @@
blank.png

View File

@@ -1 +0,0 @@
blank.png

Before

Width:  |  Height:  |  Size: 9 B

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9 B

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 994 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

View File

@@ -111,6 +111,12 @@ $(document).ready(function() {
<div class=footer>
<ul>
<li>
Release Notes:
<a target=_blank
href="http://wiki.hummy.tv/wiki/Customised_Firmware_Release_Notes">
Firmware</a> |
<a target=_blank href="http://wiki.hummy.tv/wiki/Webif_release_notes">Webif</a>
</li><li>
<a href=/diag.shtml>Diagnostics</a>
</li><li>
<a href=/cgi-bin/channel.jim>Channel Information</a>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,364 @@
/*
File: AC_QuickTime.js
Abstract: This file contains functions to generate OBJECT and EMBED tags for QuickTime content.
Version: <1.2.1>
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Computer, Inc. ("Apple") in consideration of your agreement to the
following terms, and your use, installation, modification or
redistribution of this Apple software constitutes acceptance of these
terms. If you do not agree with these terms, please do not use,
install, modify or redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Computer,
Inc. may be used to endorse or promote products derived from the Apple
Software without specific prior written permission from Apple. Except
as expressly stated in this notice, no other rights or licenses, express
or implied, are granted by Apple herein, including but not limited to
any patent rights that may be infringed by your derivative works or by
other works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright © 2006-2007 Apple Computer, Inc., All Rights Reserved
*/
/*
* This file contains functions to generate OBJECT and EMBED tags for QuickTime content.
*/
/************** LOCALIZABLE GLOBAL VARIABLES ****************/
var gArgCountErr = 'The "%%" function requires an even number of arguments.'
+ '\nArguments should be in the form "atttributeName", "attributeValue", ...';
/******************** END LOCALIZABLE **********************/
var gTagAttrs = null;
var gQTGeneratorVersion = 1.2;
var gQTBehaviorID = "qt_event_source";
var gQTEventsEnabled = false;
function AC_QuickTimeVersion() { return gQTGeneratorVersion; }
function _QTComplain(callingFcnName, errMsg)
{
errMsg = errMsg.replace("%%", callingFcnName);
alert(errMsg);
}
function _QTIsMSIE()
{
var ua = navigator.userAgent.toLowerCase();
var msie = /msie/.test(ua) && !/opera/.test(ua);
return msie;
}
function _QTGenerateBehavior()
{
return objTag = '<!--[if IE]>'
+ '<object id="' + gQTBehaviorID + '" classid="clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598"></object>'
+ '<![endif]-->';
}
function _QTPageHasBehaviorObject(callingFcnName, args)
{
var haveBehavior = false;
var objects = document.getElementsByTagName('object');
for ( var ndx = 0, obj; obj = objects[ndx]; ndx++ )
{
if ( obj.getAttribute('classid') == "clsid:CB927D12-4FF7-4a9e-A169-56E4B8A75598" )
{
if ( obj.getAttribute('id') == gQTBehaviorID )
haveBehavior = false;
break;
}
}
return haveBehavior;
}
function _QTShouldInsertBehavior()
{
var shouldDo = false;
if ( gQTEventsEnabled && _QTIsMSIE() && !_QTPageHasBehaviorObject() )
shouldDo = true;
return shouldDo;
}
function _QTAddAttribute(prefix, slotName, tagName)
{
var value;
value = gTagAttrs[prefix + slotName];
if ( null == value )
value = gTagAttrs[slotName];
if ( null != value )
{
if ( 0 == slotName.indexOf(prefix) && (null == tagName) )
tagName = slotName.substring(prefix.length);
if ( null == tagName )
tagName = slotName;
return ' ' + tagName + '="' + value + '"';
}
else
return "";
}
function _QTAddObjectAttr(slotName, tagName)
{
// don't bother if it is only for the embed tag
if ( 0 == slotName.indexOf("emb#") )
return "";
if ( 0 == slotName.indexOf("obj#") && (null == tagName) )
tagName = slotName.substring(4);
return _QTAddAttribute("obj#", slotName, tagName);
}
function _QTAddEmbedAttr(slotName, tagName)
{
// don't bother if it is only for the object tag
if ( 0 == slotName.indexOf("obj#") )
return "";
if ( 0 == slotName.indexOf("emb#") && (null == tagName) )
tagName = slotName.substring(4);
return _QTAddAttribute("emb#", slotName, tagName);
}
function _QTAddObjectParam(slotName, generateXHTML)
{
var paramValue;
var paramStr = "";
var endTagChar = (generateXHTML) ? ' />' : '>';
if ( -1 == slotName.indexOf("emb#") )
{
// look for the OBJECT-only param first. if there is none, look for a generic one
paramValue = gTagAttrs["obj#" + slotName];
if ( null == paramValue )
paramValue = gTagAttrs[slotName];
if ( 0 == slotName.indexOf("obj#") )
slotName = slotName.substring(4);
if ( null != paramValue )
paramStr = '<param name="' + slotName + '" value="' + paramValue + '"' + endTagChar;
}
return paramStr;
}
function _QTDeleteTagAttrs()
{
for ( var ndx = 0; ndx < arguments.length; ndx++ )
{
var attrName = arguments[ndx];
delete gTagAttrs[attrName];
delete gTagAttrs["emb#" + attrName];
delete gTagAttrs["obj#" + attrName];
}
}
// generate an embed and object tag, return as a string
function _QTGenerate(callingFcnName, generateXHTML, args)
{
// is the number of optional arguments even?
if ( args.length < 4 || (0 != (args.length % 2)) )
{
_QTComplain(callingFcnName, gArgCountErr);
return "";
}
// allocate an array, fill in the required attributes with fixed place params and defaults
gTagAttrs = new Object();
gTagAttrs["src"] = args[0];
gTagAttrs["width"] = args[1];
gTagAttrs["height"] = args[2];
gTagAttrs["type"] = "video/quicktime";
gTagAttrs["classid"] = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
//Impportant note: It is recommended that you use this exact classid in order to ensure a seamless experience for all viewers
gTagAttrs["pluginspage"] = "http://www.apple.com/quicktime/download/";
// set up codebase attribute with specified or default version before parsing args so
// anything passed in will override
var activexVers = args[3]
if ( (null == activexVers) || ("" == activexVers) )
activexVers = "7,3,0,0";
gTagAttrs["codebase"] = "http://www.apple.com/qtactivex/qtplugin.cab#version=" + activexVers;
var attrName,
attrValue;
// add all of the optional attributes to the array
for ( var ndx = 4; ndx < args.length; ndx += 2)
{
attrName = args[ndx].toLowerCase();
attrValue = args[ndx + 1];
gTagAttrs[attrName] = attrValue;
if ( ("postdomevents" == attrName) && (attrValue.toLowerCase() != "false") )
{
gQTEventsEnabled = true;
if ( _QTIsMSIE() )
gTagAttrs["obj#style"] = "behavior:url(#" + gQTBehaviorID + ")";
}
}
// init both tags with the required and "special" attributes
var objTag = '<object '
+ _QTAddObjectAttr("classid")
+ _QTAddObjectAttr("width")
+ _QTAddObjectAttr("height")
+ _QTAddObjectAttr("codebase")
+ _QTAddObjectAttr("name")
+ _QTAddObjectAttr("id")
+ _QTAddObjectAttr("tabindex")
+ _QTAddObjectAttr("hspace")
+ _QTAddObjectAttr("vspace")
+ _QTAddObjectAttr("border")
+ _QTAddObjectAttr("align")
+ _QTAddObjectAttr("class")
+ _QTAddObjectAttr("title")
+ _QTAddObjectAttr("accesskey")
+ _QTAddObjectAttr("noexternaldata")
+ _QTAddObjectAttr("obj#style")
+ '>'
+ _QTAddObjectParam("src", generateXHTML);
var embedTag = '<embed '
+ _QTAddEmbedAttr("type")
+ _QTAddEmbedAttr("src")
+ _QTAddEmbedAttr("width")
+ _QTAddEmbedAttr("height")
+ _QTAddEmbedAttr("pluginspage")
+ _QTAddEmbedAttr("name")
+ _QTAddEmbedAttr("id")
+ _QTAddEmbedAttr("align")
+ _QTAddEmbedAttr("tabindex");
// delete the attributes/params we have already added
_QTDeleteTagAttrs("type","src","width","height","pluginspage","classid","codebase","name","tabindex",
"hspace","vspace","border","align","noexternaldata","class","title","accesskey","id","style");
// and finally, add all of the remaining attributes to the embed and object
for ( var attrName in gTagAttrs )
{
attrValue = gTagAttrs[attrName];
if ( null != attrValue )
{
embedTag += _QTAddEmbedAttr(attrName);
objTag += _QTAddObjectParam(attrName, generateXHTML);
}
}
// end both tags, we're done
return objTag + embedTag + '></em' + 'bed></ob' + 'ject' + '>';
}
// return the object/embed as a string
function QT_GenerateOBJECTText()
{
var txt = _QTGenerate("QT_GenerateOBJECTText", false, arguments);
if ( _QTShouldInsertBehavior() )
txt = _QTGenerateBehavior() + txt;
return txt;
}
function QT_GenerateOBJECTText_XHTML()
{
var txt = _QTGenerate("QT_GenerateOBJECTText_XHTML", true, arguments);
if ( _QTShouldInsertBehavior() )
txt = _QTGenerateBehavior() + txt;
return txt;
}
function QT_WriteOBJECT()
{
var txt = _QTGenerate("QT_WriteOBJECT", false, arguments);
if ( _QTShouldInsertBehavior() )
document.writeln(_QTGenerateBehavior());
document.writeln(txt);
}
function QT_WriteOBJECT_XHTML()
{
var txt = _QTGenerate("QT_WriteOBJECT_XHTML", true, arguments);
if ( _QTShouldInsertBehavior() )
document.writeln(_QTGenerateBehavior());
document.writeln(txt);
}
function QT_GenerateBehaviorOBJECT()
{
return _QTGenerateBehavior();
}
function QT_ReplaceElementContents()
{
var element = arguments[0];
var args = [];
// copy all other arguments we want to pass through to the fcn
for ( var ndx = 1; ndx < arguments.length; ndx++ )
args.push(arguments[ndx]);
var txt = _QTGenerate("QT_ReplaceElementContents", false, args);
if ( txt.length > 0 )
element.innerHTML = txt;
}
function QT_ReplaceElementContents_XHTML()
{
var element = arguments[0];
var args = [];
// copy all other arguments we want to pass through to the fcn
for ( var ndx = 1; ndx < arguments.length; ndx++ )
args.push(arguments[ndx]);
var txt = _QTGenerate("QT_ReplaceElementContents_XHTML", true, args);
if ( txt.length > 0 )
element.innerHTML = txt;
}

648
var/mongoose/html/js/jquery-vlc.js vendored Normal file
View File

@@ -0,0 +1,648 @@
/*
<OWNER> = revolunet
<ORGANIZATION> = revolunet - Julien Bouquillon
<YEAR> = 2010
Copyright (c) 2010, revolunet
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met :
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE, DATA, OR PROFITS ; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var VLCobject = {
VLC_PLUGIN:"VLC Multimedia Plug-in"
,VLC_AX:"VideoLAN.VLCPlugin.2"
,VLC_MIME_TYPE:"application/x-vlc-plugin"
,TOOLBAR_HEIGHT:10
,INSTANCES:{} // holds multiples instances
,UNICODES:{
PLAY:'\u25ba'
,PAUSE:'\u2590 \u258c'
,STOP:'\u2588'
}
,ua:function() {
// browser detection stuff
var w3cdom = typeof document.getElementById != 'undefined' && typeof document.getElementsByTagName != 'undefined' && typeof document.createElement != 'undefined',
u = navigator.userAgent.toLowerCase(),
p = navigator.platform.toLowerCase(),
windows = p ? /win/.test(p) : /win/.test(u),
mac = p ? /mac/.test(p) : /mac/.test(u),
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
playerVersion = [0,0,0],
d = null;
if (typeof navigator.plugins != 'undefined' && typeof navigator.plugins[this.VLC_PLUGIN] == 'object') {
d = navigator.plugins[this.VLC_PLUGIN].description;
if (d && !(typeof navigator.mimeTypes != 'undefined' && navigator.mimeTypes[this.VLC_MIME_TYPE] && !navigator.mimeTypes[this.VLC_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes[VLC_MIME_TYPE].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
plugin = true;
ie = false; // cascaded feature detection for Internet Explorer
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
}
}
else if (typeof window.ActiveXObject != 'undefined') {
try {
var a = new ActiveXObject(this.VLC_AX);
if (a) { // a will return null when ActiveX is disabled
d = a.GetVariable("$version");
if (d) {
ie = true; // cascaded feature detection for Internet Explorer
d = d.split(" ")[1].split(",");
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
}
catch(e) {}
}
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
}()
,createVLC:function(attObj, parObj, id) {
var r, el = document.getElementById(id);
if (el) {
if (typeof attObj.id == 'undefined') { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
if (this.ua.ie && this.ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
var att = "";
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
if (i.toLowerCase() == "data") {
parObj.movie = attObj[i];
}
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
att += ' class="' + attObj[i] + '"';
}
else if (i.toLowerCase() != "classid") {
att += ' ' + i + '="' + attObj[i] + '"';
}
}
}
var par = "";
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
par += '<param name="' + j + '" value="' + parObj[j] + '" />';
}
}
el.outerHTML = '<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921"' + att + '>' + par + '</object>';
r = document.getElementById(attObj.id);
}
else { // well-behaving browsers
var o = document.createElement('object');
o.setAttribute("type", this.VLC_MIME_TYPE);
for (var m in attObj) {
if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
o.setAttribute("class", attObj[m]);
}
else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
o.setAttribute(m, attObj[m]);
}
}
}
for (var n in parObj) {
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
this.createObjParam(o, n, parObj[n]);
}
}
el.parentNode.replaceChild(o, el);
r = o;
}
}
return r;
}
,createObjParam:function(el, pName, pValue) {
var p = document.createElement("param");
p.setAttribute("name", pName);
p.setAttribute("value", pValue);
el.appendChild(p);
}
/* Cross-browser SWF removal
- Especially needed to safely and completely remove a SWF in Internet Explorer
*/
,removeVLC:function(id) {
var obj = document.getElementById(id);
if (obj && obj.nodeName == "OBJECT") {
if (this.ua.ie && this.ua.win) {
obj.style.display = "none";
(function(){
if (obj.readyState == 4) {
this.removeObjectInIE(id);
}
else {
setTimeout(arguments.callee, 10);
}
})();
}
else {
obj.parentNode.removeChild(obj);
}
}
}
,removeObjectInIE:function(id) {
var obj = document.getElementById(id);
if (obj) {
for (var i in obj) {
if (typeof obj[i] == "function") {
obj[i] = null;
}
}
obj.parentNode.removeChild(obj);
}
}
,embedVLC:function(replaceElemIdStr, widthStr, heightStr, vlcVersionStr, flashvarsObj, parObj, attObj, callbackFn) {
var callbackObj = {success:false, id:replaceElemIdStr};
if (this.ua.w3 && !(this.ua.wk && this.ua.wk < 312) && replaceElemIdStr && widthStr && heightStr) {
//setVisibility(replaceElemIdStr, false);
// addDomLoadEvent(function() {
widthStr += ""; // auto-convert to string
heightStr += "";
var att = {};
if (attObj && typeof attObj === 'object') {
for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
att[i] = attObj[i];
}
}
// att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
var par = {};
if (parObj && typeof parObj === 'object') {
for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
par[j] = parObj[j];
}
}
if (flashvarsObj && typeof flashvarsObj === 'object') {
for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
if (typeof par.flashvars != 'undefined') {
par.flashvars += "&" + k + "=" + flashvarsObj[k];
}
else {
par.flashvars = k + "=" + flashvarsObj[k];
}
}
}
if (!vlcVersionStr || hasPlayerVersion(vlcVersionStr)) { // create SWF
var obj = this.createVLC(att, par, replaceElemIdStr);
if (document.all) {
obj.style.width = widthStr;
obj.style.height= heightStr;
}
if (att.id == replaceElemIdStr) {
//setVisibility(replaceElemIdStr, true);
}
callbackObj.success = true;
callbackObj.ref = obj;
}
else { // show alternative content
//setVisibility(replaceElemIdStr, true);
}
if (callbackFn) { callbackFn(callbackObj); }
// });
}
else if (callbackFn) { callbackFn(callbackObj); }
}
,embedPlayer:function(replaceElemIdStr, widthStr, heightStr, add_toolbar) {
var tbHeight = add_toolbar?this.TOOLBAR_HEIGHT:0;
var plugin_height = (parseInt(heightStr) - tbHeight);
$('#' + replaceElemIdStr).html('');
$('#' + replaceElemIdStr).height(parseInt(heightStr));
var tbar = "<div id='" + replaceElemIdStr + "-main' class='x-vlc-main' style='width:" + widthStr + "px;height:" + heightStr + "px' >";
tbar += "<div id='" + replaceElemIdStr + "_plugin' class='x-vlc-plugin' ></div>";
tbar += "<div style='overflow:hide;width:" + widthStr + "px;height:" + tbHeight + "px' id='" + replaceElemIdStr + "_toolbar', class='x-vlc-toolbar' ></div>";
tbar += "</div>";
$('#' + replaceElemIdStr).append(tbar )
this.embedVLC(replaceElemIdStr + '_plugin', widthStr, plugin_height.toString());
if (typeof(this.INSTANCES[replaceElemIdStr]) == 'undefined') {
this.INSTANCES[replaceElemIdStr] = playerInstance(replaceElemIdStr);
}
if (add_toolbar) {
this.addToolbar(replaceElemIdStr);
}
else {
$('#' + replaceElemIdStr + '_toolbar').hide(); //default hide toolba
}
//this.INSTANCES[replaceElemIdStr].addEvents();
return this.INSTANCES[replaceElemIdStr];
}
,addToolbar:function(playerId) {
if(!playerId) playerId=this.INSTANCES[0];
var instance = this.INSTANCES[playerId];
var tgt = $('#' + playerId + '_toolbar');
tgt.html('');
this.createButton(playerId, '&nbsp;&nbsp;', 'x-vlc-btn-play', function(event) {
//alert('play '+ event.data.instance.playerId);
event.data.instance.togglePlay();
});
this.createButton(playerId, '&nbsp;&nbsp;', 'x-vlc-btn-stop', function(event) {
//alert('stop '+ event.data.instance.playerId);
event.data.instance.stop();
});
instance.createSlider();
this.getInstance(playerId).statusChanged();
this.createTimer(playerId);
this.createButton(playerId, '&nbsp;&nbsp;', 'x-vlc-btn-fullscreen', function(event) {
//alert('stop '+ event.data.instance.playerId);
event.data.instance.toggleFullscreen();
});
this.createButton(playerId, '&nbsp;&nbsp;', 'x-vlc-btn-plus', function(event) {
//alert('stop '+ event.data.instance.playerId);
// event.data.instance.stop();
$('#' + instance.playerId + '_about').slideToggle(0);
});
aboutTxt = "";
if (instance.version()) {
aboutTxt = 'Installed version: ' + instance.version();
}
else {
var url = "http://www.videolan.org/vlc/";
aboutTxt = "VLC not detected. <a href='" + url + "' target='blank'>click here to install</a>";
}
tgt.append('<div id="' + playerId + '_about" class="x-vlc-about" style="display:none" class="x-vlc-about">' + aboutTxt + '</div>');
tgt.show();
}
,remove:function(playerId) {
if(!playerId) playerId=this.INSTANCES[0];
delete this.INSTANCES[playerId] ;
}
,createButton:function(playerId, html, cls, handler) {
var tgt = $('#' + playerId + '_toolbar');
var id = playerId + '_toolbar_btn' + tgt[0].childNodes.length;
var btn = "<div id='" + id + "' style='float:left;width:16px;text-align:center;cursor:pointer' class='x-vlc-btn "+cls+"' >" + html + "</div>";
tgt.append(btn);
var instance = this.getInstance(playerId);
if (handler) {
$('#' + id).bind('click', {instance: instance}, handler);
}
}
,createTimer:function(playerId) {
var tgt = $('#' + playerId + '_toolbar' );
var timer = "<div id='" + playerId + "_timer' style='float:left;text-align:center;width:100px' class='x-vlc-timer'>&nbsp;00:00/00:00&nbsp;</div>"
tgt.append(timer);
}
,getInstance:function(playerId) {
return this.INSTANCES[playerId];
}
}
function playerInstance(playerId) {
var instance = {
playerId:playerId
,toolbar: + '_toolbar'
,slider:playerId + '_toolbar_slider'
,sliderCreated:false
,btn_play:playerId + '_toolbar_btn0'
,plugin:playerId + '_plugin'
,timer:playerId + '_timer'
,status:null
,__getPlugin:function() {
return $('#' + this.plugin)[0];
}
// JS API
,version:function() {
var plugin = this.__getPlugin();
if (!plugin) return false;
var version = plugin.versionInfo;
if(typeof(version)=="function") version = plugin.versionInfo();
return version;
}
,queue:function(uri) {
var plugin = this.__getPlugin();
if (!plugin) {
setTimeout("VLCobject.getInstance('" + this.playerId + "').play('" + uri + "');", 500);
return;
}
var options = this.options.get();
var id = plugin.playlist.add(uri, uri, options);
// plugin.playlist.playItem(id);
}
,play:function(uri) {
var plugin = this.__getPlugin();
if (!plugin) {
setTimeout("VLCobject.getInstance('" + this.playerId + "').play('" + uri + "');", 500);
return;
}
var options = this.options.get();
this.statusCheckStart();
if (uri) {
var id = plugin.playlist.add(uri, uri, options);
plugin.playlist.playItem(id);
}
else {
plugin.playlist.play();
}
}
,seek:function(percentage) {
var plugin = this.__getPlugin();
if (plugin.input.length > 0) {
plugin.input.time = plugin.input.length * percentage / 100;
}
}
,toggleFullscreen:function() {
var plugin = this.__getPlugin();
plugin.video.toggleFullscreen();
//plugin.video.fullscreen();
}
,togglePlay:function() {
var plugin = this.__getPlugin();
if (plugin.playlist.isPlaying) {
plugin.playlist.togglePause();
}
else {
plugin.playlist.play();
}
this.statusCheckStart();
//plugin.playlist.togglePause();
}
,stop:function() {
var plugin = this.__getPlugin();
plugin.playlist.stop();
//this.statusCheckStop();
// timeout to ensure to get last events
setTimeout("VLCobject.getInstance('" + this.playerId + "').statusCheckStop();", 1000);
}
,options:{
set:function(name, value) {
this.items[name] = value || null;
}
,del:function(name) {
delete this.items[name];
}
,clear:function() {
this.items = new Array();
}
// internal use only
,items:{}
,get:function() {
var tmp_array = new Array();
var debug_str = "";
var idx = 0;
for (var i in this.items)
{
var option_str = ":" + i;
if (this.items[i]) option_str += "=" + this.items[i];
tmp_array[idx] = option_str;
debug_str += option_str + " ";
idx += 1;
}
if (document.all) return tmp_array;
return debug_str;
}
}
// private status stuff
,VLC_STATUS:{
0:'standby'
,1:'opening'
,2:'buffering'
,3:'playing'
,4:'paused'
,5:'stopped'
,6:'ended'
}
,statusChanged:function() {
if (!this.status) {
this.setStatusText(this.VLC_STATUS[0]);
var width = this.getSliderLength();
var tb = $('#' +this.playerId + '_toolbar_slider' );
tb.width(width);
return;
}
if (this.status == 3) {
// playing
//if(!this.sliderCreated) this.setStatusText('playing');
this.setPlaying(true);
}
else {
this.setPlaying(false);
if (this.sliderCreated && this.status != 4) {
this.updateSlider(0);
}
if ((this.status == 0 || this.status == 5 || this.status == 6) ) {
this.setStatusText(this.VLC_STATUS[this.status]);
this.sliderCreated = false;
}
}
if(!this.sliderCreated) this.setStatusText(this.VLC_STATUS[this.status]);
return;
}
,setPlaying:function(playing) {
var tgt = $('#' + this.playerId + '_toolbar_btn0');
if (playing) {
tgt.removeClass( 'x-vlc-btn-play' );
tgt.addClass( 'x-vlc-btn-pause' );
if(!this.sliderCreated) this.setStatusText('playing');
}
else {
tgt.removeClass( 'x-vlc-btn-pause' );
tgt.addClass( 'x-vlc-btn-play' );
if(!this.sliderCreated) this.setStatusText('paused');
}
}
,statusCheck:function() {
var plugin = this.__getPlugin();
if (!plugin.input) return;
var status = plugin.input.state;
if (status != this.status) {
this.status = status;
this.statusChanged();
}
if (plugin.playlist.isPlaying) {
this.updatePosition(plugin.input.time / 1000, plugin.input.length / 1000)
}
}
,statusCheckStart:function() {
this.statusCheckStop();
this.statusCheckTimer = setInterval("VLCobject.getInstance('" + this.playerId + "').statusCheck();", 300);
}
,statusCheckStop:function() {
clearTimeout(this.statusCheckTimer);
}
,secsToTime:function(secs) {
if (secs == 0) {
return '00:00'
}
var secs = parseInt(secs );
var mins = 0;
if (secs > 60) {
mins = Math.floor(secs / 60);
secs = parseInt((secs - (mins*60)));
}
return this.pad(mins,2) + ':' + this.pad(secs, 2) ;
}
,pad:function(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
,getSliderLength:function() {
var l = ($('#'+this.plugin).width() - (105 + 100) );
return l;
}
,updateSlider:function(percentage) {
var td1 = $('#' + this.slider +' :first-child :first-child :first-child');
var td3 = $('#' + this.slider +' :first-child :first-child :last-child');
var offset = this.getSliderLength();
var w= offset * percentage ;
td1.width(w);
w= offset * (1-percentage) ;
td3.width(w);
}
,setStatusText:function(txt) {
this.sliderCreated = false;
var tb = $('#' +this.playerId + '_toolbar_slider' );
tb.html(txt);
}
,updatePosition:function(position, length) {
// update timer
$('#' + this.timer).html(this.secsToTime(position) + '/' + this.secsToTime(length));
var tb = $('#' +this.playerId + '_toolbar_slider' );
if (length == 0) {
//var width = ($('#'+this.plugin).width() - 4 - 50 - $('#'+this.timer).width() );
var width = this.getSliderLength();
tb.width(width);
this.sliderCreated = false
if (position<1) this.statusChanged(); // force display stattus at startup
}
else {
this.createSlider();
this.updateSlider(position/length);
}
}
// UI
,onSliderClick:function(event) {
var slider = $('#' + event.data.instance.slider);
var x = event.pageX;
var y = event.pageY;
var x_offset = x - slider.position().left;
var percentage = x_offset * 100 / slider.width();
event.data.instance.updateSlider(x_offset/slider.width());
event.data.instance.seek(percentage);
}
,createSlider:function() {
if ($('#' + slider_id).length > 0 && $('#' + table_id).length > 0) return;
var offset = this.getSliderLength();
var slider_id= this.playerId + '_toolbar_slider';
var table_id= this.playerId + '_toolbar_slider_tb';
var progress = "<table id='" + table_id + "' border=0 style='margin-top:5px;height:10px;cursor:pointer;display:inline' cellpadding=0 cellspacing=0 ><tr ><td width='0' class='x-vlc-slider'></td><td class='x-vlc-slider-thumb'></td><td width='" + (offset) + "' class='x-vlc-slider'></td></tr></table>";
if ($('#' + slider_id).length == 0) {
// div not preset exists
var tgt = $('#' + this.playerId + '_toolbar' );
var slider = "<div id='" + slider_id + "' width='" + (offset + 4)+"' style='text-align:center;float:left;height:10px'>";
//slider += progress
slider += "</div>";
tgt.append(slider);
$('#' + slider_id).bind('click', {instance:this}, this.onSliderClick);
}
if ($('#' + table_id).length == 0) {
var slider = $('#' + slider_id );
slider.html('');
slider.append(progress);
}
this.sliderCreated = true;
}
}
return instance;
}
if (!window.opera && document.all ) {
if (!VLCobject.unloadSet) {
VLCobject.prepUnload = function() {
__vlc_unloadHandler = function(){};
__vlc_savedUnloadHandler = function(){};
window.attachEvent("onunload", VLCobject.cleanupVLCs);
}
window.attachEvent("onbeforeunload", VLCobject.prepUnload);
VLCobject.unloadSet = true;
}
}
VLCobject.cleanupVLCs = function() {
for (i in this.INSTANCES) {
i.stop();
}
var objects = document.getElementsByTagName("OBJECT");
for (var i = objects.length - 1; i >= 0; i--) {
objects[i].style.display = 'none';
for (var x in objects[i]) {
if (typeof objects[i][x] == 'function') {
objects[i][x] = function(){};
}
}
}
}

View File

@@ -0,0 +1,53 @@
(function($) {
$.fn.bar = function(options) {
var opts = $.extend({}, $.fn.bar.defaults, options);
return this.each(function() {
$this = $(this);
var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
// $this.click(function(e){
if(!$('.jbar').length){
timeout = setTimeout('$.fn.bar.removebar()',o.time);
var _message_span = $(document.createElement('span')).addClass('jbar-content').html(o.message);
_message_span.css({"color" : o.color});
var _wrap_bar;
(o.position == 'bottom') ?
_wrap_bar = $(document.createElement('div')).addClass('jbar jbar-bottom'):
_wrap_bar = $(document.createElement('div')).addClass('jbar jbar-top') ;
_wrap_bar.css({"background-color" : o.background_color});
if(o.removebutton){
var _remove_cross = $(document.createElement('a')).addClass('jbar-cross');
_remove_cross.click(function(e){$.fn.bar.removebar();})
}
else{
_wrap_bar.css({"cursor" : "pointer"});
_wrap_bar.click(function(e){$.fn.bar.removebar();})
}
_wrap_bar.append(_message_span).append(_remove_cross).hide().insertBefore($('.content')).fadeIn('fast');
}
// })
});
};
var timeout;
$.fn.bar.removebar = function(txt) {
if($('.jbar').length){
clearTimeout(timeout);
$('.jbar').fadeOut('fast',function(){
$(this).remove();
});
}
};
$.fn.bar.defaults = {
background_color : '#FFFFFF',
color : '#000',
position : 'top',
removebutton : true,
time : 5000
};
})(jQuery);

View File

@@ -0,0 +1,70 @@
/*
* Content-Type:text/javascript
*
* A bridge between iPad and iPhone touch events and jquery draggable,
* sortable etc. mouse interactions.
* @author Oleg Slobodskoi
*
* modified by John Hardy to use with any touch device
* fixed breakage caused by jquery.ui so that mouseHandled internal flag is reset
* before each touchStart event
*
*/
(function( $ ) {
$.support.touch = typeof Touch === 'object';
if (!$.support.touch) {
return;
}
var proto = $.ui.mouse.prototype,
_mouseInit = proto._mouseInit;
$.extend( proto, {
_mouseInit: function() {
this.element
.bind( "touchstart." + this.widgetName, $.proxy( this, "_touchStart" ) );
_mouseInit.apply( this, arguments );
},
_touchStart: function( event ) {
if ( event.originalEvent.targetTouches.length != 1 ) {
return false;
}
this.element
.bind( "touchmove." + this.widgetName, $.proxy( this, "_touchMove" ) )
.bind( "touchend." + this.widgetName, $.proxy( this, "_touchEnd" ) );
this._modifyEvent( event );
$( document ).trigger($.Event("mouseup")); //reset mouseHandled flag in ui.mouse
this._mouseDown( event );
return false;
},
_touchMove: function( event ) {
this._modifyEvent( event );
this._mouseMove( event );
},
_touchEnd: function( event ) {
this.element
.unbind( "touchmove." + this.widgetName )
.unbind( "touchend." + this.widgetName );
this._mouseUp( event );
},
_modifyEvent: function( event ) {
event.which = 1;
var target = event.originalEvent.targetTouches[0];
event.pageX = target.clientX;
event.pageY = target.clientY;
}
});
})( jQuery );

Some files were not shown because too many files have changed in this diff Show More