mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-03-22 05:19:56 +01:00
Updates thumbs.
This commit is contained in:
parent
c186be6cb5
commit
21528dc50b
@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
.label {
|
||||
margin: 0 230px 0 (@small-icon-size + 8px);
|
||||
margin: 0 230px 0 (@small-icon-size + 16px);
|
||||
}
|
||||
|
||||
.date {
|
||||
|
@ -49,7 +49,7 @@
|
||||
}
|
||||
|
||||
.label {
|
||||
margin: 0 230px 0 (@big-icon-size + 8px);
|
||||
margin: 0 230px 0 (@big-icon-size + 16px);
|
||||
}
|
||||
|
||||
.date {
|
||||
|
@ -56,9 +56,10 @@
|
||||
@item-background-col-sel: rgba(0,0,0,0.02);
|
||||
@item-border-col-sel: @col-border-strong;
|
||||
|
||||
@small-icon-size: 32px;
|
||||
// @small-icon-size: 16px;
|
||||
@small-icon-size: 32px;
|
||||
@big-icon-size: 48px;
|
||||
// @big-icon-size: 56px;
|
||||
// @big-icon-size: 64px;
|
||||
// @big-icon-size: 80px;
|
||||
// @big-icon-size: 96px;
|
||||
|
@ -6,20 +6,20 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
|
||||
img: ['bmp', 'gif', 'ico', 'image', 'jpg', 'png', 'tiff'],
|
||||
mov: ['video'],
|
||||
doc: ['pdf', 'ps'],
|
||||
delay: 1000
|
||||
delay: 1000,
|
||||
size: 96
|
||||
}, allsettings.thumbnails),
|
||||
|
||||
requestThumbSquare = function (type, href, callback) {
|
||||
requestThumb = function (type, href, mode, ratio, callback) {
|
||||
|
||||
server.request({action: 'getThumbHref', type: type, href: href, mode: 'square', width: 96, height: 96}, function (json) {
|
||||
|
||||
callback(json && json.code === 0 ? json.absHref : null);
|
||||
});
|
||||
},
|
||||
|
||||
requestThumbRational = function (type, href, callback) {
|
||||
|
||||
server.request({action: 'getThumbHref', type: type, href: href, mode: 'rational', width: 96 * 2, height: 96}, function (json) {
|
||||
server.request({
|
||||
action: 'getThumbHref',
|
||||
type: type,
|
||||
href: href,
|
||||
mode: mode,
|
||||
width: settings.size * ratio,
|
||||
height: settings.size
|
||||
}, function (json) {
|
||||
|
||||
callback(json && json.code === 0 ? json.absHref : null);
|
||||
});
|
||||
@ -41,7 +41,7 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
|
||||
if (item.thumbSquare) {
|
||||
item.$view.find('.icon.square img').addClass('thumb').attr('src', item.thumbSquare);
|
||||
} else {
|
||||
requestThumbSquare(type, item.absHref, function (src) {
|
||||
requestThumb(type, item.absHref, 'square', 1, function (src) {
|
||||
|
||||
if (src && item.$view) {
|
||||
item.thumbSquare = src;
|
||||
@ -52,7 +52,7 @@ modulejs.define('ext/thumbnails', ['_', 'core/settings', 'core/event', 'core/ser
|
||||
if (item.thumbRational) {
|
||||
item.$view.find('.icon.rational img').addClass('thumb').attr('src', item.thumbRational);
|
||||
} else {
|
||||
requestThumbRational(type, item.absHref, function (src) {
|
||||
requestThumb(type, item.absHref, 'rational', 2, function (src) {
|
||||
|
||||
if (src && item.$view) {
|
||||
item.thumbRational = src;
|
||||
|
@ -301,13 +301,15 @@ Options
|
||||
- mov: array of types
|
||||
- doc: array of types
|
||||
- delay: delay in milliseconds after "dom-ready" before thumb-requesting starts
|
||||
- size: number, size in pixel of the generated thumbnails
|
||||
*/
|
||||
"thumbnails": {
|
||||
"enabled": true,
|
||||
"img": ["bmp", "gif", "ico", "image", "jpg", "png"],
|
||||
"mov": ["video"],
|
||||
"doc": ["pdf", "ps"],
|
||||
"delay": 1
|
||||
"delay": 1,
|
||||
"size": 96
|
||||
},
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user