diff --git a/CONTROL/control b/CONTROL/control index f249511..6411a8a 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.2.6-3 +Version: 1.2.7 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.37-2),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1),hmt(>=2.0.9),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7) +Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.39),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1),hmt(>=2.0.9),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7) Suggests: Description: An evolving web interface for the Humax. Tags: http://hummy.tv/forum/threads/6484/ diff --git a/webif/html/browse/audio/audio.jim b/webif/html/browse/audio/audio.jim index 69a4b53..8ff01dc 100755 --- a/webif/html/browse/audio/audio.jim +++ b/webif/html/browse/audio/audio.jim @@ -35,13 +35,12 @@ puts "
+ - -
diff --git a/webif/html/browse/audio/audio.js b/webif/html/browse/audio/audio.js index ebdc542..a327ea9 100755 --- a/webif/html/browse/audio/audio.js +++ b/webif/html/browse/audio/audio.js @@ -15,12 +15,13 @@ $(document).ready(function() { $('#progressbar').reportprogress(0); $('#back').button().click(function() { - window.location = '../index.jim?dir=' + $('#params').attr('dir'); + window.location = '/go/browse?dir=' + $('#params').attr('dir'); }); $('#audioit').button().click(function() { $('#audiodiv').hide('slow'); $('#progressdiv').show('slow'); + $('#back').hide(); handle = setInterval("update()", 1000); $('#output').load('execute.jim?file=' + $('#params').attr('rfile'), function() { diff --git a/webif/html/browse/bookmarks/script.js b/webif/html/browse/bookmarks/script.js index b49e99e..1ff44a7 100644 --- a/webif/html/browse/bookmarks/script.js +++ b/webif/html/browse/bookmarks/script.js @@ -119,7 +119,7 @@ $('#save').button({icons: {primary: "ui-icon-disk"}}) $('#back').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"}}) .on('click', function() { - window.location = '../index.jim?dir=' + dir; + window.location = '/go/browse?dir=' + dir; }); $('#update').button() diff --git a/webif/html/browse/chunk/chunk.jim b/webif/html/browse/chunk/chunk.jim index de2d545..b119b28 100755 --- a/webif/html/browse/chunk/chunk.jim +++ b/webif/html/browse/chunk/chunk.jim @@ -53,12 +53,9 @@ puts "
- - " diff --git a/webif/html/browse/chunk/chunk.js b/webif/html/browse/chunk/chunk.js index 2dad681..7539935 100644 --- a/webif/html/browse/chunk/chunk.js +++ b/webif/html/browse/chunk/chunk.js @@ -48,7 +48,7 @@ function xpart(part) else { clearInterval(handle); - $('#findiv').show('slow'); + $('#back').show('slow'); } } @@ -60,6 +60,7 @@ $('#chunkit').button().click(function(e) { e.preventDefault(); $('#chunkdiv').hide('slow'); $('tr.part').show('slow'); + $('#back').hide(); handle = setInterval("xprogress()", 1000); xpart(0); @@ -69,7 +70,7 @@ $('#back').button().click(function(e) { e.preventDefault(); var dir = $(this).attr('dir'); - window.location = '../index.jim?dir=' + dir; + window.location = '/go/browse?dir=' + dir; }); }); diff --git a/webif/html/browse/crop/crop.jim b/webif/html/browse/crop/crop.jim index 233c8fb..9ab6cc0 100755 --- a/webif/html/browse/crop/crop.jim +++ b/webif/html/browse/crop/crop.jim @@ -101,13 +101,12 @@ puts " + - -
diff --git a/webif/html/browse/crop/crop.js b/webif/html/browse/crop/crop.js index d7d7894..52b6c9c 100755 --- a/webif/html/browse/crop/crop.js +++ b/webif/html/browse/crop/crop.js @@ -17,12 +17,13 @@ $(document).ready(function() { $('#progressbar').reportprogress(0); $('#back').button().click(function() { - window.location = '../index.jim?dir=' + $('#params').attr('dir'); + window.location = '/go/browse?dir=' + $('#params').attr('dir'); }); $('#cropit').button().click(function() { $('#cropdiv').hide('slow'); $('#progressdiv').show('slow'); + $('#back').hide(); handle = setInterval("update()", 1000); $('#output').show().text('Please do not interrupt...') .load('execute.jim?file=' + $('#params').attr('file') + diff --git a/webif/html/browse/decrypt/decrypt.jim b/webif/html/browse/decrypt/decrypt.jim index 4abc414..616fd19 100755 --- a/webif/html/browse/decrypt/decrypt.jim +++ b/webif/html/browse/decrypt/decrypt.jim @@ -52,12 +52,12 @@ puts "
+ -
diff --git a/webif/html/browse/decrypt/decrypt.js b/webif/html/browse/decrypt/decrypt.js index b0644e6..0120b4f 100755 --- a/webif/html/browse/decrypt/decrypt.js +++ b/webif/html/browse/decrypt/decrypt.js @@ -15,12 +15,13 @@ $(document).ready(function() { $('#progressbar').reportprogress(0); $('#back').button().click(function() { - window.location = '../index.jim?dir=' + $('#params').attr('dir'); + window.location = '/go/browse?dir=' + $('#params').attr('dir'); }); $('#decryptit').button().click(function() { $('#decryptdiv').hide('slow'); $('#progressdiv').show('slow'); + $('#back').hide(); handle = setInterval("update()", 1000); $('#output').load('execute.jim?file=' + $('#params').attr('file'), function() { diff --git a/webif/html/browse/file.jim b/webif/html/browse/file.jim index ac4d034..6cb92dd 100755 --- a/webif/html/browse/file.jim +++ b/webif/html/browse/file.jim @@ -31,7 +31,7 @@ if {$type eq "ts"} { " if {[file exists "[file rootname $file].thm"]} { - puts "" + puts "" } if {[dict exists $idata thumb]} { diff --git a/webif/html/browse/index.jim b/webif/html/browse/index.jim index c52f9b1..dd1a16e 100755 --- a/webif/html/browse/index.jim +++ b/webif/html/browse/index.jim @@ -249,10 +249,12 @@ if {[system model] eq "HDR" && ![system param DMS_START_ON]} { #} puts " - $dir - $mroot -
- + +
+ " browse breadcrumb $dir diff --git a/webif/html/browse/join/join.jim b/webif/html/browse/join/join.jim index b9657b0..dada9f6 100755 --- a/webif/html/browse/join/join.jim +++ b/webif/html/browse/join/join.jim @@ -45,13 +45,12 @@ Name for joined file: length=20 maxlength=50> +
Joining:
-
" diff --git a/webif/html/browse/join/join.js b/webif/html/browse/join/join.js index 8694edc..fc49fb3 100755 --- a/webif/html/browse/join/join.js +++ b/webif/html/browse/join/join.js @@ -22,7 +22,7 @@ $(document).ready(function() { $('#progressbar').reportprogress(0); $('#back').button().click(function() { - window.location = '../index.jim?dir=' + $(this).attr('dir'); + window.location = '/go/browse?dir=' + $(this).attr('dir'); }); $('#filelist').sortable().disableSelection(); @@ -36,6 +36,7 @@ $('#dojoin').button().attr('disabled', true).addClass('ui-state-disabled') $('#joindiv').hide('slow'); $('#progressdiv').show('slow'); + $('#back').hide(); handle = setInterval("update()", 1000); $('#output').text('Please do not interrupt...') diff --git a/webif/html/browse/mpg/mpg.jim b/webif/html/browse/mpg/mpg.jim index ef22c2d..c7c1622 100755 --- a/webif/html/browse/mpg/mpg.jim +++ b/webif/html/browse/mpg/mpg.jim @@ -32,13 +32,12 @@ puts "
+ - -
diff --git a/webif/html/browse/mpg/mpg.js b/webif/html/browse/mpg/mpg.js index c487fc3..45ba0fa 100755 --- a/webif/html/browse/mpg/mpg.js +++ b/webif/html/browse/mpg/mpg.js @@ -15,12 +15,13 @@ $(document).ready(function() { $('#progressbar').reportprogress(0); $('#back').button().click(function() { - window.location = '../index.jim?dir=' + $('#params').attr('dir'); + window.location = '/go/browse?dir=' + $('#params').attr('dir'); }); $('#mpgit').button().click(function() { $('#mpgdiv').hide('slow'); $('#progressdiv').show('slow'); + $('#back').hide(); handle = setInterval("update()", 1000); $('#output').load('execute.jim?file=' + $('#params').attr('rfile'), function() { diff --git a/webif/html/browse/script.js b/webif/html/browse/script.js index 954837b..5f3478d 100755 --- a/webif/html/browse/script.js +++ b/webif/html/browse/script.js @@ -1,4 +1,6 @@ +var dir; + var plugins = { menu: {}, menu_prepare: {}, @@ -8,8 +10,6 @@ var plugins = { dmenu_prepare: {} }; -var dir; - function blockpage(msg) { if (!msg) @@ -429,14 +429,6 @@ function flagdir(file, flag, iconset, output, options) }).delay(3000).slideUp(); } -$(function() { - -$('textarea').keydown(function(e) { - return e.keyCode != 13; -}); - -dir = $('#dir').text(); - var menuclick = function(action, el, pos) { var file = $(el).parent().prevAll('a.bf').last().attr('file'); @@ -652,7 +644,8 @@ var dmenuclick = function(action, el, pos) $('#aexpiry_working').hide('fast'); $('#aexpiry_loading').show('fast'); - $.getJSON('aexpiry.jim?act=fetch&dir=' + file, function(data) { + $.getJSON('/browse/aexpiry.jim?act=fetch&dir=' + file, + function(data) { $.each(data, function(key, val) { if (key == 'days') $('#aexpiry_days').val(val); @@ -716,356 +709,362 @@ var dmenuclick = function(action, el, pos) } }; - // Bind context menu to opt+ image - $('img.opt').contextMenu( - { - menu: 'optmenu', - leftButton: true, - beforeShow: preparemenu - }, - menuclick - ); +$(function() { - // Bind context menu to opt+ image - $('img.oopt').contextMenu( - { - menu: 'ooptmenu', - leftButton: true, - beforeShow: prepareomenu - }, - omenuclick - ); +$('textarea').keydown(function(e) { + return e.keyCode != 13; +}); - $('img.dopt').contextMenu( - { - menu: 'doptmenu', - leftButton: true, - beforeShow: preparedmenu - }, - dmenuclick - ); - - $('img.doopt').contextMenu( - { - menu: 'dooptmenu', - 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", - modal: false, autoOpen: false, - height: 600, width: 700, - show: 'scale', hide: 'fade', - draggable: true, resizable: true, - buttons: $buttons, - close: function(e,u) { $('#dialogue').empty().html( - 'Retrieving data...'); } - }); - - function doplay() +// Bind context menu to opt+ image +$('img.opt').contextMenu( { - var file = $dialog.attr('file'); - var type = $dialog.attr('type'); + menu: 'optmenu', + leftButton: true, + beforeShow: preparemenu + }, + menuclick +); +// Bind context menu to opt+ image +$('img.oopt').contextMenu( + { + menu: 'ooptmenu', + leftButton: true, + beforeShow: prepareomenu + }, + omenuclick +); + +$('img.dopt').contextMenu( + { + menu: 'doptmenu', + leftButton: true, + beforeShow: preparedmenu + }, + dmenuclick +); + +$('img.doopt').contextMenu( + { + menu: 'dooptmenu', + 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", + modal: false, autoOpen: false, + height: 600, width: 700, + show: 'scale', hide: 'fade', + draggable: true, resizable: true, + buttons: $buttons, + close: function(e,u) { $('#dialogue').empty().html( + 'Retrieving data...'); } +}); + +function doplay() +{ + var file = $dialog.attr('file'); + var type = $dialog.attr('type'); + + disableall(); + + window.location = '/play/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 = '/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'); +}); + +$('#renameform').dialog({ + autoOpen: false, + height: 'auto', width: 'auto', + modal: true, + buttons: { + "Update": rename_submit, + "Close": function() { + $(this).dialog('close'); + } + }, + 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(''); } +}); + +$('#aexpiry').dialog({ + autoOpen: false, + height: 'auto', width: 'auto', + modal: true, + buttons: { + "Update": aexpiry_submit, + "Remove Settings": aexpiry_remove, + "Close": function() { + $(this).dialog('close'); + } + }, + close: function() { $('#aexpiry_days').val('0'); } +}); + +$('#savestreamform').dialog({ + autoOpen: false, + height: 'auto', width: 'auto', + modal: true, + buttons: { + "Save": savestream_submit, + "Cancel": function() { + $(this).dialog('close'); + } + }, + close: function() { $('#savestream_name').val(''); } +}); + +$('#savestream_name').keyup(function(e) { + if (e.keyCode == $.ui.keyCode.ENTER) + savestream_submit(); +}); + +$('#bmpdialogue').dialog({ + autoOpen: false, + height: 'auto', width: 'auto', + modal: true, + buttons: { + "Close": function() { + $(this).dialog('close'); + } + }, + close: function() { $('#thmbmp').attr('src', 'about:blank'); } +}); + +// Create re-usable confirmation dialogue. +$confirm = $('#confirm').dialog({ + modal: true, autoOpen: false, + height: 160, width: 500, + show: 'fade', hide: 'fade', + draggable: false, resizable: false +}); + +// Load folder sizes +$.getJSON('/browse/sizes.jim', {dir: dir}, folder_size_callback); + +// Flag folders with unwatched items +$.getJSON('/browse/newdir.jim', {dir: dir}, new_folder_callback); + +// Load clipboard +reloadclipboard(); + +// Uncheck everything +$('input.fs:checked').prop('checked', false); + +// Buttons + +$('#dedup').button().click(function() { + window.location = '/dedup/dedup.jim?dir=' + + encodeURIComponent(dir); +}); + +$('#save_stream').button().click(function() { + $('#savestream_retrieving').show(); + $('#savestream_detail').text('').hide(); + $('#savestream_spin').hide(); + $('#savestream_name').val('').enable(); + + $('#savestreamform').dialog('open'); + $('#savestream_detail').load( + '/browse/ffmpeg.jim?file=' + + encodeURIComponent($('#save_stream').attr('file')), + function() { + $('#savestream_retrieving').hide(); + $('#savestream_detail').show(); + $('#savestream_form').show(); + }); +}); + +$('#selectall').click(function(e) { + e.preventDefault(); + $('input.fs').prop('checked', true).trigger('change'); +}); +$('#deselectall').click(function(e) { + e.preventDefault(); + $('input.fs:checked').prop('checked', false).trigger('change'); +}); + +$('#join').button().disable() + .click(function() { + var files = new Array(); + var els = $('input.fsts:checked + a').each(function() { + files.push($(this).attr('file')); + }); + //console.log("%o", files); + window.location.href = '/browse/join/join.jim?files=' + + files.join(); + }); + +$('#delete').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 str = 'Are you sure you want to delete ' + files.length + + ' file'; + if (files.length != 1) str += 's'; + str += '?'; + if (confirm(str)) + { disableall(); + $('#deletewait').slideDown('slow'); - window.location = '/play/play.jim?' + - 'dir=' + encodeURIComponent(dir) + - '&file=' + file; + $('#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( + '/browse/delete.jim', { + 'dir': dir, + 'files': files + }, function() { + $('#pwdialogue').dialog('close'); + blockpage(); + window.location.reload(true); + }); } + }); - // 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 = '/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'); +$('#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; - $('#renameform').dialog({ - autoOpen: false, + $.post('/browse/clipboard.jim', { + 'act': 'add', + 'dir': dir, + 'mode': action, + 'path': files + }, function() { + reloadclipboard(); + $('input.fs:checked').prop('checked', false); + }); + }); + +$('#newdir').button().click(function() { + $('#newdirform').dialog({ + autoOpen: true, height: 'auto', width: 'auto', modal: true, buttons: { - "Update": rename_submit, - "Close": function() { - $(this).dialog('close'); - } - }, - 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(''); } - }); - - $('#aexpiry').dialog({ - autoOpen: false, - height: 'auto', width: 'auto', - modal: true, - buttons: { - "Update": aexpiry_submit, - "Remove Settings": aexpiry_remove, - "Close": function() { - $(this).dialog('close'); - } - }, - close: function() { $('#aexpiry_days').val('0'); } - }); - - $('#savestreamform').dialog({ - autoOpen: false, - height: 'auto', width: 'auto', - modal: true, - buttons: { - "Save": savestream_submit, + "Create": newdir_submit, "Cancel": function() { $(this).dialog('close'); } }, - close: function() { $('#savestream_name').val(''); } + close: function() { $('#newdirname').val(''); } }); +}); - $('#savestream_name').keyup(function(e) { - if (e.keyCode == $.ui.keyCode.ENTER) - savestream_submit(); - }); +$('button.plugin').button().on('click', function() { + window.location.href = $(this).attr('act'); + return false; +}); - $('#bmpdialogue').dialog({ - autoOpen: false, - height: 'auto', width: 'auto', - modal: true, - buttons: { - "Close": function() { - $(this).dialog('close'); - } - }, - close: function() { $('#thmbmp').attr('src', 'about:blank'); } - }); +$('input.fs').change(function() { + var num = $('input.fs:checked').size(); + if (num > 0) + $('#delete,#cut,#copy').enable(); + else + $('#delete,#cut,#copy').disable(); - // Create re-usable confirmation dialogue. - $confirm = $('#confirm').dialog({ - modal: true, autoOpen: false, - height: 160, width: 500, - show: 'fade', hide: 'fade', - draggable: false, resizable: false - }); - - // Load folder sizes - $.getJSON('/browse/sizes.jim', {dir: dir}, folder_size_callback); - - // Flag folders with unwatched items - $.getJSON('/browse/newdir.jim', {dir: dir}, new_folder_callback); - - // Load clipboard - reloadclipboard(); - - // Uncheck everything - $('input.fs:checked').prop('checked', false); - - // Buttons - - $('#dedup').button().click(function() { - window.location = '/dedup/dedup.jim?dir=' - + encodeURIComponent(dir); - }); - - $('#save_stream').button().click(function() { - $('#savestream_retrieving').show(); - $('#savestream_detail').text('').hide(); - $('#savestream_spin').hide(); - $('#savestream_name').val('').enable(); - - $('#savestreamform').dialog('open'); - $('#savestream_detail').load( - '/browse/ffmpeg.jim?file=' + - encodeURIComponent($('#save_stream').attr('file')), - function() { - $('#savestream_retrieving').hide(); - $('#savestream_detail').show(); - $('#savestream_form').show(); - }); - }); - - $('#selectall').click(function(e) { - e.preventDefault(); - $('input.fs').prop('checked', true).trigger('change'); - }); - $('#deselectall').click(function(e) { - e.preventDefault(); - $('input.fs:checked').prop('checked', false).trigger('change'); - }); - - $('#join').button().disable() - .click(function() { - var files = new Array(); - var els = $('input.fsts:checked + a').each(function() { - files.push($(this).attr('file')); - }); - //console.log("%o", files); - window.location.href = '/browse/join/join.jim?files=' + - files.join(); - }); - - $('#delete').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 str = 'Are you sure you want to delete ' + files.length + - ' file'; - if (files.length != 1) str += 's'; - str += '?'; - if (confirm(str)) - { - disableall(); - $('#deletewait').slideDown('slow'); - - $('#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( - '/browse/delete.jim', { - 'dir': dir, - 'files': files - }, function() { - $('#pwdialogue').dialog('close'); - blockpage(); - 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('/browse/clipboard.jim', { - 'act': 'add', - 'dir': dir, - 'mode': action, - 'path': files - }, function() { - reloadclipboard(); - $('input.fs:checked').prop('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(''); } - }); - }); - - $('button.plugin').button().on('click', function() { - window.location.href = $(this).attr('act'); - return false; - }); - - $('input.fs').change(function() { - var num = $('input.fs:checked').size(); - if (num > 0) - $('#delete,#cut,#copy').enable(); - else - $('#delete,#cut,#copy').disable(); - - var num = $('input.fsts:checked').size(); - if (num > 1) - $('#join').enable(); - else - $('#join').disable(); - - }); - - var streamsize = 0; - - function checkstream() - { - $.get('/browse/streamsize.jim', function(size) { - //console.log('Stream size: %o', size); - var mb = size / (1024 * 1024); - mb = mb|0; - if (streamsize && size > streamsize) - { - rate = (size - streamsize) * 8.0 / - (3 * 1048576); - $('#streamstatus').text(mb + - ' MiB (growing @' + rate.toFixed(2) + - ' Mib/s)'); - } - else - $('#streamstatus').text(mb + ' MiB'); - streamsize = size; - }); - } - - if ($('#streamstatus').length) - setInterval(checkstream, 3000); + var num = $('input.fsts:checked').size(); + if (num > 1) + $('#join').enable(); + else + $('#join').disable(); + +}); + +var streamsize = 0; + +function checkstream() +{ + $.get('/browse/streamsize.jim', function(size) { + //console.log('Stream size: %o', size); + var mb = size / (1024 * 1024); + mb = mb|0; + if (streamsize && size > streamsize) + { + rate = (size - streamsize) * 8.0 / + (3 * 1048576); + $('#streamstatus').text(mb + + ' MiB (growing @' + rate.toFixed(2) + + ' Mib/s)'); + } + else + $('#streamstatus').text(mb + ' MiB'); + streamsize = size; + }); +} + +if ($('#streamstatus').length) + setInterval(checkstream, 3000); }); diff --git a/webif/html/browse/strip/strip.jim b/webif/html/browse/strip/strip.jim index 54a6723..9094404 100755 --- a/webif/html/browse/strip/strip.jim +++ b/webif/html/browse/strip/strip.jim @@ -46,13 +46,12 @@ Your original recording files will be retained in a folder called _original. + - -
" diff --git a/webif/html/browse/strip/strip.js b/webif/html/browse/strip/strip.js index 4524d68..2513e79 100755 --- a/webif/html/browse/strip/strip.js +++ b/webif/html/browse/strip/strip.js @@ -27,12 +27,13 @@ $('#analysis').load('analyse.jim?file=' + $('#params').attr('file'), $('#progressbar').reportprogress(0); $('#back').button().click(function() { - window.location = '../index.jim?dir=' + $('#params').attr('dir'); + window.location = '/go/browse?dir=' + $('#params').attr('dir'); }); $('#stripit').button().click(function() { $('#stripdiv').hide('slow'); $('#progressdiv').show('slow'); + $('#back').hide(); handle = setInterval("update()", 1000); $('#output').text('Please do not interrupt...') .load('execute.jim?file=' + $('#params').attr('file'), diff --git a/webif/html/browse/thumbnail/script.js b/webif/html/browse/thumbnail/script.js index e15117f..e033a51 100755 --- a/webif/html/browse/thumbnail/script.js +++ b/webif/html/browse/thumbnail/script.js @@ -8,7 +8,7 @@ $('button').button(); function go(pos) { - window.location.href = 'index.jim?file=' + + window.location.href = '/browse/thumbnail/?file=' + encodeURIComponent(file) + '&pos=' + pos; } @@ -26,7 +26,7 @@ $('#repos').disable().on('click', function(e) { $('#back').on('click', function(e) { e.preventDefault(); - window.location.href = '/browse/index.jim?dir=' + + window.location.href = '/go/browse?dir=' + encodeURIComponent(dir); }); @@ -34,22 +34,23 @@ $('button.usethm').disable().on('click', function(e) { e.preventDefault(); var pos = $(this).attr('pos'); $('button,input').disable(); - $.get('set.jim?file=' + encodeURIComponent(file) + '&pos=' + pos, + $.get('/browse/thumbnail/set.jim?file=' + + encodeURIComponent(file) + '&pos=' + pos, function() { - window.location.href = '/browse/index.jim?dir=' + + window.location.href = '/go/browse?dir=' + encodeURIComponent(dir); });; }); var start = $('#start').text(); var end = $('#end').text(); -$.get('mkrange.jim?file=' + encodeURIComponent(file) + +$.get('/browse/thumbnail/mkrange.jim?file=' + encodeURIComponent(file) + '&s=' + start + '&e=' + end, function() { $('img.bmp').each(function(i) { var pos = $(this).attr('pos'); $(this).attr('src', - 'fetch.jim?file=' + encodeURIComponent(file) + - '&pos=' + pos); + '/browse/thumbnail/fetch.jim?file=' + + encodeURIComponent(file) + '&pos=' + pos); }); $('button').enable(); }); diff --git a/webif/html/browse/tvdb/episode.js b/webif/html/browse/tvdb/episode.js index 3123682..7049f2e 100644 --- a/webif/html/browse/tvdb/episode.js +++ b/webif/html/browse/tvdb/episode.js @@ -18,14 +18,14 @@ $('button.select').button().on('click', function() { s: $tr.attr('s'), e: $tr.attr('e') }, function() { - window.location.href = '/browse/?dir=' + + window.location.href = '/go/browse/?dir=' + encodeURIComponent(dir); }); }); $('#tvdbepsearch').button({icons:{primary:"ui-icon-search"}}) .on('click', function() { - window.location.href = 'episode.jim?file=' + + window.location.href = '/browse/tvdb/episode.jim?file=' + encodeURIComponent(file) + '&search=' + encodeURIComponent($('#searchterm').val()); }); diff --git a/webif/html/browse/tvdb/script.js b/webif/html/browse/tvdb/script.js index 9bd0538..1da72cb 100644 --- a/webif/html/browse/tvdb/script.js +++ b/webif/html/browse/tvdb/script.js @@ -9,7 +9,7 @@ function select_episode() $('#tvdbresults_saving').show(); $('#tvdbresults').diagrefresh(); - $.get('tvdb/store.jim', { dir: dir, sid: sid }, function(data) { + $.get('/browse/tvdb/store.jim', { dir: dir, sid: sid }, function(data) { if (data <= 0) { window.location.reload(true); @@ -24,7 +24,7 @@ function select_episode() $('.tvdbresults').hide(); $('#tvdbresults_saving').show(); $('#tvdbresults').diagrefresh(); - $.get('tvdb/store.jim', { + $.get('/browse/tvdb/store.jim', { dir: dir, sid: sid, series: $('#tvdb_forceseries').val() @@ -70,7 +70,7 @@ $('#tvdbsetseries').button().on('click', function(e) { } } }); - $('#tvdbresults_inner').load('tvdb/search.jim', + $('#tvdbresults_inner').load('/browse/tvdb/search.jim', { term: $('#tvdbsearch').val() }, function() { $('#tvdbresults_inner') .find('.tvdbselect') @@ -93,7 +93,7 @@ $('#tvdbsetseries').button().on('click', function(e) { 'this folder?')) return; blockpage('Clearing Series Information...'); - $.get('tvdb/store.jim', {dir: dir, sid: 0}, + $.get('/browse/tvdb/store.jim', {dir: dir, sid: 0}, function() { window.location.reload(true); }); diff --git a/webif/html/go b/webif/html/go new file mode 100755 index 0000000..7be8bf2 --- /dev/null +++ b/webif/html/go @@ -0,0 +1,91 @@ +#!/mod/bin/jimsh + +source /mod/webif/lib/setup +require system.class settings.class plugin + +set module [file tail $env(PATH_INFO)] +set lastmodule "" +if {[dict exists $env HTTP_COOKIE]} { + regexp {webif_lastmod=([a-z_]+)} $env(HTTP_COOKIE) x lastmodule +} + +set settings [settings] + +if {[$settings epg_style] eq "grid"} { + set epglink "/cgi-bin/xepg.jim" +} else { + set epglink "/epg/list.jim" +} + +set pages { + "browse" "/browse/" + "schedule" "/sched/" + "mobile" "/m/" + "service" "/services/" + "pkg" "/pkg/" + "diag" "/diag/diag.jim" + "settings" "/settings/settings.jim" +} +set pages(epg) $epglink + +set modules {} +foreach {page link} $pages { + set modules($page) [list $link 50] + set modules(mm_$page) [list $link 50] +} + +proc register_module {module url {priority 75}} { + global modules + + if {$module ni $modules} { + # New module + set modules($module) [list $url $priority] + return + } + lassign $modules($module) x pri + if {$priority > $pri} { + set modules($module) [list $url $priority] + } +} + +proc override_module {module} { + set ::module $module +} + +if {$module eq "debug"} { + httpheader + puts "

Parameters

" + puts "
"
+	puts "MODULE: $module"
+	puts "LASTMOD: $lastmodule"
+	puts "
" + puts "

Modules

" + puts "
"
+	parray modules
+	puts "
" +} + +eval_plugins go 1 + +if {$module eq "debug"} { + puts "

After plugins

" + puts "
"
+	parray modules
+	parray env
+	puts "
" + exit +} + +if {$module ni $modules} { + httpheader + puts "Error, module '$module' not found." + exit +} + +lassign $modules($module) url +if [dict exists $env QUERY_STRING] { + append url "?$env(QUERY_STRING)" +} + +httpredirect $url "Set-Cookie: webif_lastmod=$module" + diff --git a/webif/include/epgloc.jim b/webif/include/epgloc.jim deleted file mode 100755 index 0ece0a4..0000000 --- a/webif/include/epgloc.jim +++ /dev/null @@ -1,11 +0,0 @@ -#!/mod/bin/jimsh - -source /mod/webif/lib/setup -require settings.class - -if {[[settings] epg_style] eq "grid"} { - puts -nonewline "/cgi-bin/xepg.jim" -} else { - puts -nonewline "/epg/list.jim" -} - diff --git a/webif/include/menuicons.jim b/webif/include/menuicons.jim index 71f4140..3643b0e 100755 --- a/webif/include/menuicons.jim +++ b/webif/include/menuicons.jim @@ -36,38 +36,32 @@ proc menuitem {title icon link {width 217} {height 0} {extra ""}} {{num 0}} { set settings [settings] -if {[$settings epg_style] eq "grid"} { - set epglink "/cgi-bin/xepg.jim" -} else { - set epglink "/epg/list.jim" -} - puts {
} menuitem "Browse Media Files" "/images/323_1_10_Menu_Video.png" \ - /browse/index.jim 217 228 + /go/mm_browse menuitem "Scheduled Events" "/images/321_1_00_Menu_CHList.png" \ - /sched/index.jim 217 228 + /go/mm_schedule menuitem "EPG" "/images/328_1_26_Menu_TV_Guide.png" \ - $epglink 217 228 + /go/mm_epg 217 228 if {[file exists "/mod/bin/ir"]} { menuitem "Remote" "/img/remote.png" /plugin/ir/remote.jim 217 228 } -if {[[settings] nomobile] eq "0"} { - menuitem "Mobile Version" "/img/mobile.png" /m/ 217 228 +if {[$settings nomobile] eq "0"} { + menuitem "Mobile Version" "/img/mobile.png" /go/mm_mobile 217 228 } menuitem "Service Management" "/img/spanner.png" \ - /services/index.jim 217 228 + /go/mm_service 217 228 menuitem "Package Management" "/img/packages.png" \ - /pkg/index.jim 217 228 + /go/mm_pkg 217 228 menuitem "Settings" "/images/326_1_00_Menu_Settings.png" \ - /settings/settings.jim 217 228 + /go/mm_settings 217 228 menuitem "Diagnostics" "/img/diagnostics.png" \ - /diag/diag.jim 217 228 + /go/mm_diag 217 228 eval_plugins menu @@ -85,7 +79,6 @@ puts { } - if {[$settings nohelplinks] == 0} { menuitem "-reset" "" "" diff --git a/webif/include/toolbar.jim b/webif/include/toolbar.jim index 8e7226f..3313405 100755 --- a/webif/include/toolbar.jim +++ b/webif/include/toolbar.jim @@ -1,16 +1,11 @@ #!/mod/bin/jimsh require settings.class + if {[[settings] notoolbar] eq "0"} { require plugin system.class -if {[[settings] epg_style] eq "grid"} { - set epglink "/cgi-bin/xepg.jim" -} else { - set epglink "/epg/list.jim" -} - proc tb {icon txt link {height 50} {width 0}} { if {$width > 0} { set width " width=$width" @@ -37,13 +32,13 @@ puts { if {[file exists "/mod/bin/ir"]} { tb "/img/remote.png" "Remote" "/plugin/ir/remote.jim" } -tb "/images/323_1_10_Menu_Video.png" "Browse" "/browse/index.jim" -tb "/images/321_1_00_Menu_CHList.png" "Schedule" "/sched/index.jim" -tb "/images/328_1_26_Menu_TV_Guide.png" "EPG" $epglink -tb "/img/spanner.png" "Services" "/services/index.jim" -tb "/img/packages.png" "Packages" "/pkg/index.jim" -tb "/images/326_1_00_Menu_Settings.png" "Settings" "/settings/settings.jim" -tb "/img/diagnostics.png" "Diag" "/diag/diag.jim" +tb "/images/323_1_10_Menu_Video.png" "Browse" "/go/mm_browse" +tb "/images/321_1_00_Menu_CHList.png" "Schedule" "/go/mm_schedule" +tb "/images/328_1_26_Menu_TV_Guide.png" "EPG" "/go/mm_epg" +tb "/img/spanner.png" "Services" "/go/mm_service" +tb "/img/packages.png" "Packages" "/go/mm_pkg" +tb "/images/326_1_00_Menu_Settings.png" "Settings" "/go/mm_settings" +tb "/img/diagnostics.png" "Diag" "/go/mm_diag" eval_plugins toolbar puts { diff --git a/webif/lib/browse.class b/webif/lib/browse.class index df0909a..3453eac 100644 --- a/webif/lib/browse.class +++ b/webif/lib/browse.class @@ -179,7 +179,7 @@ proc {browse breadcrumb} {dir} { foreach part [split $dir /] { if {$stub eq "/"} { set name $part } else { set name "/$part" } append stub $name - puts "$name" + puts "$name" } } diff --git a/webif/lib/epg_search b/webif/lib/epg_search index 7717374..cc810fd 100755 --- a/webif/lib/epg_search +++ b/webif/lib/epg_search @@ -57,12 +57,7 @@ cts 10 "Leisure" "Leisure" puts "" -if {[[settings] epg_style] eq "grid"} { - puts "" -} else { - puts "" -} -puts "Now/Next" +puts "Now/Next" puts "" diff --git a/webif/lib/setup b/webif/lib/setup index 0e5571f..79e768b 100644 --- a/webif/lib/setup +++ b/webif/lib/setup @@ -9,8 +9,11 @@ if {![exists -proc require]} { } } - proc httpredirect {url} { + proc httpredirect {url {extra ""}} { puts -nonewline "Location: $url\r\n" + if {$extra ne ""} { + puts -nonewline "$extra\r\n" + } puts -nonewline "\r\n" puts "Redirecting to $url" exit diff --git a/webif/lib/system.class b/webif/lib/system.class index f3d4ee0..37f29b1 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -299,6 +299,17 @@ proc {system disk} {} { return [string range [system diskdev] 0 end-1] } +proc {system disktemp} {} { + if {[catch { + set smart [exec /mod/bin/smartctl -f brief -A [system disk] \ + | grep ^194] + regexp {K *([0-9]+)} $smart x temp + }]} { + set temp 0 + } + return $($temp + 0) +} + require pretty_size proc {system diskspace} {{raw 0}} {