From f62904edb482301a4bad08d8a578014dc82686af Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 25 Jan 2012 23:19:57 +0000 Subject: [PATCH] vlc working + media git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@690 2a923420-c742-0410-a762-8d5b09965624 --- var/mongoose/cgi-bin/browse.jim | 37 +- var/mongoose/cgi-bin/browse/browse.js | 39 +- var/mongoose/cgi-bin/browse/delete.jim | 7 +- var/mongoose/cgi-bin/browse/play.jim | 25 +- var/mongoose/cgi-bin/browse/play.js | 13 + var/mongoose/html/css/style.css | 2 +- var/mongoose/html/css/vlc.css | 60 ++ var/mongoose/html/img/media/fast_backward.png | Bin 0 -> 3947 bytes var/mongoose/html/img/media/fast_forward.png | Bin 0 -> 3954 bytes var/mongoose/html/img/media/move.png | Bin 0 -> 4130 bytes var/mongoose/html/img/media/mute_2.png | Bin 0 -> 4346 bytes var/mongoose/html/img/media/next_track.png | Bin 0 -> 3966 bytes var/mongoose/html/img/media/pause.png | Bin 0 -> 3892 bytes var/mongoose/html/img/media/play.png | Bin 0 -> 3915 bytes .../html/img/media/previous_track.png | Bin 0 -> 3942 bytes var/mongoose/html/img/media/scroll_left.png | Bin 0 -> 4145 bytes var/mongoose/html/img/media/scroll_right.png | Bin 0 -> 4176 bytes var/mongoose/html/img/media/stop.png | Bin 0 -> 3640 bytes var/mongoose/html/img/media/volume_2.png | Bin 0 -> 4218 bytes var/mongoose/html/img/quicktime.gif | Bin 0 -> 1447 bytes var/mongoose/html/js/ac_quicktime.js | 364 ++++++++++ var/mongoose/html/js/jquery-vlc.js | 648 ++++++++++++++++++ 22 files changed, 1162 insertions(+), 33 deletions(-) create mode 100644 var/mongoose/cgi-bin/browse/play.js create mode 100644 var/mongoose/html/css/vlc.css create mode 100644 var/mongoose/html/img/media/fast_backward.png create mode 100644 var/mongoose/html/img/media/fast_forward.png create mode 100644 var/mongoose/html/img/media/move.png create mode 100644 var/mongoose/html/img/media/mute_2.png create mode 100644 var/mongoose/html/img/media/next_track.png create mode 100644 var/mongoose/html/img/media/pause.png create mode 100644 var/mongoose/html/img/media/play.png create mode 100644 var/mongoose/html/img/media/previous_track.png create mode 100644 var/mongoose/html/img/media/scroll_left.png create mode 100644 var/mongoose/html/img/media/scroll_right.png create mode 100644 var/mongoose/html/img/media/stop.png create mode 100644 var/mongoose/html/img/media/volume_2.png create mode 100644 var/mongoose/html/img/quicktime.gif create mode 100644 var/mongoose/html/js/ac_quicktime.js create mode 100644 var/mongoose/html/js/jquery-vlc.js diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index 18fbe3ab..19a82f78 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -33,6 +33,14 @@ if {$order eq "-"} { set model [system model] set dustbin [system dustbin 1] +proc icon {img {hover ""} {extra ""}} { + puts -nonewline "\"$hover\"" +} + proc directory {file bfile} { global flatten @@ -51,14 +59,8 @@ proc directory {file bfile} { set noflat 0 if $flatten { if {[string match {\[*\]} [file tail $file]]} { set noflat 1 } - if {[file exists "$file/.noflatten"]} { - set noflat 1 - } - - if $noflat { - puts "\"No-flatten\"" - } + if {[file exists "$file/.noflatten"]} { set noflat 1 } + if $noflat { icon "/img/flat-tyre.png" "No-flatten" } } puts -nonewline " @@ -155,39 +157,32 @@ proc entry {file} {{i 0}} { set def SD set img "172_1_26_SD" } - puts "" + icon "/images/$img.png" # Locked if {[$ts flag "Locked"] > 0} { set locked 1 - puts "" + icon "/images/178_1_00_Icon_Lock.png" "Locked" } # Encrypted if {[$ts flag "Encrypted"] > 0} { set encd 1 - puts "" + icon "/images/749_1_26_Video_Encryption.png" "" } if {![$ts flag "ODEncrypted"]} { - puts "" set odencd 0 + icon "/img/Decrypted.png" "Decrypted" } # Guidance if {[$ts flag "Guidance"] > 0} { - puts "" + icon "/images/174_1_26_GuidancePolicy.png" } # Indexed if {$::model eq "HDR" && [llength [$ts dlnaloc]]} { - puts "\"Indexed" + icon "/img/dlna.png" "Indexed by DLNA Server" set dlna 1 } diff --git a/var/mongoose/cgi-bin/browse/browse.js b/var/mongoose/cgi-bin/browse/browse.js index ddb7a90e..80a45fc1 100755 --- a/var/mongoose/cgi-bin/browse/browse.js +++ b/var/mongoose/cgi-bin/browse/browse.js @@ -436,6 +436,13 @@ var dmenuclick = function(action, el, pos) // 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", @@ -443,23 +450,43 @@ var dmenuclick = 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( '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 opt = $(this).nextAll('a').find('img.opt'); + var url = '/cgi-bin/browse/file.jim?file=' + file + '&type=' + type; - $('#dialogue').load(url); + $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'); }); diff --git a/var/mongoose/cgi-bin/browse/delete.jim b/var/mongoose/cgi-bin/browse/delete.jim index bc542320..a3c38e73 100755 --- a/var/mongoose/cgi-bin/browse/delete.jim +++ b/var/mongoose/cgi-bin/browse/delete.jim @@ -10,6 +10,7 @@ cgi_input #cgi_dump set dir [cgi_get dir] +regsub -all {([\\["$])} $dir {\\\1} dir #puts "DIR: ($dir)" @@ -33,15 +34,17 @@ proc touch {file} { puts "
Deleting...
" puts "