git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@564 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-12-14 13:55:58 +00:00
parent ddb63e68b7
commit 509c98ee74
5 changed files with 47 additions and 30 deletions

View File

@ -1,9 +1,9 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 0.8.6-2 Version: 0.8.7
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk 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.8),hmt(>=1.1.2),ssmtp,anacron 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.8),hmt(>=1.1.2),ssmtp,anacron
Suggests: ffmpeg,webif-iphone,nicesplice Suggests: ffmpeg,webif-iphone,nicesplice,id3v2
Description: An evolving web interface for the Humax. Description: An evolving web interface for the Humax.

View File

@ -2,7 +2,7 @@
package require cgi package require cgi
source /mod/var/mongoose/lib/setup source /mod/var/mongoose/lib/setup
require ts.class pretty_size system.class settings.class require ts.class pretty_size system.class settings.class escape
puts "Content-Type: text/html" puts "Content-Type: text/html"
puts "" puts ""
@ -40,7 +40,7 @@ proc directory {file bfile} {
puts "<input class=\"fs fsdir\" type=checkbox>" puts "<input class=\"fs fsdir\" type=checkbox>"
puts "<a class=dbf puts "<a class=dbf
href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\" href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
file=\"$file\">" file=\"[cgi_quote_url $file]\">"
puts "$bfile</a><span class=filesize id=\"$tbfile\"> puts "$bfile</a><span class=filesize id=\"$tbfile\">
</span>" </span>"
@ -117,7 +117,7 @@ proc entry {file} {{i 0}} {
<div class=\"va bf\" id=[incr i]> <div class=\"va bf\" id=[incr i]>
<img class=va border=0 src=/img/$img.png> <img class=va border=0 src=/img/$img.png>
<input class=\"$fscl\" type=checkbox> <input class=\"$fscl\" type=checkbox>
<a class=bf file=\"$file\" type=$type href=#> <a class=bf file=\"[cgi_quote_url $file]\" type=$type href=#>
$bfile $bfile
</a> </a>
" "

View File

@ -3,7 +3,7 @@
package require sqlite3 package require sqlite3
package require cgi package require cgi
source /mod/var/mongoose/lib/setup source /mod/var/mongoose/lib/setup
require ts.class require ts.class system.class
puts "Content-Type: text/html\r\n\r\n" puts "Content-Type: text/html\r\n\r\n"
@ -23,9 +23,18 @@ if {[cgi_get do] eq "it"} {
puts "Processing $shname" puts "Processing $shname"
puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \ puts [exec /mod/bin/ffmpeg -y -benchmark -v 0 \
-i $rfile -f mp2 \ -i $rfile -f mp3 \
-vn -acodec copy "${base}.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] set xtime [expr [expr [clock milliseconds] - $xstart] / 1000.0]
puts "Time taken: $xtime" puts "Time taken: $xtime"

View File

@ -79,8 +79,8 @@ function delete_callback(file, type, id)
{ {
var el = 'div.bf#' + id; var el = 'div.bf#' + id;
var results = el + ' .results'; var results = el + ' .results';
var url = '/cgi-bin/browse/delete.jim?file=' + var url = '/cgi-bin/browse/delete.jim?file=' + file +
encodeURIComponent(file) + '&type=' + type; '&type=' + type;
$(results) $(results)
.html('<img src=/img/loading.gif>Deleting, please wait...') .html('<img src=/img/loading.gif>Deleting, please wait...')
.slideDown('slow') .slideDown('slow')
@ -93,19 +93,19 @@ function delete_callback(file, type, id)
function lock_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); }); $.get(url, function() { window.location.reload(true); });
} }
function enc_callback(file, type, id) 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); }); $.get(url, function() { window.location.reload(true); });
} }
function new_callback(file, type, id) 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); }); $.get(url, function() { window.location.reload(true); });
} }
@ -148,7 +148,7 @@ function confirm_action(action, callback, file, type, id)
}); });
$('#confirm').empty().html( $('#confirm').empty().html(
'Are you sure you wish to ' + action + '<br>' + 'Are you sure you wish to ' + action + '<br>' +
'<i>' + bfile + '</i> ?' '<i>' + decodeURIComponent(bfile) + '</i> ?'
); );
$confirm.dialog('open'); $confirm.dialog('open');
} }
@ -261,8 +261,8 @@ var menuclick = function(action, el, pos)
break; break;
case 'rename': case 'rename':
$('#rename').val(bfile); $('#rename').val(decodeURIComponent(bfile));
$('#renameorig').val(file); $('#renameorig').val(decodeURIComponent(file));
$('#titleorig').val(''); $('#titleorig').val('');
$('#renametitle').val(''); $('#renametitle').val('');
@ -272,7 +272,7 @@ var menuclick = function(action, el, pos)
if (type == 'ts') if (type == 'ts')
{ {
$.getJSON('/cgi-bin/browse/epgtitle.jim?file=' + $.getJSON('/cgi-bin/browse/epgtitle.jim?file=' +
encodeURIComponent(file), epginfo_callback); file, epginfo_callback);
} }
$('#renameform').dialog('open'); $('#renameform').dialog('open');
@ -280,22 +280,22 @@ var menuclick = function(action, el, pos)
case 'download': case 'download':
window.location.href = '/cgi-bin/browse/download.jim?file=' + window.location.href = '/cgi-bin/browse/download.jim?file=' +
encodeURIComponent(file); file;
break; break;
case 'crop': case 'crop':
window.location.href = '/cgi-bin/browse/crop.jim?file=' + window.location.href = '/cgi-bin/browse/crop.jim?file=' +
encodeURIComponent(file); file;
break; break;
case 'decrypt': case 'decrypt':
window.location.href = '/cgi-bin/browse/decrypt.jim?file=' + window.location.href = '/cgi-bin/browse/decrypt.jim?file=' +
encodeURIComponent(file); file;
break; break;
case 'audio': case 'audio':
window.location.href = '/cgi-bin/browse/audio.jim?file=' + window.location.href = '/cgi-bin/browse/audio.jim?file=' +
encodeURIComponent(file); file;
break; break;
default: default:
@ -315,10 +315,11 @@ var dmenuclick = function(action, el, pos)
switch (action) switch (action)
{ {
case 'delete': case 'delete':
var url = '/cgi-bin/browse/delete.jim?file=' + var url = '/cgi-bin/browse/delete.jim?file=' + file +
encodeURIComponent(file) + '&type=dir'; '&type=dir';
if (confirm('Are you sure you wish to delete "' + file + if (confirm('Are you sure you wish to delete "' +
decodeURIComponent(file) +
'" and all files within it?')) '" and all files within it?'))
{ {
$(results) $(results)
@ -334,14 +335,13 @@ var dmenuclick = function(action, el, pos)
break; break;
case 'rename': case 'rename':
$('#drename').val(bfile); $('#drename').val(decodeURIComponent(bfile));
$('#drenameorig').val(file); $('#drenameorig').val(decodeURIComponent(file));
$('#drenameform').dialog('open'); $('#drenameform').dialog('open');
break; break;
case 'flat': case 'flat':
var url = '/cgi-bin/browse/flat.jim?file=' + var url = '/cgi-bin/browse/flat.jim?file=' + file;
encodeURIComponent(file);
$.get(url, function() { window.location.reload(true); }); $.get(url, function() { window.location.reload(true); });
break; break;
@ -394,8 +394,8 @@ var dmenuclick = function(action, el, pos)
e.preventDefault(); e.preventDefault();
var file = $(this).attr('file'); var file = $(this).attr('file');
var type = $(this).attr('type'); var type = $(this).attr('type');
var url = '/cgi-bin/browse/file.jim?file=' + var url = '/cgi-bin/browse/file.jim?file=' + file
encodeURIComponent(file) + '&type=' + type; + '&type=' + type;
$('#dialogue').load(url); $('#dialogue').load(url);
$dialog.dialog('open'); $dialog.dialog('open');
}); });
@ -499,7 +499,7 @@ var dmenuclick = function(action, el, pos)
.click(function() { .click(function() {
var files = new Array(); var files = new Array();
var els = $('input.fs:checked + a').each(function() { var els = $('input.fs:checked + a').each(function() {
files.push(encodeURIComponent($(this).attr('file'))); files.push($(this).attr('file'));
}); });
//console.log("%o", files); //console.log("%o", files);
var str = 'Are you sure you want to delete ' + files.length + var str = 'Are you sure you want to delete ' + files.length +

8
var/mongoose/lib/escape Normal file
View File

@ -0,0 +1,8 @@
if {[expr ! [exists -proc escape]]} {
proc escape {str} {
regsub -all -- {"} "$str" "\\\"" str
return $str
}
}