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