Compare commits
14 Commits
0.8.8
...
0.8.10@214
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
337a2add7a | ||
|
|
4706fe6bcd | ||
|
|
88d78a7d42 | ||
|
|
b442fef333 | ||
|
|
f771f55017 | ||
|
|
267ba4fade | ||
|
|
c2ec779465 | ||
|
|
75b31696c5 | ||
|
|
f54d162298 | ||
|
|
2a0bcbc81e | ||
|
|
4d3183ea61 | ||
|
|
7c038a1776 | ||
|
|
822de81971 | ||
|
|
09e71400a2 |
@@ -1,9 +1,9 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 0.8.8-1
|
||||
Version: 0.8.10
|
||||
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.2),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.3),ssmtp,anacron
|
||||
Suggests: ffmpeg,webif-iphone,nicesplice,id3v2
|
||||
Description: An evolving web interface for the Humax.
|
||||
|
||||
@@ -196,134 +196,21 @@ header
|
||||
puts {
|
||||
<link href=/css/jquery.contextMenu.css rel=stylesheet type=text/css />
|
||||
<script type="text/javascript" src="/js/jquery.contextMenu.js"></script>
|
||||
|
||||
<ul id=optmenu class=contextMenu>
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<li><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#enc>Toggle Enc</a></li>
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
<li><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
}
|
||||
if {[system model] eq "HDR"} {
|
||||
puts { <li class="separator"><a href=#decrypt>Decrypt</a></li> }
|
||||
}
|
||||
if {[system pkginst ffmpeg]} {
|
||||
puts { <li><a href=#audio>Extract Audio</a></li> }
|
||||
}
|
||||
if $nicesplice {
|
||||
puts { <li class="cut separator"><a href=#crop>Crop</a></li> }
|
||||
}
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
<ul id=doptmenu class=contextMenu>
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<li><a href=#rename>Rename</a></li>
|
||||
}
|
||||
|
||||
if $flatten {
|
||||
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
|
||||
}
|
||||
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
<div id=renameform title="Rename media file" style="display: none">
|
||||
<form id=renameform_form>
|
||||
<input type=hidden name="renameorig" id="renameorig" value="">
|
||||
<input type=hidden name="titleorig" id="titleorig" value="">
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="rename">
|
||||
<b>New Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename" id="rename"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="renametitle" style="padding-top: 0.5em">
|
||||
<b>New Medialist Title</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="renametitle" id="renametitle"
|
||||
value="" size=70 maxlength=48
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none" class=tstype>
|
||||
<td colspan=2 id=synopsis style="font-style: italic"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
<form id=savestream_form>
|
||||
}
|
||||
puts "<input type=hidden name=dir value=\"$dir\">"
|
||||
puts {
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="savestream_name">
|
||||
<b>Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="savestream_name"
|
||||
id="savestream_name"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
<img id=savestream_spin src=/img/loading.gif>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=dialogue></div>
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
|
||||
<link href=/css/jquery.bar.css rel=stylesheet type=text/css />
|
||||
<script type="text/javascript" src="/js/jquery.bar.js"></script>
|
||||
<script type=text/javascript src=/cgi-bin/browse/browse.js></script>
|
||||
<link type=text/css rel=stylesheet href=/cgi-bin/browse/style.css />
|
||||
}
|
||||
|
||||
puts "<span style=\"display:none\" id=dir>$dir</span>"
|
||||
source /mod/var/mongoose/cgi-bin/browse/assets.jim
|
||||
|
||||
# Breadcrumb path
|
||||
puts "
|
||||
<fieldset style=\"margin: 1em\">
|
||||
<span style=\"display:none\" id=dir>$dir</span>
|
||||
<fieldset class=cleft style=\"margin: 0 1em 1em 1em\">
|
||||
<legend style=\"font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em;\">
|
||||
"
|
||||
|
||||
# Breadcrumb path
|
||||
set stub ""
|
||||
foreach part [split $dir /] {
|
||||
if {$stub eq "/"} { set name $part } else { set name "/$part" }
|
||||
@@ -406,10 +293,25 @@ puts "</div>"
|
||||
|
||||
puts "</fieldset>"
|
||||
|
||||
puts {
|
||||
<fieldset class=left style="margin: 0 1em 1em 1em">
|
||||
<legend style="font-size: 1.5em; padding: 0 0.5em 0.5em 0.5em; color: #1e5bbd;">
|
||||
File Clipboard
|
||||
</legend>
|
||||
<div id=clipboard>
|
||||
<img src=/img/loading.gif> <i>Loading...</i>
|
||||
</div>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
puts "<div class=brow>"
|
||||
|
||||
puts {
|
||||
<button id=copy>Copy</button>
|
||||
<button id=cut>Cut</button>
|
||||
<button id=paste>Paste</button>
|
||||
<button id=delete>Delete</button>
|
||||
<button id=newdir>New Folder</button>
|
||||
<div id=deletewait class=blood style="display: none">
|
||||
<img src=/img/loading.gif>Deleting may take some time, please be patient...
|
||||
</div>
|
||||
|
||||
161
var/mongoose/cgi-bin/browse/assets.jim
Executable file
161
var/mongoose/cgi-bin/browse/assets.jim
Executable file
@@ -0,0 +1,161 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
puts {
|
||||
|
||||
<div id=jbar></div>
|
||||
|
||||
<ul id=optmenu class=contextMenu style="width: 160px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<li class=cut><a href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
|
||||
|
||||
<li class=separator><a href=#rename>Rename</a></li>
|
||||
<li><a href=#download>Download</a></li>
|
||||
|
||||
}
|
||||
if {[system model] eq "HDR"} {
|
||||
puts { <li class="separator"><a href=#decrypt>Decrypt</a></li> }
|
||||
}
|
||||
if {[system pkginst ffmpeg]} {
|
||||
puts { <li><a href=#audio>Extract Audio</a></li> }
|
||||
}
|
||||
if $nicesplice {
|
||||
puts { <li class="cut"><a href=#crop>Crop</a></li> }
|
||||
}
|
||||
puts {
|
||||
<li class=separator><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#enc>Toggle Enc</a></li>
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
</ul>
|
||||
|
||||
<ul id=doptmenu class=contextMenu style="width: 160px">
|
||||
<li class=delete><a href=#delete>Delete</a></li>
|
||||
<li class=cut><a href=#cut>Cut to clipboard</a></li>
|
||||
<li class=pwcopy><a href=#copy>Copy to clipboard</a></li>
|
||||
<li class=separator><a href=#rename>Rename</a></li>
|
||||
}
|
||||
|
||||
if $flatten {
|
||||
puts { <li class="separator"><a href=#flat>No-Flatten</a></li> }
|
||||
}
|
||||
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
<div id=renameform title="Rename media file" style="display: none">
|
||||
<form id=renameform_form>
|
||||
<input type=hidden name="renameorig" id="renameorig" value="">
|
||||
<input type=hidden name="titleorig" id="titleorig" value="">
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="rename">
|
||||
<b>New Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="rename" id="rename"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none" class=tstype>
|
||||
<th>
|
||||
<label for="renametitle" style="padding-top: 0.5em">
|
||||
<b>New Medialist Title</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="renametitle" id="renametitle"
|
||||
value="" size=70 maxlength=48
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display: none" class=tstype>
|
||||
<td colspan=2 id=synopsis style="font-style: italic"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</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>
|
||||
<form id=savestream_form>
|
||||
}
|
||||
puts "<input type=hidden name=dir value=\"$dir\">"
|
||||
puts {
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="savestream_name">
|
||||
<b>Filename</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="savestream_name"
|
||||
id="savestream_name"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
<img id=savestream_spin src=/img/loading.gif>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=newdirform title="New Folder" style="display: none">
|
||||
<form id=newdirform_form>
|
||||
}
|
||||
puts "<input type=hidden name=dir value=\"$dir\">"
|
||||
puts {
|
||||
<table border=0>
|
||||
<tr>
|
||||
<th>
|
||||
<label for="newdirname">
|
||||
<b>New Folder Name</b>
|
||||
</label>
|
||||
</th>
|
||||
<td>
|
||||
<input type=text name="newdirname" id="newdirname"
|
||||
value="" size=70 maxlength=255
|
||||
class="text ui-widget-content ui-corner-all">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id=dialogue></div>
|
||||
<div id=confirm title="Confirmation Required"></div>
|
||||
<div id=pwdialogue style="display: none">
|
||||
<center>
|
||||
<img src=/img/loading.gif>
|
||||
<br><br>
|
||||
Please wait...
|
||||
<div id=pwfeedback></div>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,38 @@ function disableall()
|
||||
$('button,a,input').disable();
|
||||
}
|
||||
|
||||
function reloadclipboard()
|
||||
{
|
||||
$('#clipboard')
|
||||
.empty()
|
||||
.html('<img src=/img/loading.gif> <i>Loading...</i>')
|
||||
.load('/cgi-bin/browse/clipboard.jim', function() {
|
||||
|
||||
// Start Clipboard post-load actions
|
||||
|
||||
if ($('#clipclear').length)
|
||||
$('#paste').enable();
|
||||
else
|
||||
$('#paste').disable();
|
||||
|
||||
$('#clipclear').button().click(function() {
|
||||
$.get('/cgi-bin/browse/clipboard.jim?act=clear', function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
});
|
||||
|
||||
$('a.clipdel').click(function() {
|
||||
$.get('/cgi-bin/browse/clipboard.jim?act=remove&path=' +
|
||||
$(this).attr('path'), function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
});
|
||||
|
||||
// End Clipboard post-load actions
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function epginfo_callback(data, status, xhr)
|
||||
{
|
||||
var width = 85;
|
||||
@@ -123,6 +155,13 @@ function drename_submit()
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function newdir_submit()
|
||||
{
|
||||
var s = $('#newdirform_form').serialize();
|
||||
$.get('/cgi-bin/browse/mknewdir.jim?' + s,
|
||||
function() { window.location.reload(true); });
|
||||
}
|
||||
|
||||
function savestream_submit()
|
||||
{
|
||||
var s = $('#savestream_form').serialize();
|
||||
@@ -159,7 +198,7 @@ function preparemenu(el, menu)
|
||||
{
|
||||
if (el.attr('def') == 'HD')
|
||||
{
|
||||
$('#optmenu').enableContextMenuItems('#enc');
|
||||
$(menu).enableContextMenuItems('#enc');
|
||||
if (el.attr('encd') == 1)
|
||||
$(menu).changeContextMenuItem('#enc',
|
||||
'Remove Enc');
|
||||
@@ -169,51 +208,52 @@ function preparemenu(el, menu)
|
||||
}
|
||||
|
||||
if (el.attr('bx') > 0)
|
||||
$('#optmenu').enableContextMenuItems('#crop');
|
||||
$(menu).enableContextMenuItems('#crop');
|
||||
else
|
||||
$('#optmenu').disableContextMenuItems('#crop');
|
||||
$(menu).disableContextMenuItems('#crop');
|
||||
|
||||
$('#optmenu').enableContextMenuItems('#new');
|
||||
$(menu).enableContextMenuItems('#new');
|
||||
if (el.attr('new') == 1)
|
||||
$(menu).changeContextMenuItem('#new', 'Mark watched');
|
||||
else
|
||||
$(menu).changeContextMenuItem('#new', 'Mark new');
|
||||
|
||||
|
||||
$('#optmenu').enableContextMenuItems('#lock');
|
||||
$(menu).enableContextMenuItems('#lock');
|
||||
if (el.attr('locked') == 1)
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Unlock');
|
||||
$('#optmenu').disableContextMenuItems('#delete');
|
||||
$(menu).disableContextMenuItems('#delete');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(menu).changeContextMenuItem('#lock', 'Lock');
|
||||
$('#optmenu').enableContextMenuItems('#delete');
|
||||
$(menu).enableContextMenuItems('#delete');
|
||||
}
|
||||
|
||||
if (el.attr('odencd') == 1)
|
||||
{
|
||||
$('#optmenu').enableContextMenuItems('#decrypt');
|
||||
$('#optmenu').disableContextMenuItems('#audio');
|
||||
$(menu).enableContextMenuItems('#decrypt');
|
||||
$(menu).disableContextMenuItems('#audio');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#optmenu').disableContextMenuItems('#decrypt');
|
||||
$('#optmenu').enableContextMenuItems('#audio');
|
||||
$(menu).disableContextMenuItems('#decrypt');
|
||||
$(menu).enableContextMenuItems('#audio');
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#optmenu').enableContextMenuItems('#delete');
|
||||
$('#optmenu').disableContextMenuItems('#lock');
|
||||
$('#optmenu').disableContextMenuItems('#enc');
|
||||
$('#optmenu').disableContextMenuItems('#new');
|
||||
$('#optmenu').disableContextMenuItems('#decrypt');
|
||||
$('#optmenu').disableContextMenuItems('#audio');
|
||||
$('#optmenu').disableContextMenuItems('#crop');
|
||||
$(menu).enableContextMenuItems('#delete');
|
||||
$(menu).disableContextMenuItems('#lock');
|
||||
$(menu).disableContextMenuItems('#enc');
|
||||
$(menu).disableContextMenuItems('#new');
|
||||
$(menu).disableContextMenuItems('#decrypt');
|
||||
$(menu).disableContextMenuItems('#audio');
|
||||
$(menu).disableContextMenuItems('#crop');
|
||||
}
|
||||
$(menu).disableContextMenuItems('#delete');
|
||||
|
||||
}
|
||||
|
||||
@@ -227,6 +267,7 @@ function preparedmenu(el, menu)
|
||||
$(menu).changeContextMenuItem('#flat',
|
||||
'Prevent Flatten');
|
||||
}
|
||||
$(menu).disableContextMenuItems('#delete');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@@ -245,6 +286,17 @@ var menuclick = function(action, el, pos)
|
||||
type, id);
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (!confirm('Are you sure? Copying recordings takes a long time!'))
|
||||
break;
|
||||
// Fallthrough
|
||||
case 'cut':
|
||||
$.get('/cgi-bin/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + file, function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'lock':
|
||||
confirm_action('change the lock on', lock_callback,
|
||||
file, type, id);
|
||||
@@ -334,6 +386,17 @@ var dmenuclick = function(action, el, pos)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'copy':
|
||||
if (!confirm('Are you sure? Copying directories can take a very long time!'))
|
||||
break;
|
||||
// Fallthrough
|
||||
case 'cut':
|
||||
$.get('/cgi-bin/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + file, function() {
|
||||
reloadclipboard();
|
||||
});
|
||||
break;
|
||||
|
||||
case 'rename':
|
||||
$('#drename').val(decodeURIComponent(bfile));
|
||||
$('#drenameorig').val(decodeURIComponent(file));
|
||||
@@ -457,6 +520,9 @@ var dmenuclick = function(action, el, pos)
|
||||
$.getJSON('/cgi-bin/browse/newdir.jim?dir=' + encodeURIComponent(dir),
|
||||
new_folder_callback);
|
||||
|
||||
// Load clipboard
|
||||
reloadclipboard();
|
||||
|
||||
// Uncheck everything
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
|
||||
@@ -510,19 +576,90 @@ var dmenuclick = function(action, el, pos)
|
||||
{
|
||||
disableall();
|
||||
$('#deletewait').slideDown('slow');
|
||||
window.location.href =
|
||||
|
||||
$('#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(
|
||||
'/cgi-bin/browse/mdelete.jim?dir=' +
|
||||
encodeURIComponent(dir) + '&files=' +
|
||||
files.join();
|
||||
files.join(), function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
window.location.reload(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#copy,#cut').button().disable()
|
||||
.click(function() {
|
||||
var files = new Array();
|
||||
var els = $('input.fs:checked + a').each(function() {
|
||||
files.push($(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;
|
||||
$.get('/cgi-bin/browse/clipboard.jim?act=add&mode=' + action +
|
||||
'&path=' + files.join(), function() {
|
||||
reloadclipboard();
|
||||
$('input.fs:checked').attr('checked', false);
|
||||
});
|
||||
});
|
||||
|
||||
$('#paste').button().disable()
|
||||
.click(function() {
|
||||
disableall();
|
||||
$('#pwdialogue').dialog({
|
||||
title: "Pasting from clipboard",
|
||||
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(
|
||||
'/cgi-bin/browse/clipboard.jim?act=paste&dir='
|
||||
+ encodeURIComponent(dir), function() {
|
||||
$('#pwdialogue').dialog('close');
|
||||
window.location.reload(true);
|
||||
});
|
||||
});
|
||||
|
||||
$('#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(''); }
|
||||
});
|
||||
});
|
||||
|
||||
$('input.fs').change(function() {
|
||||
var num = $('input.fs:checked').size();
|
||||
if (num > 0)
|
||||
$('#delete').enable();
|
||||
$('#delete,#cut,#copy').enable();
|
||||
else
|
||||
$('#delete').disable();
|
||||
$('#delete,#cut,#copy').disable();
|
||||
|
||||
$('#delete').disable();
|
||||
|
||||
var num = $('input.fsts:checked').size();
|
||||
if (num > 1)
|
||||
|
||||
111
var/mongoose/cgi-bin/browse/clipboard.jim
Executable file
111
var/mongoose/cgi-bin/browse/clipboard.jim
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
source /mod/var/mongoose/lib/setup
|
||||
require clipboard.class ts.class chunked
|
||||
|
||||
start_chunked "text/html; no-cache\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nPragma: nocache"
|
||||
|
||||
cgi_input 1
|
||||
#cgi_dump
|
||||
|
||||
set cb [[clipboard new {path "/tmp/webif-browse.cb"}] load]
|
||||
|
||||
set action [cgi_get act list]
|
||||
|
||||
switch $action {
|
||||
list {
|
||||
if {![$cb size]} {
|
||||
chunk "<i>Clipboard is empty</i>"
|
||||
break
|
||||
}
|
||||
chunk "<div class=cliplist>"
|
||||
foreach file [$cb get items] {
|
||||
set img "page_white_copy"
|
||||
if {[$file get action] eq "cut"} {
|
||||
set img "cut"
|
||||
}
|
||||
set path [$file get path]
|
||||
set xpath [cgi_quote_html $path]
|
||||
chunk "<span title=\"$xpath\" alt=\"$xpath\">"
|
||||
chunk "<img src=/img/context/$img.png>"
|
||||
set dfile [file tail $path]
|
||||
if {[string length $dfile] > 25} {
|
||||
set dfile "[string range $dfile 0 22]..."
|
||||
}
|
||||
if {[file isdirectory $path]} {
|
||||
chunk "<img height=16
|
||||
src=/images/711_1_09_Media_Folder.png>"
|
||||
}
|
||||
chunk [cgi_quote_html $dfile]
|
||||
chunk "<a class=clipdel href=# alt=\"Remove\" title=\"Remove\"
|
||||
path=\"[cgi_quote_url $path]\">
|
||||
<img border=0 src=/img/close.png height=16></a>"
|
||||
chunk "</span>"
|
||||
}
|
||||
chunk "</div>"
|
||||
chunk "<button id=clipclear>Empty clipboard</button>"
|
||||
}
|
||||
add {
|
||||
if {[set path [cgi_get path]] eq "0"} {
|
||||
puts "No path."
|
||||
exit
|
||||
}
|
||||
set mode [cgi_get mode copy]
|
||||
foreach p [split $path ","] {
|
||||
set p [cgi_unquote_input $p]
|
||||
if {![$cb present $p]} {
|
||||
$cb add $mode $p
|
||||
chunk "Added $p for $mode<br>"
|
||||
}
|
||||
}
|
||||
$cb save
|
||||
}
|
||||
remove {
|
||||
$cb remove [cgi_unquote_input [cgi_get path]]
|
||||
$cb save
|
||||
}
|
||||
clear {
|
||||
$cb clear
|
||||
$cb save
|
||||
}
|
||||
paste {
|
||||
set dir [cgi_unquote_input [cgi_get dir]]
|
||||
foreach item [$cb get items] {
|
||||
set path [$item get path]
|
||||
set file [file tail $path]
|
||||
set mode [$item get action]
|
||||
|
||||
chunk "Pasting $file"
|
||||
chunk_pad
|
||||
|
||||
if {[file isdirectory $path]} {
|
||||
# Directory
|
||||
if {$mode eq "cut"} {
|
||||
file rename $path "$dir/$file"
|
||||
} else {
|
||||
chunk [exec /mod/bin/busybox/cp -r \
|
||||
$path $dir]
|
||||
}
|
||||
} else {
|
||||
set root [file rootname $path]
|
||||
# Protect special characters in root.
|
||||
# In particular [] characters which are used a lot
|
||||
# for torrent names.
|
||||
regsub -all {([\\["$])} $root {\\\1} root
|
||||
foreach f [glob -nocomplain "${root}.*"] {
|
||||
if {$mode eq "cut"} {
|
||||
file rename $f "$dir/[file tail $f]"
|
||||
} else {
|
||||
file copy $f "$dir/[file tail $f]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$cb clear
|
||||
$cb save
|
||||
}
|
||||
}
|
||||
|
||||
end_chunked
|
||||
|
||||
@@ -73,6 +73,7 @@ puts "
|
||||
if {$url eq ""} {
|
||||
puts "This file has not been indexed by the media server.
|
||||
Cannot decrypt."
|
||||
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
||||
exit
|
||||
}
|
||||
|
||||
|
||||
@@ -65,15 +65,22 @@ if {$type eq "ts"} {
|
||||
<th>Start Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get start] -format "%c %Z"]
|
||||
puts "<font class=also>(Scheduled: [
|
||||
clock format [$ts get schedstart] -format "%c %Z"])</font>"
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>End Time</th>
|
||||
<td>"
|
||||
puts [clock format [$ts get end] -format "%c %Z"]
|
||||
puts "<font class=also>(Scheduled: [clock format \
|
||||
[expr [$ts get schedstart] + [$ts get scheddur]] \
|
||||
-format "%c %Z"])</font>"
|
||||
puts "</td>
|
||||
</tr><tr>
|
||||
<th>Duration</th>
|
||||
<td>[$ts duration] minute(s).</td>
|
||||
<td>[$ts duration] minute(s).
|
||||
<font class=also>(Scheduled: [expr [$ts get scheddur] / 60])
|
||||
</font></td>
|
||||
</tr><tr>
|
||||
<th>Size</th>
|
||||
<td>$sz</td>
|
||||
|
||||
@@ -5,7 +5,6 @@ source /mod/var/mongoose/lib/setup
|
||||
require ts.class pretty_size
|
||||
|
||||
puts "Content-Type: text/html\r\n\r\n"
|
||||
header
|
||||
|
||||
cgi_input 1
|
||||
#cgi_dump
|
||||
@@ -51,5 +50,3 @@ $('#back').button().click(function() {
|
||||
</script>
|
||||
}
|
||||
|
||||
footer
|
||||
|
||||
|
||||
15
var/mongoose/cgi-bin/browse/mknewdir.jim
Executable file
15
var/mongoose/cgi-bin/browse/mknewdir.jim
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
package require cgi
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
#cgi_dump
|
||||
|
||||
set dir [cgi_get dir -]
|
||||
set name [cgi_get newdirname "New Folder"]
|
||||
|
||||
file mkdir "$dir/$name"
|
||||
|
||||
17
var/mongoose/cgi-bin/browse/style.css
Normal file
17
var/mongoose/cgi-bin/browse/style.css
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
div.brow
|
||||
{
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
div.cliplist span
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
#clipclear
|
||||
{
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
@@ -8,13 +8,8 @@ require altrow
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
set databases {
|
||||
/var/lib/humaxtv/rsvp.db
|
||||
/var/lib/humaxtv/rsv.db
|
||||
/var/lib/humaxtv/setup.db
|
||||
/var/lib/humaxtv/channel.db
|
||||
/mnt/hd2/dms_cds.db
|
||||
}
|
||||
set databases [glob /var/lib/humaxtv/*.db]
|
||||
lappend databases "/mnt/hd2/dms_cds.db"
|
||||
|
||||
header
|
||||
|
||||
|
||||
@@ -18,18 +18,6 @@ set record [lindex [epg fetch dump -service $service -event $event] 0]
|
||||
$record get_channel_info
|
||||
set others [$record othertimes]
|
||||
|
||||
puts {
|
||||
<style type=text/css>
|
||||
font.also
|
||||
{
|
||||
font-size: 0.9em;
|
||||
font-style: italic;
|
||||
color: #333;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
puts "
|
||||
<table class=keyval>
|
||||
<tr>
|
||||
|
||||
@@ -79,7 +79,8 @@ if {[llength $pkgs] > 0} {
|
||||
"
|
||||
|
||||
foreach pkg $pkgs {
|
||||
if {$filter && ![dict exists $::pkgmeta $pkg]} { continue }
|
||||
if {$type ne "upgr" && $filter && \
|
||||
![dict exists $::pkgmeta $pkg]} { continue }
|
||||
pkgrow [pkg load $pkg]
|
||||
}
|
||||
puts "</table>"
|
||||
@@ -90,7 +91,7 @@ if {[llength $pkgs] > 0} {
|
||||
puts "<i>No packages "
|
||||
switch $type {
|
||||
inst { puts "are installed." }
|
||||
upgr { puts "are available for upgrade." }
|
||||
upgr { puts "are available for upgrade; try updating the package list from the Internet using the button above." }
|
||||
avail { puts "are available for installation." }
|
||||
}
|
||||
puts "</i>"
|
||||
|
||||
@@ -8,6 +8,12 @@ puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
cgi_input
|
||||
|
||||
if {[cgi_get act] eq "cancel"} {
|
||||
file delete /tmp/.restartpending
|
||||
exit
|
||||
}
|
||||
|
||||
if {[cgi_get now] eq "yes"} {
|
||||
# - Busybox reboot does sync the disk but may still not be clean enough.
|
||||
puts "Restarting."
|
||||
|
||||
48
var/mongoose/html/css/jquery.bar.css
Normal file
48
var/mongoose/html/css/jquery.bar.css
Normal file
@@ -0,0 +1,48 @@
|
||||
.jbar{
|
||||
height:50px;
|
||||
width:100%;
|
||||
background-color: #ffffcc;
|
||||
color: #ff4000;
|
||||
position:fixed;
|
||||
filter:progid:DXImageTransform.Microsoft.Alpha(opacity=95);
|
||||
opacity: 0.95;
|
||||
-moz-opacity: 0.95;
|
||||
text-align:center;
|
||||
left:0px;
|
||||
z-index:9999999;
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
}
|
||||
.jbar-top{
|
||||
top:0px;
|
||||
border-top:2px solid #fff;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
.jbar-bottom{
|
||||
bottom:0px;
|
||||
border-bottom:2px solid #fff;
|
||||
border-top: 1px solid #ebebeb;
|
||||
color:#777;
|
||||
}
|
||||
.jbar-content{
|
||||
line-height:46px;
|
||||
font-size: 18px;
|
||||
font-family:'Lucida Grande',sans-serif;
|
||||
}
|
||||
a.jbar-cross{
|
||||
position:absolute;
|
||||
width:31px;
|
||||
height:31px;
|
||||
background:transparent url(/images/cross.png) no-repeat top left;
|
||||
cursor:pointer;
|
||||
right:10px;
|
||||
}
|
||||
a.jbar-cross:hover{
|
||||
background-image: url(/images/cross_hover.png)
|
||||
}
|
||||
.jbar-top a.jbar-cross{
|
||||
top:8px;
|
||||
}
|
||||
.jbar-bottom a.jbar-cross{
|
||||
bottom:8px;
|
||||
}
|
||||
@@ -13,6 +13,19 @@ html>body
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.left, .cleft
|
||||
{
|
||||
float: left;
|
||||
}
|
||||
.cleft
|
||||
{
|
||||
clear: left;
|
||||
}
|
||||
fieldset.left, fieldset.cleft
|
||||
{
|
||||
display: inline;
|
||||
}
|
||||
|
||||
div.container
|
||||
{
|
||||
position: relative;
|
||||
@@ -82,6 +95,12 @@ table.borders, table.borders td, table.borders th
|
||||
color: black;
|
||||
}
|
||||
|
||||
.hover
|
||||
{
|
||||
background: #f6ff5b;
|
||||
color: black;
|
||||
}
|
||||
|
||||
table td,table th
|
||||
{
|
||||
font-size: small;
|
||||
@@ -296,3 +315,11 @@ div.cut
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
font.also
|
||||
{
|
||||
font-size: 0.9em;
|
||||
font-style: italic;
|
||||
color: #333;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
|
||||
BIN
var/mongoose/html/img/left.png
Normal file
BIN
var/mongoose/html/img/left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
BIN
var/mongoose/html/img/right.png
Normal file
BIN
var/mongoose/html/img/right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -111,6 +111,12 @@ $(document).ready(function() {
|
||||
<div class=footer>
|
||||
<ul>
|
||||
<li>
|
||||
Release Notes:
|
||||
<a target=_blank
|
||||
href="http://wiki.hummy.tv/wiki/Customised_Firmware_Release_Notes">
|
||||
Firmware</a> |
|
||||
<a target=_blank href="http://wiki.hummy.tv/wiki/Webif_release_notes">Webif</a>
|
||||
</li><li>
|
||||
<a href=/diag.shtml>Diagnostics</a>
|
||||
</li><li>
|
||||
<a href=/cgi-bin/channel.jim>Channel Information</a>
|
||||
|
||||
53
var/mongoose/html/js/jquery.bar.js
Normal file
53
var/mongoose/html/js/jquery.bar.js
Normal file
@@ -0,0 +1,53 @@
|
||||
(function($) {
|
||||
|
||||
$.fn.bar = function(options) {
|
||||
var opts = $.extend({}, $.fn.bar.defaults, options);
|
||||
return this.each(function() {
|
||||
$this = $(this);
|
||||
var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
|
||||
|
||||
// $this.click(function(e){
|
||||
if(!$('.jbar').length){
|
||||
timeout = setTimeout('$.fn.bar.removebar()',o.time);
|
||||
var _message_span = $(document.createElement('span')).addClass('jbar-content').html(o.message);
|
||||
_message_span.css({"color" : o.color});
|
||||
var _wrap_bar;
|
||||
(o.position == 'bottom') ?
|
||||
_wrap_bar = $(document.createElement('div')).addClass('jbar jbar-bottom'):
|
||||
_wrap_bar = $(document.createElement('div')).addClass('jbar jbar-top') ;
|
||||
|
||||
_wrap_bar.css({"background-color" : o.background_color});
|
||||
if(o.removebutton){
|
||||
var _remove_cross = $(document.createElement('a')).addClass('jbar-cross');
|
||||
_remove_cross.click(function(e){$.fn.bar.removebar();})
|
||||
}
|
||||
else{
|
||||
_wrap_bar.css({"cursor" : "pointer"});
|
||||
_wrap_bar.click(function(e){$.fn.bar.removebar();})
|
||||
}
|
||||
_wrap_bar.append(_message_span).append(_remove_cross).hide().insertBefore($('.content')).fadeIn('fast');
|
||||
}
|
||||
// })
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
var timeout;
|
||||
$.fn.bar.removebar = function(txt) {
|
||||
if($('.jbar').length){
|
||||
clearTimeout(timeout);
|
||||
$('.jbar').fadeOut('fast',function(){
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
};
|
||||
$.fn.bar.defaults = {
|
||||
background_color : '#FFFFFF',
|
||||
color : '#000',
|
||||
position : 'top',
|
||||
removebutton : true,
|
||||
time : 5000
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
@@ -146,13 +146,13 @@ $(document).ready(function() {
|
||||
<div id=pkgtabs>
|
||||
<ul>
|
||||
<li>
|
||||
<a href=/cgi-bin/pkg.jim?type=inst>
|
||||
<span>Installed</span>
|
||||
</a>
|
||||
</li><li>
|
||||
<a href=/cgi-bin/pkg.jim?type=upgr>
|
||||
<span>Upgrades</span>
|
||||
</a>
|
||||
</li><li>
|
||||
<a href=/cgi-bin/pkg.jim?type=inst>
|
||||
<span>Installed</span>
|
||||
</a>
|
||||
</li><li>
|
||||
<a href=/cgi-bin/pkg.jim?type=avail>
|
||||
<span>Available</span>
|
||||
|
||||
@@ -4,7 +4,7 @@ source /mod/var/mongoose/lib/setup
|
||||
require pretty_size
|
||||
|
||||
foreach file [concat \
|
||||
[glob -nocomplain /tmp/*.log] \
|
||||
[glob -nocomplain /var/log/*.log] \
|
||||
[glob -nocomplain /mod/tmp/*.log] \
|
||||
] {
|
||||
puts "<a href=# class=log file=\"$file\">
|
||||
|
||||
@@ -25,17 +25,23 @@ if {[system busy]} {
|
||||
}
|
||||
|
||||
puts {
|
||||
<small><button id=restart_cancel>Hide</button></small>
|
||||
</font>
|
||||
</div>
|
||||
<div style="width: 60%; height: 0.7em; margin-bottom: 2em;
|
||||
background: url(/img/stripes.gif) repeat-x;"></div>
|
||||
</center>
|
||||
<script type=text/javascript>
|
||||
$('#restart_humaxtv').button();
|
||||
$('#restart_humaxtv').click(function() {
|
||||
$('#restart_humaxtv').button()
|
||||
.click(function() {
|
||||
if (confirm('Are you sure you wish to perform a restart now?'))
|
||||
window.location = '/cgi-bin/restart.jim';
|
||||
});
|
||||
$('#restart_cancel').button()
|
||||
.click(function() {
|
||||
$.get('/cgi-bin/restart.jim?act=cancel');
|
||||
$('#restart_block').slideUp('slow');
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,10 @@ $(document).ready(function() {
|
||||
$dialog.dialog('open');
|
||||
}
|
||||
$('a.schedule').click(function(e) { schedpopup(e, $(this)) });
|
||||
|
||||
$('table.tablesorter tbody tr').hover(
|
||||
function() { $(this).addClass('hover'); },
|
||||
function() { $(this).removeClass('hover'); });
|
||||
});
|
||||
</script>
|
||||
}
|
||||
|
||||
87
var/mongoose/lib/clipboard.class
Normal file
87
var/mongoose/lib/clipboard.class
Normal file
@@ -0,0 +1,87 @@
|
||||
|
||||
if {![exists -proc class ]} { package require oo }
|
||||
|
||||
class clipboard {
|
||||
path "/tmp/webif.cb"
|
||||
items {}
|
||||
}
|
||||
|
||||
class clipboarditem {
|
||||
action ""
|
||||
path ""
|
||||
}
|
||||
|
||||
clipboarditem method _parse {line} {
|
||||
lassign [split $line "|"] action path
|
||||
}
|
||||
|
||||
proc {clipboarditem load} {line} {
|
||||
set c [clipboarditem new]
|
||||
$c _parse $line
|
||||
return $c
|
||||
}
|
||||
|
||||
clipboard method save {} {
|
||||
set fd [open $path w]
|
||||
foreach item $items {
|
||||
puts $fd "[$item get action]|[$item get path]"
|
||||
}
|
||||
$fd close
|
||||
}
|
||||
|
||||
clipboard method load {} {
|
||||
set items {}
|
||||
set changed 0
|
||||
if {[file exists $path]} {
|
||||
set fd [open $path r]
|
||||
foreach line [split [$fd read] "\n"] {
|
||||
set ci [clipboarditem load $line]
|
||||
if {[file exists [$ci get path]]} {
|
||||
lappend items $ci
|
||||
} else {
|
||||
set changed 1
|
||||
}
|
||||
}
|
||||
}
|
||||
if {$changed} { $self save }
|
||||
return $self
|
||||
}
|
||||
|
||||
clipboard method present {xfile} {
|
||||
foreach item $items {
|
||||
if {[$item get path] eq $xfile} {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
clipboard method index {xfile} {
|
||||
set index -1
|
||||
foreach item $items {
|
||||
incr index
|
||||
if {[$item get path] eq $xfile} {
|
||||
return $index
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
clipboard method clear {} {
|
||||
set items {}
|
||||
}
|
||||
|
||||
clipboard method size {} {
|
||||
return [llength $items]
|
||||
}
|
||||
|
||||
clipboard method add {xaction xpath} {
|
||||
lappend items [clipboarditem load "$xaction|$xpath"]
|
||||
}
|
||||
|
||||
clipboard method remove {xpath} {
|
||||
set index [$self index $xpath]
|
||||
if {$index < 0} { return }
|
||||
set items [lreplace $items $index $index]
|
||||
}
|
||||
|
||||
@@ -12,8 +12,10 @@ set ::pkgmeta {}
|
||||
|
||||
pkg method _load {nm} {
|
||||
set name $nm
|
||||
set info [join [split [exec /bin/opkg list $nm] "\n"] " "]
|
||||
regexp {^([^ ]+) - ([^ ]+) - (.*)$} $info full xname latest descr
|
||||
foreach line [split [exec /bin/opkg list $nm] "\n"] {
|
||||
# betaftpd - 0.0.8pre17-1 - Description...
|
||||
regexp {^[^ ]+ - ([^ ]+) - (.*)$} $line x latest descr
|
||||
}
|
||||
set info [exec /bin/opkg list-installed $nm]
|
||||
regexp {^([^ ]+) - ([^ ]+)$} $info full xname installed
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ class ts {
|
||||
error ""
|
||||
guidance ""
|
||||
bookmarks 0
|
||||
schedstart 0
|
||||
scheddur 0
|
||||
}
|
||||
|
||||
ts method duration {{raw 0}} {
|
||||
@@ -35,7 +37,7 @@ ts method _parse {line} {
|
||||
|
||||
lassign [split $line "\t"] \
|
||||
title synopsis definition channel_num channel_name \
|
||||
start end flags_list guidance bookmarks
|
||||
start end flags_list guidance bookmarks schedstart scheddur
|
||||
|
||||
set flags [split [string range $flags_list 0 end-1] ,]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user