1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/bower_components/emby-lazyload-image/lazyload-image.html

47 lines
1.4 KiB
HTML
Raw Normal View History

2016-04-23 15:14:13 -04:00
<script>
2016-04-24 19:14:55 -04:00
2016-04-25 14:33:17 -04:00
require(['imageFetcher'], function (imageFetcher) {
window.ImageFetcherLazyloadImage = imageFetcher;
});
2016-04-23 15:14:13 -04:00
/**
* <lazyload-image>
* HTMLImageElement extension for lazy loading.
* http://github.com/1000ch/lazyload-image
*
* Copyright 1000ch
* licensed under the MIT license.
*/
window.LazyloadImage = (function () {
'use strict';
var FALLBACK_IMAGE = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42gEFAPr/AP///wAI/AL+Sr4t6gAAAABJRU5ErkJggg==';
// create prototype from HTMLImageElement
var LazyloadImagePrototype = Object.create(HTMLImageElement.prototype);
2016-04-24 01:27:12 -04:00
// lifecycle callbacks
2016-04-25 14:33:17 -04:00
//LazyloadImagePrototype.createdCallback = function () {
2016-04-23 15:14:13 -04:00
//};
2016-04-25 22:17:11 -04:00
//LazyloadImagePrototype.attachedCallback = function () {
2016-04-23 15:14:13 -04:00
2016-04-25 22:17:11 -04:00
// var original = this.currentSrc || this.src;
2016-04-23 15:14:13 -04:00
2016-04-25 22:17:11 -04:00
// if (original && window.ImageFetcherLazyloadImage) {
// //console.log(original);
// this.src = FALLBACK_IMAGE;
// console.log('loading ' + original);
// ImageFetcherLazyloadImage.loadImage(this, original);
// }
//};
2016-04-23 15:14:13 -04:00
return document.registerElement('lazyload-image', {
prototype: LazyloadImagePrototype,
extends: 'img'
});
})();
</script>