git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@2068 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-11-29 11:39:24 +00:00
parent 37efb8d633
commit 1c9da2f52f
5 changed files with 62 additions and 7 deletions

View File

@ -1,7 +1,7 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 1.0.17-9 Version: 1.0.17-10
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.13),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.14),hmt(>=1.1.21),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),mongoose Depends: webif-channelicons(>=1.1.13),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.14),hmt(>=1.1.21),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),mongoose

View File

@ -59,6 +59,15 @@ puts {
<li class=separator><a href=#rename>Rename</a></li> <li class=separator><a href=#rename>Rename</a></li>
<li><a href=#download>Download</a></li> <li><a href=#download>Download</a></li>
}
if {[llength $plugins(omenu)]} {
foreach plugin $plugins(omenu) {
lassign $plugin tag options
puts "<li class=$tag><a href=#$tag>$options(desc)</a></li>"
}
}
puts {
</ul> </ul>
<ul id=dooptmenu class=contextMenu style="width: 250px"> <ul id=dooptmenu class=contextMenu style="width: 250px">

View File

@ -8,7 +8,7 @@ require ts.class pretty_size system.class settings.class escape browse.class \
jqplugin contextMenu bar enadis jqplugin contextMenu bar enadis
jscss script.js style.css jscss script.js style.css
set plugins { dmenu {} menu {} } set plugins { dmenu {} menu {} omenu {} }
eval_plugins browse eval_plugins browse
header header

View File

@ -1,7 +1,11 @@
var plugins = { var plugins = {
menu: {}, menu: {},
dmenu: {} menu_prepare: {},
omenu: {},
omenu_prepare: {},
dmenu: {},
dmenu_prepare: {}
}; };
var dir; var dir;
@ -339,6 +343,18 @@ function preparemenu(el, menu)
$(menu).disableContextMenuItems('#new'); $(menu).disableContextMenuItems('#new');
} }
$.each(plugins.menu_prepare, function(k,v) {
plugins.menu_prepare[k](el, menu);
});
}
function prepareomenu(el, menu)
{
$(menu).enableContextMenuItems('#delete');
$.each(plugins.omenu_prepare, function(k,v) {
plugins.omenu_prepare[k](el, menu);
});
} }
function fixdmenu(el, menu, flag, tag, descr, recurse) function fixdmenu(el, menu, flag, tag, descr, recurse)
@ -388,6 +404,9 @@ function preparedmenu(el, menu)
fixdmenu(el, menu, 'autompg', '#mpg', 'Auto-mpg', 0); fixdmenu(el, menu, 'autompg', '#mpg', 'Auto-mpg', 0);
fixdmenu(el, menu, 'automp3', '#mp3', 'Auto-audio', 0); fixdmenu(el, menu, 'automp3', '#mp3', 'Auto-audio', 0);
//fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0); //fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0);
$.each(plugins.dmenu_prepare, function(k,v) {
plugins.dmenu_prepare[k](el, menu);
});
} }
function flagdir(file, flag, iconset, output, options) function flagdir(file, flag, iconset, output, options)
@ -529,6 +548,31 @@ var menuclick = function(action, el, pos)
} }
}; };
var omenuclick = function(action, el, pos)
{
switch (action)
{
case 'delete':
case 'copy':
case 'cut':
case 'rename':
case 'download':
menuclick(action, el, pos);
break;
default:
if (plugins.omenu[action])
{
var file = $(el).parent().prevAll('a.bf')
.last().attr('file');
plugins.omenu[action](file);
}
else
alert('Unhandled action: ' + action);
break;
}
};
var dmenuclick = function(action, el, pos) var dmenuclick = function(action, el, pos)
{ {
var direl = $(el).parent().parent(); var direl = $(el).parent().parent();
@ -683,9 +727,9 @@ var dmenuclick = function(action, el, pos)
{ {
menu: 'ooptmenu', menu: 'ooptmenu',
leftButton: true, leftButton: true,
beforeShow: preparemenu beforeShow: prepareomenu
}, },
menuclick omenuclick
); );
$('img.dopt').contextMenu( $('img.dopt').contextMenu(

View File

@ -7,7 +7,8 @@
.removeClass('ui-state-disabled') .removeClass('ui-state-disabled')
.removeClass('ui-button-disabled') .removeClass('ui-button-disabled')
.prop('disabled', false) .prop('disabled', false)
.removeAttr('aria-disabled'); .removeAttr('aria-disabled')
.disabled = false;
}); });
}; };
@ -16,7 +17,8 @@
return this.each(function() { return this.each(function() {
$(this) $(this)
.addClass('ui-state-disabled') .addClass('ui-state-disabled')
.prop('disabled', true); .prop('disabled', true)
.disabled = true;
}); });
}; };
})(jQuery); })(jQuery);