Refactor API.

This commit is contained in:
Lars Jung 2015-05-05 01:58:50 +02:00
parent e31028f5a9
commit 7c4f9d574c
5 changed files with 53 additions and 36 deletions

View file

@ -20,14 +20,16 @@ modulejs.define('ext/preview-img', ['_', '$', 'core/event', 'core/server', 'core
}
server.request({
action: 'getThumbHref',
type: 'img',
href: href,
width: settings.size,
height: 0
action: 'get',
thumbs: [{
type: 'img',
href: href,
width: settings.size,
height: 0
}]
}, function (json) {
callback(json && json.href ? json.href : null);
callback(json && json.thumbs && json.thumbs[0] ? json.thumbs[0] : null);
});
}