checkpoint

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2590 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2016-02-06 00:13:44 +00:00
parent 4886a5f191
commit 971d074f3c
30 changed files with 511 additions and 433 deletions

View File

@ -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/

View File

@ -35,13 +35,12 @@ puts "
<div id=audiodiv style=\"padding: 1em\">
<button id=audioit>Perform audio extraction - $type</button>
</div>
<button id=back>Back to media list</button>
<div id=progressdiv class=hidden>
Extracting audio: <div id=progressbar></div>
</div>
<button id=back class=hidden>Back to media list</button>
<div id=output class=pre style=\"margin-top: 10px\"></div>
</fieldset>

View File

@ -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() {

View File

@ -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()

View File

@ -53,12 +53,9 @@ puts "
<div id=chunkdiv style=\"padding: 1em\">
<button id=chunkit>Split recording into $part parts</button>
</div>
<div id=findiv style=\"padding: 1em\" class=hidden>
<button id=back dir=\"[cgi_quote_url [file dirname $rfile]]\">
Back to Media Browser
</button>
</div>
</fieldset>
"

View File

@ -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;
});
});

View File

@ -101,13 +101,12 @@ puts "
<button id=invert invert=$invert>Invert selection</button>
<button id=cropit>Perform crop operation</button>
</div>
<button id=back>Back to media list</button>
<div id=progressdiv class=hidden>
Cropping: <div id=progressbar></div>
</div>
<button id=back>Back to media list</button>
<div id=output class=\"hidden pre\" style=\"margin-top: 10px\"></div>
</fieldset>

View File

@ -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') +

View File

@ -52,12 +52,12 @@ puts "
<div id=decryptdiv style=\"padding: 1em\">
<button id=decryptit>Perform decryption</button>
</div>
<button id=back>Back to media list</button>
<div id=progressdiv class=hidden>
Decrypting: <div id=progressbar></div>
</div>
<button id=back class=hidden>Back to media list</button>
<div id=output class=pre style=\"margin-top: 10px\"></div>
</fieldset>

View File

@ -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() {

View File

@ -31,7 +31,7 @@ if {$type eq "ts"} {
<td class=va>
"
if {[file exists "[file rootname $file].thm"]} {
puts "<img class=\"bmp va\" src=\"bmp.jim?file=$file\">"
puts "<img class=\"bmp va\" src=\"/browse/bmp.jim?file=$file\">"
}
if {[dict exists $idata thumb]} {

View File

@ -249,10 +249,12 @@ if {[system model] eq "HDR" && ![system param DMS_START_ON]} {
#}
puts "
<span style=\"display:none\" id=dir>$dir</span>
<span style=\"display:none\" id=mediaroot>$mroot</span>
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
<script type=text/javascript>
var dir = '[string map {' {\'}} $dir]';
var mediaroot = '$mroot';
</script>
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
"
browse breadcrumb $dir

View File

@ -45,13 +45,12 @@ Name for joined file:
length=20 maxlength=50>
<button id=dojoin>Join</button>
</div>
<button id=back
dir=\"[cgi_quote_url $dir]\"
esize=\"$esize\">Back to media list</button>
<div id=progressdiv style=\"display: none\">
Joining: <div id=progressbar></div>
<button id=back
dir=\"[cgi_quote_url $dir]\"
esize=\"$esize\"
style=\"display: none\">Back to media list</button>
<div id=output class=pre style=\"margin-top: 10px\"></div>
</div>
"

View File

@ -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...')

View File

@ -32,13 +32,12 @@ puts "
<div id=mpgdiv style=\"padding: 1em\">
<button id=mpgit>Perform mpg extraction</button>
</div>
<button id=back>Back to media list</button>
<div id=progressdiv class=hidden>
Extracting mpg: <div id=progressbar></div>
</div>
<button id=back class=hidden>Back to media list</button>
<div id=output class=pre style=\"margin-top: 10px\"></div>
</fieldset>

View File

@ -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() {

View File

@ -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(
'<img src="/img/loading.gif">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(
'<img src="/img/loading.gif">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);
});

View File

@ -46,13 +46,12 @@ Your original recording files will be retained in a folder called _original.
<div id=stripdiv class=hidden style=\"padding: 1em\">
<button id=stripit>Shrink recording</button>
</div>
<button id=back>Back to media list</button>
<div id=progressdiv class=hidden>
Shrinking: <div id=progressbar></div>
</div>
<button id=back class=hidden>Back to media list</button>
<div id=output class=pre style=\"margin-top: 10px\"></div>
</fieldset>
"

View File

@ -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'),

View File

@ -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();
});

View File

@ -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());
});

View File

@ -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);
});

91
webif/html/go Executable file
View File

@ -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 "<h3>Parameters</h3>"
puts "<pre>"
puts "MODULE: $module"
puts "LASTMOD: $lastmodule"
puts "</pre>"
puts "<h3>Modules</h3>"
puts "<pre>"
parray modules
puts "</pre>"
}
eval_plugins go 1
if {$module eq "debug"} {
puts "<h3>After plugins</h3>"
puts "<pre>"
parray modules
parray env
puts "</pre>"
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"

View File

@ -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"
}

View File

@ -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 {<div style="clear: both">}
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" "" ""

View File

@ -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 {

View File

@ -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 "<a href=\"/browse/?dir=[cgi_quote_url $stub]\">$name</a>"
puts "<a href=\"/go/browse?dir=[cgi_quote_url $stub]\">$name</a>"
}
}

View File

@ -57,12 +57,7 @@ cts 10 "Leisure" "Leisure"
puts "</td><td>"
if {[[settings] epg_style] eq "grid"} {
puts "<a href=/cgi-bin/xepg.jim>"
} else {
puts "<a href=/epg/list.jim>"
}
puts "Now/Next</a>"
puts "<a href=/go/epg>Now/Next</a>"
puts "</td></tr><tr><td>"

View File

@ -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

View File

@ -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}} {