From 84b5cb95060749ac44138ffbffcb5c77ea3a3117 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Sun, 8 Jan 2012 20:54:07 +0000 Subject: [PATCH] reinstate delete, add failed recordings git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@638 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 4 ++-- var/mongoose/cgi-bin/browse.jim | 14 +++++++---- var/mongoose/cgi-bin/browse/browse.js | 28 ++++++++++++---------- var/mongoose/cgi-bin/browse/clipboard.jim | 2 +- var/mongoose/cgi-bin/browse/mdelete.jim | 20 +++++++--------- var/mongoose/html/img/Video_Failed.png | Bin 0 -> 4489 bytes 6 files changed, 36 insertions(+), 32 deletions(-) create mode 100644 var/mongoose/html/img/Video_Failed.png diff --git a/CONTROL/control b/CONTROL/control index 59d6c6a..e0552fe 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,9 @@ Package: webif Priority: optional Section: web -Version: 0.8.10 +Version: 0.8.11 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.3),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.4),ssmtp,anacron Suggests: ffmpeg,webif-iphone,nicesplice,id3v2 Description: An evolving web interface for the Humax. diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index 709bb2a..b181a87 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -10,8 +10,8 @@ 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 @@ -93,6 +93,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 @@ -102,8 +108,8 @@ 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 } diff --git a/var/mongoose/cgi-bin/browse/browse.js b/var/mongoose/cgi-bin/browse/browse.js index 6671165..65aae49 100755 --- a/var/mongoose/cgi-bin/browse/browse.js +++ b/var/mongoose/cgi-bin/browse/browse.js @@ -253,7 +253,6 @@ function preparemenu(el, menu) $(menu).disableContextMenuItems('#audio'); $(menu).disableContextMenuItems('#crop'); } -$(menu).disableContextMenuItems('#delete'); } @@ -267,7 +266,6 @@ function preparedmenu(el, menu) $(menu).changeContextMenuItem('#flat', 'Prevent Flatten'); } -$(menu).disableContextMenuItems('#delete'); } $(document).ready(function() { @@ -554,7 +552,7 @@ var dmenuclick = 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=' + @@ -565,7 +563,7 @@ var dmenuclick = function(action, el, pos) .click(function() { var files = new Array(); var els = $('input.fs:checked + a').each(function() { - files.push($(this).attr('file')); + files.push(decodeURIComponent($(this).attr('file'))); }); //console.log("%o", files); var str = 'Are you sure you want to delete ' + files.length + @@ -589,9 +587,10 @@ var dmenuclick = function(action, el, pos) } }); $('#pwfeedback').load( - '/cgi-bin/browse/mdelete.jim?dir=' + - encodeURIComponent(dir) + '&files=' + - files.join(), function() { + '/cgi-bin/browse/mdelete.jim', { + 'dir': dir, + 'files': files + }, function() { $('#pwdialogue').dialog('close'); window.location.reload(true); }); @@ -602,14 +601,19 @@ var dmenuclick = function(action, el, pos) .click(function() { var files = new Array(); var els = $('input.fs:checked + a').each(function() { - files.push($(this).attr('file')); + 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!')) + if (action == 'copy' && !confirm('Are you sure? ' + + 'Copying recordings can take a very long time!')) return; - $.get('/cgi-bin/browse/clipboard.jim?act=add&mode=' + action + - '&path=' + files.join(), function() { + + $.post('/cgi-bin/browse/clipboard.jim', { + 'act': 'add', + 'mode': action, + 'path': files + }, function() { reloadclipboard(); $('input.fs:checked').attr('checked', false); }); @@ -659,8 +663,6 @@ var dmenuclick = function(action, el, pos) else $('#delete,#cut,#copy').disable(); - $('#delete').disable(); - var num = $('input.fsts:checked').size(); if (num > 1) $('#join').enable(); diff --git a/var/mongoose/cgi-bin/browse/clipboard.jim b/var/mongoose/cgi-bin/browse/clipboard.jim index 3adfbd4..1b2fb98 100755 --- a/var/mongoose/cgi-bin/browse/clipboard.jim +++ b/var/mongoose/cgi-bin/browse/clipboard.jim @@ -52,7 +52,7 @@ switch $action { exit } set mode [cgi_get mode copy] - foreach p [split $path ","] { + foreach p $path { set p [cgi_unquote_input $p] if {![$cb present $p]} { $cb add $mode $p diff --git a/var/mongoose/cgi-bin/browse/mdelete.jim b/var/mongoose/cgi-bin/browse/mdelete.jim index 874268a..f5cae31 100755 --- a/var/mongoose/cgi-bin/browse/mdelete.jim +++ b/var/mongoose/cgi-bin/browse/mdelete.jim @@ -8,13 +8,20 @@ puts "Content-Type: text/html\r\n\r\n" cgi_input 1 #cgi_dump + set dir [cgi_unquote_input [cgi_get dir]] +#puts "DIR: ($dir)" + puts "
Deleting...
" puts "" -puts ""; - -puts { - -} diff --git a/var/mongoose/html/img/Video_Failed.png b/var/mongoose/html/img/Video_Failed.png new file mode 100644 index 0000000000000000000000000000000000000000..f893cddfb2153d4f75e4a92d26716f9dbfe302ba GIT binary patch literal 4489 zcmV;45q9p0P)Oz@Z0f2-7z;ux~O9+4z06=<WDR*FRcSTFz- zW=q650N5=6FiBTtNC2?60Km==3$g$R3;-}uh=nNt1bYBr$Ri_o0EC$U6h`t_Jn<{8 z5a%iY0C<_QJh>z}MS)ugEpZ1|S1ukX&Pf+56gFW3VVXcL!g-k)GJ!M?;PcD?0HBc- z5#WRK{dmp}uFlRjj{U%*%WZ25jX z{P*?XzTzZ-GF^d31o+^>%=Ap99M6&ogks$0k4OBs3;+Bb(;~!4V!2o<6ys46agIcq zjPo+3B8fthDa9qy|77CdEc*jK-!%ZRYCZvbku9iQV*~a}ClFY4z~c7+0P?$U!PF=S z1Au6Q;m>#f??3%Vpd|o+W=WE9003S@Bra6Svp>fO002awfhw>;8}z{#EWidF!3EsG z3;bXU&9EIRU@z1_9W=mEXoiz;4lcq~xDGvV5BgyU zp1~-*fe8db$Osc*A=-!mVv1NJjtCc-h4>-CNCXm#Bp}I%6j35eku^v$Qi@a{RY)E3 zJ#qp$hg?Rwkvqr$GJ^buyhkyVfwECO)C{#lxu`c9ghrwZ&}4KmnvWKso6vH!8a<3Q zq36)6Xb;+tK10Vaz~~qUGsJ8#F2=(`u{bOVlVi)VBCHIn#u~6ztOL7=^<&SmcLWlF zMZgI*1b0FpVIDz9SWH+>*hr`#93(Um+6gxa1B6k+CnA%mOSC4s5&6UzVlpv@SV$}* z))J2sFA#f(L&P^E5{W}HC%KRUNwK6<(h|}}(r!{C=`5+6G)NjFlgZj-YqAG9lq?`C z$c5yc>d>VnA`E_*3F2Qp##d8RZb=H01_mm@+|Cqnc9PsG(F5HIG_C zt)aG3uTh7n6Et<2In9F>NlT@zqLtGcXcuVrX|L#Xx)I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