Compare commits

..

1 Commits
0.8.4 ... 0.8.3

Author SHA1 Message Date
hummypkg
3fc4e3848e tag 0.8.3
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/tags/0.8.3@544 2a923420-c742-0410-a762-8d5b09965624
2011-12-05 21:46:01 +00:00
21 changed files with 19 additions and 298 deletions

View File

@@ -1,9 +1,11 @@
Package: webif
Priority: optional
Section: web
Version: 0.8.4
Version: 0.8.3
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.8),hmt(>=1.1.1),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.1),ssmtp
Replaces: af123-webif
Conflicts: af123-webif
Suggests: ffmpeg,webif-iphone,nicesplice
Description: An evolving web interface for the Humax.

View File

@@ -1,17 +0,0 @@
#!/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 30 /mod/var/mongoose/cgi-bin/backup/backup.jim"
) > $ana
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
exit 0

View File

@@ -1,10 +0,0 @@
#!/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,23 +13,12 @@ puts ""
cgi_input
#cgi_dump
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 * 3600)
foreach af [glob -nocomplain "$dir/auto-*"] {
set aft [file mtime $af]
set diff $($now - $aft)
if {$diff > $mt} {
puts "Removing $af"
file delete $af
}
}
if {![dict exists $_cgi file]} {
puts "No filename supplied."
exit
}
set file [file tail [dict get $_cgi file]]
set ffile "/$dir/$file.rbk"
if {[file exists $ffile]} {

View File

@@ -2,7 +2,7 @@
package require cgi
source /mod/var/mongoose/lib/setup
require ts.class pretty_size system.class settings.class
require ts.class pretty_size system.class
puts "Content-Type: text/html"
puts ""
@@ -18,34 +18,16 @@ cgi_input
#set env(REQUEST_URI) ''
#set _cgi(dir) "/media/My Video/\[Don't Die Young\]"
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
}
proc directory {file bfile} {
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>"
puts "<input class=\"fs fsdir\" type=checkbox>"
puts "<a class=dbf
href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
puts "<a href=\"$::env(REQUEST_URI)?dir=[cgi_quote_url $file]\"
file=\"$file\">"
puts "$bfile</a><span class=filesize id=\"$tbfile\">
</span>"
puts "
<a href=#>
<img class=\"dopt va\" border=0 width=45
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
"
puts "</div>"
</span></div>"
}
proc entry {file} {{i 0}} {
@@ -190,11 +172,6 @@ if $nicesplice {
puts {
</ul>
<ul id=doptmenu class=contextMenu>
<li class=delete><a href=#delete>Delete</a></li>
<li><a href=#rename>Rename</a></li>
</ul>
<div id=renameform title="Rename media file" style="display: none">
<form id=renameform_form>
<input type=hidden name="renameorig" id="renameorig" value="">
@@ -215,7 +192,7 @@ puts {
<tr style="display: none" class=tstype>
<th>
<label for="renametitle" style="padding-top: 0.5em">
<b>New Medialist Title</b>
<b>New EPG Title</b>
</label>
</th>
<td>
@@ -231,26 +208,6 @@ puts {
</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>
@@ -317,59 +274,12 @@ regsub -all -- {\/+} "$dir/*" "/" dir
# Escape square brackets (for glob)
regsub -all {([\\[])} $dir {\\\1} dir
proc s_time {a b} {
set ad [file isdirectory $a]
set bd [file isdirectory $b]
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
}
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
foreach file [lsort [glob -nocomplain "$dir"]] {
entry $file
}
set files [glob -nocomplain $dir]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort $files] }
}
foreach file $files { entry $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 "<div class=brow>"

View File

@@ -116,13 +116,6 @@ 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 savestream_submit()
{
var s = $('#savestream_form').serialize();
@@ -281,47 +274,6 @@ var menuclick = function(action, el, pos)
}
};
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':
var url = '/cgi-bin/browse/delete.jim?file=' +
encodeURIComponent(file) + '&type=dir';
if (confirm('Are you sure you wish to delete "' + file +
'" and all files within it?'))
{
$(results)
.html('<img src=/img/loading.gif>' +
'Deleting, please wait...')
.slideDown('slow')
.load(url, function() {
$(direl).delay(3000).slideUp(300, function() {
$(direl).remove();
});
});
}
break;
case 'rename':
$('#drename').val(bfile);
$('#drenameorig').val(file);
$('#drenameform').dialog('open');
break;
default:
alert('Unhandled action: ' + action);
break;
}
};
// Bind context menu to opt+ image
$('img.opt').contextMenu(
{
@@ -332,14 +284,6 @@ var dmenuclick = function(action, el, pos)
menuclick
);
$('img.dopt').contextMenu(
{
menu: 'doptmenu',
leftButton: true,
},
dmenuclick
);
// Disable items which are not yet implemented.
$('#optmenu').disableContextMenuItems('#title');
@@ -383,19 +327,6 @@ var dmenuclick = 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',

View File

@@ -20,13 +20,9 @@ if {$type eq "ts"} {
puts "Problem deleting $file, [$ts get error]"
}
exit
} elseif {$type eq "dir"} {
puts -nonewline "Directory..."
puts [exec /mod/bin/busybox/rm -rf $file]
puts -nonewline "Done..."
} else {
file delete $file
file delete "[file rootname $file].hmi"
puts "Successfully deleted $file."
}
file delete $file
file delete "[file rootname $file].hmi"
puts "Successfully deleted $file."

View File

@@ -21,7 +21,6 @@ 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 +0,0 @@
Channel 5 +1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9 B

View File

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

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

View File

@@ -1,70 +0,0 @@
/*
* 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 );

View File

@@ -1,7 +1,7 @@
if {[expr ! [exists -proc cat ]]} {
proc cat {file} {
if {[catch {set fp [open $file r}]} { return }
if {[catch {set fp [open $file r]]}} { return }
puts [read $fp]
close $fp
}

View File

@@ -116,10 +116,6 @@ settings method pkgdev {{val -1}} {
return [$self _nval_setting pkgdev $val]
}
settings method sortorder {{val -1}} {
return [$self _nval_setting sortorder $val]
}
settings method channel_groups {} {
set ret ""
set db [sqlite3.open /var/lib/humaxtv/setup.db]