add nav buttons + browse hooks
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1927 2a923420-c742-0410-a762-8d5b09965624
@ -38,6 +38,16 @@ if $nicesplice {
|
||||
puts {
|
||||
<li class=separator><a href=#lock>Toggle Lock</a></li>
|
||||
<li><a href=#new>Toggle New</a></li>
|
||||
}
|
||||
|
||||
if {[llength $plugins(menu)]} {
|
||||
foreach plugin $plugins(menu) {
|
||||
lassign $plugin tag options
|
||||
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
|
||||
}
|
||||
}
|
||||
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
<ul id=ooptmenu class=contextMenu style="width: 160px">
|
||||
@ -90,6 +100,13 @@ if {[system pkginst ffmpeg]} {
|
||||
}
|
||||
}
|
||||
|
||||
if {[llength $plugins(dmenu)]} {
|
||||
foreach plugin $plugins(dmenu) {
|
||||
lassign $plugin tag options
|
||||
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
|
||||
}
|
||||
}
|
||||
|
||||
puts {
|
||||
</ul>
|
||||
|
||||
|
@ -2,10 +2,15 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require ts.class pretty_size system.class settings.class escape browse.class
|
||||
require ts.class pretty_size system.class settings.class escape browse.class \
|
||||
plugin
|
||||
|
||||
jqplugin contextMenu bar enadis
|
||||
jscss script.js style.css
|
||||
|
||||
set plugins { dmenu {} menu {} }
|
||||
eval_plugins browse
|
||||
|
||||
header
|
||||
|
||||
set nicesplice [system pkginst nicesplice]
|
||||
|
@ -1,4 +1,9 @@
|
||||
|
||||
var plugins = {
|
||||
menu: {},
|
||||
dmenu: {}
|
||||
};
|
||||
|
||||
var dir;
|
||||
|
||||
function disableall()
|
||||
@ -131,24 +136,6 @@ function new_folder_callback(data, status, xhr)
|
||||
$.each(data, set_folder_new);
|
||||
}
|
||||
|
||||
//function insert_shrunk(file, perc)
|
||||
//{
|
||||
// if (perc == 0)
|
||||
// {
|
||||
// file = file.replace(/[ ]/g, '');
|
||||
// file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||
// //console.log("File: (%s) = (%s)", file, perc);
|
||||
// $('#sp_' + file).show();
|
||||
// }
|
||||
//}
|
||||
|
||||
//function shrunk_callback(data, status, xhr)
|
||||
//{
|
||||
// //console.log("Status: %s", status);
|
||||
// //console.dir(data);
|
||||
// $.each(data, insert_shrunk);
|
||||
//}
|
||||
|
||||
function delete_callback(file, dir, id)
|
||||
{
|
||||
var el = 'div.bf#' + id;
|
||||
@ -471,9 +458,6 @@ var menuclick = function(action, el, pos)
|
||||
break;
|
||||
|
||||
case 'vthm':
|
||||
// window.open('/browse/bmpw.jim?file=' + file, 'hxwebifbmp',
|
||||
// 'height=156,width=280,toolbar=no,' +
|
||||
// 'scrollbars=no,menubar=no,location=no,titlebar=no');
|
||||
$('#thmbmp').attr('src', 'bmp.jim?file=' + file);
|
||||
$('#bmpdialogue').dialog('open');
|
||||
break;
|
||||
@ -515,7 +499,10 @@ var menuclick = function(action, el, pos)
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
if (plugins.menu[action])
|
||||
plugins.menu[action](file);
|
||||
else
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
@ -668,7 +655,10 @@ var dmenuclick = function(action, el, pos)
|
||||
break;
|
||||
|
||||
default:
|
||||
alert('Unhandled action: ' + action);
|
||||
if (plugins.dmenu[action])
|
||||
plugins.dmenu[action](file);
|
||||
else
|
||||
alert('Unhandled action: ' + action);
|
||||
break;
|
||||
}
|
||||
};
|
||||
@ -850,10 +840,6 @@ var dmenuclick = function(action, el, pos)
|
||||
$.getJSON('/browse/sizes.jim?dir=' + encodeURIComponent(dir),
|
||||
folder_size_callback);
|
||||
|
||||
// Flag shrunk recordings
|
||||
// $.getJSON('/browse/shrunk.jim?dir=' + encodeURIComponent(dir),
|
||||
// shrunk_callback);
|
||||
|
||||
// Flag folders with unwatched items
|
||||
$.getJSON('/browse/newdir.jim?dir=' + encodeURIComponent(dir),
|
||||
new_folder_callback);
|
||||
|
BIN
webif/html/img/nav/bottom-grey.png
Normal file
After Width: | Height: | Size: 315 B |
BIN
webif/html/img/nav/bottom.png
Normal file
After Width: | Height: | Size: 319 B |
BIN
webif/html/img/nav/down-grey.png
Normal file
After Width: | Height: | Size: 296 B |
BIN
webif/html/img/nav/down.png
Normal file
After Width: | Height: | Size: 300 B |
BIN
webif/html/img/nav/first-grey.png
Normal file
After Width: | Height: | Size: 309 B |
BIN
webif/html/img/nav/first.png
Normal file
After Width: | Height: | Size: 326 B |
BIN
webif/html/img/nav/last-grey.png
Normal file
After Width: | Height: | Size: 323 B |
BIN
webif/html/img/nav/last.png
Normal file
After Width: | Height: | Size: 325 B |
BIN
webif/html/img/nav/left-grey.png
Normal file
After Width: | Height: | Size: 290 B |
BIN
webif/html/img/nav/left.png
Normal file
After Width: | Height: | Size: 300 B |
BIN
webif/html/img/nav/right-grey.png
Normal file
After Width: | Height: | Size: 295 B |
BIN
webif/html/img/nav/right.png
Normal file
After Width: | Height: | Size: 299 B |
BIN
webif/html/img/nav/top-grey.png
Normal file
After Width: | Height: | Size: 299 B |
BIN
webif/html/img/nav/top.png
Normal file
After Width: | Height: | Size: 316 B |
BIN
webif/html/img/nav/up-grey.png
Normal file
After Width: | Height: | Size: 289 B |
BIN
webif/html/img/nav/up.png
Normal file
After Width: | Height: | Size: 300 B |
@ -6,7 +6,8 @@
|
||||
$(this)
|
||||
.removeClass('ui-state-disabled')
|
||||
.removeClass('ui-button-disabled')
|
||||
.removeProp('disabled');
|
||||
.removeProp('disabled')
|
||||
.removeAttr('aria-disabled');
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -574,6 +574,22 @@ proc expire {dir} {
|
||||
}
|
||||
}
|
||||
|
||||
proc scan_run {dir flag callback} {
|
||||
global dustbin
|
||||
|
||||
if {$dir eq $dustbin} return
|
||||
|
||||
if {[string match {\[*} [file tail $dir]]} return
|
||||
|
||||
if {[file exists "$dir/.$flag"]} { $callback $dir }
|
||||
|
||||
foreach entry [readdir -nocomplain $dir] {
|
||||
if {[file isdirectory "$dir/$entry"]} {
|
||||
scan_run "$dir/$entry" $flag $callback
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc scan {dir attr {force 0} {recurse 1}} {{indent 0}} {
|
||||
global dustbin
|
||||
|
||||
@ -671,6 +687,7 @@ if {[lindex $argv 0] eq "-single"} {
|
||||
} else {
|
||||
foreach arg $modules {
|
||||
set st [clock milliseconds]
|
||||
log "$arg scan starting."
|
||||
runplugin "pre${arg}scan"
|
||||
scan $root $arg
|
||||
runplugin "post${arg}scan"
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
require system.class
|
||||
require system.class plugin
|
||||
|
||||
#if {![exists -proc class]} { package require oo }
|
||||
#class browse {}
|
||||
@ -104,6 +104,8 @@ proc {dir iconset} {dir} {
|
||||
lappend attrs "autoexpire=1"
|
||||
}
|
||||
|
||||
eval_plugins diriconset
|
||||
|
||||
return [list $icons $attrs]
|
||||
}
|
||||
|
||||
|