mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-06-06 09:41:14 -04:00
Images are now svg's from the 'Gnome Symbolic Icon Theme'.
This commit is contained in:
parent
49276c157c
commit
f5435802e7
59 changed files with 502 additions and 20 deletions
|
@ -1,9 +1,9 @@
|
|||
|
||||
modulejs.define('core/resource', ['core/settings'], function (settings) {
|
||||
|
||||
var image = function (id, noPngExt) {
|
||||
var image = function (id, customExt) {
|
||||
|
||||
return settings.h5aiAbsHref + 'client/images/' + id + (noPngExt ? '' : '.png');
|
||||
return settings.h5aiAbsHref + 'client/images/' + id + (customExt ? '' : '.svg');
|
||||
},
|
||||
|
||||
icon = function (id, big) {
|
||||
|
|
|
@ -34,7 +34,8 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
|||
.data('status', item.status);
|
||||
|
||||
location.setLink($a, item);
|
||||
$img.attr('src', resource.icon(item.type));
|
||||
// $img.attr('src', resource.icon(item.type));
|
||||
$img.attr('src', resource.image('folder'));
|
||||
$label.text(item.label);
|
||||
|
||||
if (item.isFolder()) {
|
||||
|
@ -58,19 +59,21 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
|||
// is it the domain?
|
||||
if (item.isDomain()) {
|
||||
$html.addClass('domain');
|
||||
$img.attr('src', resource.icon('folder-home'));
|
||||
// $img.attr('src', resource.icon('folder-home'));
|
||||
$img.attr('src', resource.image('home'));
|
||||
}
|
||||
|
||||
// is it the root?
|
||||
if (item.isRoot()) {
|
||||
$html.addClass('root');
|
||||
$img.attr('src', resource.icon('folder-home'));
|
||||
// $img.attr('src', resource.icon('folder-home'));
|
||||
$img.attr('src', resource.image('home'));
|
||||
}
|
||||
|
||||
// is it the current folder?
|
||||
if (item.isCurrentFolder()) {
|
||||
$html.addClass('current');
|
||||
$img.attr('src', resource.icon('folder-open'));
|
||||
// $img.attr('src', resource.icon('folder-open'));
|
||||
}
|
||||
|
||||
// does it have subfolders?
|
||||
|
@ -94,7 +97,8 @@ modulejs.define('ext/tree', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
|||
// reflect folder status
|
||||
if (_.isNumber(item.status)) {
|
||||
if (item.status === 200) {
|
||||
$img.attr('src', resource.icon('folder-page'));
|
||||
// $img.attr('src', resource.icon('folder-page'));
|
||||
$img.attr('src', resource.image('folder-page'));
|
||||
} else {
|
||||
$html.addClass('error');
|
||||
$a.append($(statusHintTemplate).text(item.status));
|
||||
|
|
|
@ -56,11 +56,20 @@ modulejs.define('view/items', ['_', '$', 'core/settings', 'core/resource', 'core
|
|||
$date.data('time', item.time).text(format.formatDate(item.time));
|
||||
$size.data('bytes', item.size).text(format.formatSize(item.size));
|
||||
|
||||
|
||||
// if (item.isFolder()) {
|
||||
// $imgSmall.attr('src', resource.image('folder'));
|
||||
// $imgBig.attr('src', resource.image('folder')).width(48);
|
||||
// }
|
||||
|
||||
|
||||
if (item.isFolder() && _.isNumber(item.status)) {
|
||||
if (item.status === 200) {
|
||||
$html.addClass('page');
|
||||
$imgSmall.attr('src', resource.icon('folder-page'));
|
||||
$imgBig.attr('src', resource.icon('folder-page', true));
|
||||
// $imgSmall.attr('src', resource.image('folder-page'));
|
||||
// $imgBig.attr('src', resource.image('folder-page')).width(48);
|
||||
} else {
|
||||
$html.addClass('error');
|
||||
$label.append($(hintTemplate).text(' ' + item.status + ' '));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue