forked from hummypkg/webif
Make use of unique element IDs for img consistent
This commit is contained in:
parent
029b115628
commit
346ed469c8
@ -1,7 +1,7 @@
|
|||||||
Package: webif
|
Package: webif
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: web
|
Section: web
|
||||||
Version: 1.4.9-2
|
Version: 1.4.9-3
|
||||||
Architecture: mipsel
|
Architecture: mipsel
|
||||||
Maintainer: af123@hpkg.tv
|
Maintainer: af123@hpkg.tv
|
||||||
Depends: tcpfix,webif-channelicons(>=1.1.27),lighttpd(>=1.4.39-1),jim(>=0.79),jim-pack(>=0.79),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-2),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.13),webif-charts(>=1.2-1),stripts(>=1.4.2),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.98),sqlite3(>=3.15.1),jim-xconv,zip(>=3.0-1),wget
|
Depends: tcpfix,webif-channelicons(>=1.1.27),lighttpd(>=1.4.39-1),jim(>=0.79),jim-pack(>=0.79),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-2),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.13),webif-charts(>=1.2-1),stripts(>=1.4.2),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.98),sqlite3(>=3.15.1),jim-xconv,zip(>=3.0-1),wget
|
||||||
|
@ -10,6 +10,18 @@ var plugins = {
|
|||||||
dmenu_prepare: {}
|
dmenu_prepare: {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// pattern matches directory path prefix
|
||||||
|
var pathre = /.*\/|\.[^.]*$/g;
|
||||||
|
|
||||||
|
// IDs of size, img elements for folders use RFC4648 s5 encoding of name
|
||||||
|
function folderID(folder)
|
||||||
|
{
|
||||||
|
return btoa(escape(folder))
|
||||||
|
.replace(/\+/g, '-')
|
||||||
|
.replace(/\//g, '_')
|
||||||
|
.replace(/=/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
function blockpage(msg)
|
function blockpage(msg)
|
||||||
{
|
{
|
||||||
if (!msg)
|
if (!msg)
|
||||||
@ -115,21 +127,11 @@ function epginfo_callback(data, status, xhr)
|
|||||||
function insert_folder_size(folder, size)
|
function insert_folder_size(folder, size)
|
||||||
{
|
{
|
||||||
// folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
// folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
||||||
// ID of size element is ID + RFC4648 s5 encoding of folder name
|
size += (size.search(/\d$/) == -1 ? 'iB' : ' bytes');
|
||||||
folder = "ID" +
|
folder = folderID(folder);
|
||||||
btoa(escape(folder))
|
|
||||||
.replace(/\+/g, '-')
|
|
||||||
.replace(/\//g, '_')
|
|
||||||
.replace(/=/g, '');
|
|
||||||
//console.log("Folder: (%s) = (%s)", folder, size);
|
//console.log("Folder: (%s) = (%s)", folder, size);
|
||||||
if (size.search(/\d$/) == -1)
|
$(folder == "" ? '#dirsize' : '#ID' + folder)
|
||||||
size += 'iB';
|
.text(' (' + size + ')');
|
||||||
else
|
|
||||||
size += ' bytes';
|
|
||||||
if (folder == "")
|
|
||||||
$('#dirsize').text(' (' + size + ')');
|
|
||||||
else
|
|
||||||
$('#' + folder).text(' (' + size + ')');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function folder_size_callback(data, status, xhr)
|
function folder_size_callback(data, status, xhr)
|
||||||
@ -141,11 +143,9 @@ function folder_size_callback(data, status, xhr)
|
|||||||
|
|
||||||
function set_folder_new(folder, cnt)
|
function set_folder_new(folder, cnt)
|
||||||
{
|
{
|
||||||
folder = folder.replace(/ /g, '');
|
|
||||||
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
|
||||||
//console.log("Folder: (%s) = (%s)", folder, cnt);
|
//console.log("Folder: (%s) = (%s)", folder, cnt);
|
||||||
left = cnt > 99 ? 11 : (cnt > 9 ? 14 : 17);
|
left = cnt > 99 ? 11 : (cnt > 9 ? 14 : 17);
|
||||||
$('#img' + folder)
|
$('#img' + folderID(folder))
|
||||||
.attr('src', '/img/Folder_New.png')
|
.attr('src', '/img/Folder_New.png')
|
||||||
.next('span.foldernum')
|
.next('span.foldernum')
|
||||||
.css('left', left + 'px')
|
.css('left', left + 'px')
|
||||||
@ -164,10 +164,8 @@ function new_folder_callback(data, status, xhr)
|
|||||||
|
|
||||||
function set_folder__(folder)
|
function set_folder__(folder)
|
||||||
{
|
{
|
||||||
folder = folder.replace(/ /g, '');
|
|
||||||
folder = folder.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
|
|
||||||
//console.log("Folder: (%s)", folder);
|
//console.log("Folder: (%s)", folder);
|
||||||
$('#img' + folder + ' ~ span.folderu').show();
|
$('#img' + folderID(folder) + ' ~ span.folderu').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function __folder_callback(data, status, xhr)
|
function __folder_callback(data, status, xhr)
|
||||||
@ -264,7 +262,7 @@ var $confirm; // Populated after DOM is loaded.
|
|||||||
|
|
||||||
function confirm_action(action, callback, file, type, id)
|
function confirm_action(action, callback, file, type, id)
|
||||||
{
|
{
|
||||||
var bfile = file.replace(/.*\/|\.[^.]*$/g, '');
|
var bfile = file.replace(pathre, '');
|
||||||
$confirm.dialog('option', 'buttons', {
|
$confirm.dialog('option', 'buttons', {
|
||||||
'Yes': function() { $(this).dialog('close');
|
'Yes': function() { $(this).dialog('close');
|
||||||
callback(file, type, id); },
|
callback(file, type, id); },
|
||||||
@ -437,7 +435,7 @@ var menuclick = function(action, el, pos)
|
|||||||
{
|
{
|
||||||
var file = $(el).parent().prevAll('a.bf').last().attr('file');
|
var file = $(el).parent().prevAll('a.bf').last().attr('file');
|
||||||
var efile = encodeURIComponent(file);
|
var efile = encodeURIComponent(file);
|
||||||
var bfile = file.replace(/.*\/|\.[^.]*$/g, '');
|
var bfile = file.replace(pathre, '');
|
||||||
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
|
bfile = bfile.replace(/[\x00-\x1f]+/g, '');
|
||||||
var type = $(el).attr('type');
|
var type = $(el).attr('type');
|
||||||
var id = $(el).attr('did');
|
var id = $(el).attr('did');
|
||||||
|
Loading…
Reference in New Issue
Block a user