j1-template 2024.3.13 → 2024.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
- data/_includes/themes/j1/layouts/layout_resource_generator.html +1 -4
- data/_includes/themes/j1/procedures/blocks/footer/boxes/social_media_icons.proc +24 -23
- data/_includes/themes/j1/procedures/layouts/content_writer.proc +4 -3
- data/_includes/themes/j1/procedures/layouts/default_writer.proc +37 -6
- data/_includes/themes/j1/procedures/layouts/module_writer.proc +31 -95
- data/_includes/themes/j1/procedures/layouts/resource_writer.proc +51 -29
- data/assets/data/amplitude.28.html +887 -0
- data/assets/data/amplitude.29.html +923 -0
- data/assets/data/amplitude.html +311 -46
- data/assets/data/banner.html +9 -7
- data/assets/data/masterslider.html +128 -7
- data/assets/data/panel.html +16 -65
- data/assets/theme/j1/adapter/js/amplitude.23.js +1165 -0
- data/assets/theme/j1/adapter/js/amplitude.24.js +1164 -0
- data/assets/theme/j1/adapter/js/amplitude.25.js +1268 -0
- data/assets/theme/j1/adapter/js/amplitude.js +294 -117
- data/assets/theme/j1/adapter/js/attic.js +14 -11
- data/assets/theme/j1/adapter/js/docsearch.js +2 -2
- data/assets/theme/j1/adapter/js/fab.js +2 -2
- data/assets/theme/j1/adapter/js/j1.js +8 -8
- data/assets/theme/j1/adapter/js/lazyLoader.js +60 -10
- data/assets/theme/j1/adapter/js/masonry.js +1 -1
- data/assets/theme/j1/adapter/js/masterslider.js +2 -2
- data/assets/theme/j1/adapter/js/particles.js +2 -2
- data/assets/theme/j1/adapter/js/scroller.js +2 -2
- data/assets/theme/j1/adapter/js/slick.js +2 -2
- data/assets/theme/j1/adapter/js/themes.js +1 -1
- data/assets/theme/j1/adapter/js/translator.js +2 -2
- data/assets/theme/j1/adapter/js/waves.js +1 -1
- data/assets/theme/j1/core/css/animate.css +1634 -1070
- data/assets/theme/j1/core/css/animate.css.map +1 -0
- data/assets/theme/j1/core/css/animate.min.css +2 -1
- data/assets/theme/j1/core/css/animate.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.css +3060 -1538
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/fontawesome.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/iconify.css +2308 -1153
- data/assets/theme/j1/core/css/icon-fonts/iconify.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/iconify.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/iconify.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdi.css +16716 -8423
- data/assets/theme/j1/core/css/icon-fonts/mdi.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdi.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdi.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdib.css +5554 -2766
- data/assets/theme/j1/core/css/icon-fonts/mdib.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdib.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdib.min.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdil.css +742 -441
- data/assets/theme/j1/core/css/icon-fonts/mdil.css.map +1 -0
- data/assets/theme/j1/core/css/icon-fonts/mdil.min.css +2 -1
- data/assets/theme/j1/core/css/icon-fonts/mdil.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css +6552 -3980
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css +2 -5
- data/assets/theme/j1/core/css/themes/bootstrap/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css +6818 -4131
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css +2 -5
- data/assets/theme/j1/core/css/themes/unodark/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css +18568 -11577
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.css.map +1 -0
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css +2 -35
- data/assets/theme/j1/core/css/themes/unolight/bootstrap.min.css.map +1 -0
- data/assets/theme/j1/core/css/vendor.css +1771 -1043
- data/assets/theme/j1/core/css/vendor.css.map +1 -0
- data/assets/theme/j1/core/css/vendor.min.css +2 -1
- data/assets/theme/j1/core/css/vendor.min.css.map +1 -0
- data/assets/theme/j1/core/js/template.js +399 -447
- data/assets/theme/j1/core/js/template.min.js +7 -7
- data/assets/theme/j1/core/js/template.min.js.map +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/amplitude.css +4 -2
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.css +39 -4
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/compact.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.css +57 -17
- data/assets/theme/j1/modules/amplitudejs/css/theme/uno/dark/player/large.min.css +1 -1
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/pause.png +0 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.png +0 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/blue/play.svg +87 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-backward.svg +60 -0
- data/assets/theme/j1/modules/amplitudejs/icons/player/dark/skip-forward.svg +59 -0
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.js +65 -21
- data/assets/theme/j1/modules/amplitudejs/js/amplitude.min.js +1 -1
- data/assets/theme/j1/modules/amplitudejs/js/tech/ytp.js +113 -0
- data/assets/theme/j1/modules/iconPicker/js/universal-icon-picker.js +471 -471
- data/assets/theme/j1/modules/j1LazyLoader/LICENSE +21 -0
- data/assets/theme/j1/modules/j1LazyLoader/js/j1Lazy.js +870 -0
- data/assets/theme/j1/modules/js-cookies/js/js.cookie.js +3 -3
- data/assets/theme/j1/modules/lazyCssLoader/js/main.0.js +166 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/main.1.js +65 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/main.js +66 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/examplePlugin.js +13 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/my-plugin.js +25 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/plugin-interface.js +9 -0
- data/assets/theme/j1/modules/lazyCssLoader/js/plugins/pluginA.js +46 -0
- data/assets/theme/j1/modules/lazyLoader/js/plugins/README.md +324 -0
- data/assets/theme/j1/modules/lazyLoader/js/plugins/jquery.lazy.picture.js +188 -0
- data/assets/theme/j1/modules/lightGallery/js/lightgallery.js +1 -1
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.0.js +794 -0
- data/assets/theme/j1/modules/lightGallery/js/plugins/lg-video.js +151 -67
- data/assets/theme/j1/modules/slimSelect/js/select.js +1 -1
- data/assets/theme/j1/modules/slimSelect/js/select.min.js +3 -3
- data/assets/theme/j1/modules/themeSwitcher/js/switcher.js +2 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/dailymotion.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/plugins/players/dm/icon/scalable/dailymotion.svg +62 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.js +832 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/v3.0.0/youtube.min.js +17 -0
- data/assets/theme/j1/modules/videojs/js/plugins/players/yt/youtube.min.js +1 -1
- data/assets/theme/j1/modules/videojs/js/video.js +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/README.md +577 -560
- data/lib/starter_web/_config.yml +2 -2
- data/lib/starter_web/_data/blocks/footer.yml +10 -5
- data/lib/starter_web/_data/blocks/panel.yml +2 -2
- data/lib/starter_web/_data/layouts/default.yml +14 -3
- data/lib/starter_web/_data/modules/amplitude.yml +145 -0
- data/lib/starter_web/_data/modules/defaults/amplitude.yml +29 -7
- data/lib/starter_web/_data/modules/defaults/lazyLoader.yml +2 -2
- data/lib/starter_web/_data/modules/gallery.yml +136 -0
- data/lib/starter_web/_data/modules/lazyLoader.0.yml +118 -0
- data/lib/starter_web/_data/modules/lazyLoader.yml +68 -31
- data/lib/starter_web/_data/modules/masonry.yml +4 -4
- data/lib/starter_web/_data/modules/masterslider.yml +118 -12
- data/lib/starter_web/_data/modules/navigator_menu.yml +831 -803
- data/lib/starter_web/_data/resources.yml +154 -190
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/amplitude-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/dailymotion-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/gallery-block.rb +4 -2
- data/lib/starter_web/_plugins/asciidoctor/masonry-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/videojs-block.rb +58 -46
- data/lib/starter_web/_plugins/asciidoctor/vimeo-block.rb +26 -19
- data/lib/starter_web/_plugins/asciidoctor/youtube-block.rb +30 -40
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/image/icons/lanus/favicon.ico +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus-512x512.png +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus.ico +0 -0
- data/lib/starter_web/assets/image/icons/lanus/lanus.png +0 -0
- data/lib/starter_web/assets/image/icons/lanus/scalable/lanus.svg +76 -0
- data/lib/starter_web/assets/image/icons/lanus/scalable/lanus_sw.svg +62 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28 - social.svg +86 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x-28.svg +64 -0
- data/lib/starter_web/assets/image/modules/icons/social/scalable/icon-twitter-x.svg +1 -0
- data/lib/starter_web/assets/image/modules/icons/social/twitter_x.png +0 -0
- data/lib/starter_web/package.json +7 -18
- data/lib/starter_web/pages/public/amplitude_yt_tester.adoc +218 -0
- data/lib/starter_web/pages/public/features/template.adoc +18 -8
- data/lib/starter_web/pages/public/features/template.asciidoc +758 -0
- data/lib/starter_web/pages/public/lazy_loader_tester.adoc +402 -0
- data/lib/starter_web/pages/public/manuals/ytdl/man.adoc +3020 -0
- data/lib/starter_web/pages/public/manuals/ytdl/man.md +2378 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/attributes.asciidoc +0 -16
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/amplitudejs.large.css.asciidoc +505 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.hover.html +69 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.nested.html +75 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/frame.textarea.html +57 -0
- data/lib/starter_web/pages/public/tools/previewer/_includes/documents/my.content.html +112 -0
- data/lib/starter_web/pages/public/tools/previewer/preview_amplitudejs.adoc +172 -0
- data/lib/starter_web/pages/public/tour/_includes/attributes.asciidoc +2 -2
- data/lib/starter_web/pages/public/tour/_includes/documents/419_advanced_modals_demo.asciidoc +16 -16
- data/lib/starter_web/pages/public/tour/asciidoc_extensions.adoc +13 -3
- data/lib/starter_web/pages/public/tour/bootstrap_themes.adoc +12 -3
- data/lib/starter_web/pages/public/tour/highlghter_rouge.adoc +13 -3
- data/lib/starter_web/pages/public/tour/icon_fonts.adoc +12 -3
- data/lib/starter_web/pages/public/tour/modal_extentions.adoc +12 -6
- data/lib/starter_web/pages/public/tour/{playback_audio.adoc → play_audio.adoc} +207 -188
- data/lib/starter_web/pages/public/tour/{playback_video.adoc → play_video.adoc} +49 -51
- data/lib/starter_web/pages/public/tour/present_images.adoc +27 -5
- data/lib/starter_web/pages/public/tour/quicksearch.adoc +13 -3
- data/lib/starter_web/pages/public/tour/responsive_tables.adoc +13 -4
- data/lib/starter_web/pages/public/tour/typography.adoc +12 -3
- metadata +90 -22
- /data/assets/theme/j1/modules/{lazyLoader → j1LazyLoader/js}/plugins/README.md +0 -0
- /data/assets/theme/j1/modules/{lazyLoader/plugins/jquery.lazy.picture.js → j1LazyLoader/js/plugins/picture.js} +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.ajax.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.av.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.iframe.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.noop.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.picture.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.script.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.vimeo.min.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.js +0 -0
- /data/assets/theme/j1/modules/lazyLoader/{plugins → js/plugins}/jquery.lazy.youtube.min.js +0 -0
@@ -0,0 +1,324 @@
|
|
1
|
+
### jQuery Lazy - Loader Plugins
|
2
|
+
[![GitHub version](https://badge.fury.io/gh/dkern%2Fjquery.lazy.svg)](http://github.com/dkern/jquery.lazy)
|
3
|
+
[![NPM version](https://badge.fury.io/js/jquery-lazy.svg)](http://www.npmjs.org/package/jquery-lazy)
|
4
|
+
[![Bower version](https://badge.fury.io/bo/jquery-lazy.svg)](http://bower.io/search/?q=jquery-lazy)
|
5
|
+
[![Dependencies Status](https://david-dm.org/dkern/jquery.lazy/status.svg)](https://david-dm.org/dkern/jquery.lazy)
|
6
|
+
[![devDependencies Status](https://david-dm.org/dkern/jquery.lazy/dev-status.svg)](https://david-dm.org/dkern/jquery.lazy?type=dev)
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
### Table of Contents
|
11
|
+
* [Document Note](#document-note)
|
12
|
+
* [About Loader Plugins](#about-loader-plugins)
|
13
|
+
* [Create an own Loader Plugin](#create-an-own-loader-plugin)
|
14
|
+
* [AJAX Loader](#ajax-loader)
|
15
|
+
* [Audio / Video Loader](#audio--video-loader)
|
16
|
+
* [iFrame Loader](#iframe-loader)
|
17
|
+
* [NOOP Loader](#noop-loader)
|
18
|
+
* [Picture Loader](#picture-loader)
|
19
|
+
* [JS / Script Loader](#js--script-loader)
|
20
|
+
* [Vimeo Video Loader](#vimeo-video-loader)
|
21
|
+
* [YouTube Video Loader](#youtube-video-loader)
|
22
|
+
* [Bugs / Feature request](#bugs--feature-request)
|
23
|
+
* [License](#license)
|
24
|
+
* [Donation](#donation)
|
25
|
+
|
26
|
+
---
|
27
|
+
|
28
|
+
## Document Note
|
29
|
+
This is not the main readme file of this project.
|
30
|
+
Please go to the [project root](https://github.com/dkern/jquery.lazy) and take a look in the [README.md](https://github.com/dkern/jquery.lazy/blob/master/README.md) to learn more about the basics of Lazy.
|
31
|
+
|
32
|
+
|
33
|
+
## About Loader Plugins
|
34
|
+
The loader plugins for Lazy can be used whenever you want to extend the basic functionality by default or globally for many instances of Lazy.
|
35
|
+
Just add the plugins you want to use or a combined file, containing all plugins, to your page and all instances can use the plugins from now on.
|
36
|
+
```HTML
|
37
|
+
<!-- as single plugin files -->
|
38
|
+
<script type="text/javascript" src="jquery.lazy.min.js"></script>
|
39
|
+
<script type="text/javascript" src="plugins/jquery.lazy.ajax.min.js"></script>
|
40
|
+
<script type="text/javascript" src="plugins/jquery.lazy.av.min.js"></script>
|
41
|
+
<script type="text/javascript" src="plugins/jquery.lazy.iframe.min.js"></script>
|
42
|
+
<script type="text/javascript" src="plugins/jquery.lazy.noop.min.js"></script>
|
43
|
+
<script type="text/javascript" src="plugins/jquery.lazy.picture.min.js"></script>
|
44
|
+
<script type="text/javascript" src="plugins/jquery.lazy.script.min.js"></script>
|
45
|
+
<script type="text/javascript" src="plugins/jquery.lazy.vimeo.min.js"></script>
|
46
|
+
<script type="text/javascript" src="plugins/jquery.lazy.youtube.min.js"></script>
|
47
|
+
|
48
|
+
<!-- or combined in one file -->
|
49
|
+
<script type="text/javascript" src="jquery.lazy.min.js"></script>
|
50
|
+
<script type="text/javascript" src="jquery.lazy.plugins.min.js"></script>
|
51
|
+
```
|
52
|
+
|
53
|
+
|
54
|
+
## Create an own Loader Plugin
|
55
|
+
If you want to, you can easily create own loader plugins.
|
56
|
+
Just use jQuery or Zepto's public function `Lazy` to create and register them.
|
57
|
+
Best practice is to wrap everything by an [IIFE](https://en.wikipedia.org/wiki/Immediately-invoked_function_expression).
|
58
|
+
```JS
|
59
|
+
(function($) {
|
60
|
+
$.Lazy("pluginName", function(element, response) {
|
61
|
+
// add your logic here
|
62
|
+
|
63
|
+
// 'this' is the current instance of Lazy
|
64
|
+
// so it's possible to access all public functions, like:
|
65
|
+
var imageBase = this.config("imageBase");
|
66
|
+
});
|
67
|
+
})(window.jQuery || window.Zepto);
|
68
|
+
```
|
69
|
+
|
70
|
+
This loader can now be called on every element with the attribute `data-loader` (_by default_), like:
|
71
|
+
```HTML
|
72
|
+
<div data-loader="pluginName"></div>
|
73
|
+
```
|
74
|
+
|
75
|
+
It's possible to register a plugin with more than one name / alias.
|
76
|
+
```JS
|
77
|
+
(function($) {
|
78
|
+
$.Lazy(["pluginName", "anotherPluginName"], function(element, response) {
|
79
|
+
// the plugin is now available by 'data-loader="pluginLoaderName"'
|
80
|
+
// and 'data-loader="anotherLoaderName"'
|
81
|
+
});
|
82
|
+
})(window.jQuery || window.Zepto);
|
83
|
+
```
|
84
|
+
|
85
|
+
The optional second parameter gives you the ability to register a plugin by default to an element type.
|
86
|
+
When you do this, there is no need to set the `data-loader` attribute on each element you want to use this loader on.
|
87
|
+
|
88
|
+
But keep in mind, if you register an plugin on often used elements, like `<div>`, Lazy will try to handle each of them!
|
89
|
+
If you want to do so anyway, use a most specific selector for jQuery or Zepto.
|
90
|
+
```JS
|
91
|
+
(function($) {
|
92
|
+
$.Lazy("av", ["audio", "video"], function(element, response) {
|
93
|
+
// this plugin will automatically handle '<audio>' and '<video>' elements,
|
94
|
+
// even when no 'data-loader' attribute was set on the elements
|
95
|
+
});
|
96
|
+
})(window.jQuery || window.Zepto);
|
97
|
+
```
|
98
|
+
|
99
|
+
For more examples, take a look at the [existing plugins](https://github.com/dkern/jquery.lazy/tree/master/plugins).
|
100
|
+
|
101
|
+
|
102
|
+
## AJAX Loader
|
103
|
+
**Names:** `ajax`, `get`, `post`, `put`
|
104
|
+
**Parameters:** `data-src`, `data-method`, `data-type`
|
105
|
+
**Default for:** -
|
106
|
+
|
107
|
+
The AJAX loader can receive data from a given url and paste the response to the inner html of the element.
|
108
|
+
This is useful, when you want do load a bigger amount of content.
|
109
|
+
Use `ajax` as the loader name by default.
|
110
|
+
But there are even some shorthand names for specific request types `GET`, `POST` and `PUT` too.
|
111
|
+
```HTML
|
112
|
+
<!-- simple GET request -->
|
113
|
+
<div data-loader="ajax" data-src="ajax.html"></div>
|
114
|
+
|
115
|
+
<!-- simple post request with configurable response type -->
|
116
|
+
<div data-loader="ajax" data-src="ajax.html" data-method="post" data-type="html"></div>
|
117
|
+
|
118
|
+
<!-- GET request -->
|
119
|
+
<div data-loader="get" data-src="ajax.html"></div>
|
120
|
+
|
121
|
+
<!-- POST request-->
|
122
|
+
<div data-loader="post" data-src="ajax.html"></div>
|
123
|
+
|
124
|
+
<!-- PUT request-->
|
125
|
+
<div data-loader="put" data-src="ajax.html"></div>
|
126
|
+
```
|
127
|
+
|
128
|
+
On `POST` and `PUT` requests, the callback `ajaxCreateData` will be executed before every AJAX call.
|
129
|
+
If used, the callback function should return the value for the `data` parameter of jQuery's AJAX function.
|
130
|
+
```HTML
|
131
|
+
<div data-loader="post" data-src="ajax.html" data-value="post-data"></div>
|
132
|
+
```
|
133
|
+
|
134
|
+
```JS
|
135
|
+
$('div').Lazy({
|
136
|
+
ajaxCreateData: function(element) {
|
137
|
+
return {name: element.data('value')};
|
138
|
+
}
|
139
|
+
});
|
140
|
+
```
|
141
|
+
|
142
|
+
|
143
|
+
## Audio / Video Loader
|
144
|
+
**Names:** `av`, `audio`, `video`
|
145
|
+
**Parameters:** `data-src`, `data-poster`
|
146
|
+
**Default for:** `<audio>`, `<video>`
|
147
|
+
|
148
|
+
Loads `<audio>` and `<video>` elements and attach the sources and tracks in the right order.
|
149
|
+
There are two ways you can prepare your audio and/or video tags.
|
150
|
+
First way is to add all sources by `data-src` attribute, separated by comma and type by pipe on the element.
|
151
|
+
```HTML
|
152
|
+
<audio data-src="file.ogg|audio/ogg,file.mp3|audio/mp3,file.wav|audio/wav"></audio>
|
153
|
+
<video data-src="file.ogv|video/ogv,file.mp4|video/mp4,file.webm|video/webm" data-poster="poster.jpg"></video>
|
154
|
+
```
|
155
|
+
|
156
|
+
The other way is to add the sources and tracks like default, as child elements.
|
157
|
+
```HTML
|
158
|
+
<audio>
|
159
|
+
<data-src src="file.ogg" type="audio/ogg"></data-src>
|
160
|
+
<data-src src="file.mp3" type="audio/mp3"></data-src>
|
161
|
+
<data-src src="file.wav" type="audio/wav"></data-src>
|
162
|
+
</audio>
|
163
|
+
|
164
|
+
<video data-poster="poster.jpg">
|
165
|
+
<data-src src="file.ogv" type="video/ogv"></data-src>
|
166
|
+
<data-src src="file.mp4" type="video/mp4"></data-src>
|
167
|
+
<data-src src="file.webm" type="video/webm"></data-src>
|
168
|
+
<data-track kind="captions" src="captions.vtt" srclang="en"></data-track>
|
169
|
+
<data-track kind="descriptions" src="descriptions.vtt" srclang="en"></data-track>
|
170
|
+
<data-track kind="subtitles" src="subtitles.vtt" srclang="de"></data-track>
|
171
|
+
</video>
|
172
|
+
```
|
173
|
+
|
174
|
+
|
175
|
+
## iFrame Loader
|
176
|
+
**Names:** `frame`, `iframe`
|
177
|
+
**Parameters:** `data-src`, `data-error-detect`
|
178
|
+
**Default for:** `<iframe>`
|
179
|
+
|
180
|
+
Loads `<iframe>` contents.
|
181
|
+
The default will return a successfull load, even if the iframe url is not reachable (_like on 404 or wrong url_), because there is no way to check the loaded content in javascript.
|
182
|
+
It might be the fastest and safest way to do that.
|
183
|
+
If you know the requested path is reachable every time or don't care about error checks, you should use this way!
|
184
|
+
```HTML
|
185
|
+
<iframe data-src="iframe.html"></iframe>
|
186
|
+
```
|
187
|
+
|
188
|
+
The second way is more professional and support error checks.
|
189
|
+
It will load the content by AJAX and checks the response.
|
190
|
+
Afterwards pass the HTML content to iframe inner and set the correct url.
|
191
|
+
This is a very secure check, but could be a bit more tricky on some use cases.
|
192
|
+
You should only use this on the same domain origin.
|
193
|
+
|
194
|
+
To enable this feature, set the attribute `data-error-detect` to `true` or `1` on the iframe element.
|
195
|
+
```HTML
|
196
|
+
<iframe data-loader="iframe" data-src="iframe.html" data-error-detect="true"></iframe>
|
197
|
+
```
|
198
|
+
|
199
|
+
|
200
|
+
## NOOP Loader
|
201
|
+
**Names:** `noop`, `noop-success`, `noop-error`
|
202
|
+
**Parameters:** -
|
203
|
+
**Default for:** -
|
204
|
+
|
205
|
+
The NOOP (_or no-operations_) loader will, like the name said, do nothing.
|
206
|
+
There will even be no callbacks triggered, like `beforeLoad` or `onError`, when using a NOOP` loader.
|
207
|
+
It could be useful for developers or to simple, secure and fast disable some other loaders.
|
208
|
+
It can be used with all elements.
|
209
|
+
```HTML
|
210
|
+
<div data-loader="noop"></div>
|
211
|
+
```
|
212
|
+
|
213
|
+
There are two other NOOP loaders, helping to debug your code.
|
214
|
+
The `noop-success` and `noop-error` loaders will return the current state to Lazy and trigger the right callbacks.
|
215
|
+
```HTML
|
216
|
+
<!-- triggers the 'afterLoad' and 'onFinishedAll' callback -->
|
217
|
+
<div data-loader="noop-success"></div>
|
218
|
+
|
219
|
+
<!-- triggers the 'onError' and 'onFinishedAll' callback -->
|
220
|
+
<div data-loader="noop-error"></div>
|
221
|
+
```
|
222
|
+
|
223
|
+
|
224
|
+
## Picture Loader
|
225
|
+
**Names:** `pic`, `picture`
|
226
|
+
**Parameters:** `data-src`, `data-srcset`, `data-media`, `data-sizes`
|
227
|
+
**Default for:** `<picture>`
|
228
|
+
|
229
|
+
Loads `<picture>` elements and attach the sources.
|
230
|
+
There are two ways you can prepare your picture tags.
|
231
|
+
First way is to create all child elements from a single line:
|
232
|
+
```HTML
|
233
|
+
<picture data-src="default.jpg" data-srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" data-media="(min-width: 600px)" data-type="image/jpeg" />
|
234
|
+
```
|
235
|
+
|
236
|
+
The other way is to add the sources like default, as child elements.
|
237
|
+
```HTML
|
238
|
+
<picture>
|
239
|
+
<data-src srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" media="(min-width: 600px)" type="image/jpeg"></data-src>
|
240
|
+
<data-img src="default.jpg"></data-img>
|
241
|
+
</picture>
|
242
|
+
|
243
|
+
<picture data-src="default.jpg">
|
244
|
+
<data-src srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" media="(min-width: 600px)" type="image/jpeg"></data-src>
|
245
|
+
</picture>
|
246
|
+
```
|
247
|
+
|
248
|
+
|
249
|
+
## JS / Script Loader
|
250
|
+
**Names:** `js`, `javascript`, `script`
|
251
|
+
**Parameters:** `data-src`
|
252
|
+
**Default for:** `<script>`
|
253
|
+
|
254
|
+
Loads javascript files on `<script>` element.
|
255
|
+
Change the element like the example below, and the files will be loaded automatically after page load.
|
256
|
+
```HTML
|
257
|
+
<script data-src="script.js" type="text/javascript"></script>
|
258
|
+
```
|
259
|
+
|
260
|
+
**Note:**
|
261
|
+
The viewport detection is not correct in some browsers.
|
262
|
+
So it could happen, that all script files get loaded right after page load, and not when the user scrolls to them.
|
263
|
+
|
264
|
+
|
265
|
+
## Vimeo Video Loader
|
266
|
+
**Names:** `vimeo`
|
267
|
+
**Parameters:** `data-src`
|
268
|
+
**Default for:** -
|
269
|
+
|
270
|
+
Loads vimeo videos in an `<iframe>`.
|
271
|
+
This is the suggested way by vimeo itself.
|
272
|
+
You can prepare the `<iframe>` element as you would do without Lazy.
|
273
|
+
Only add the vimeo video id to the attribute `data-src` and add the loader name.
|
274
|
+
That's all.
|
275
|
+
```HTML
|
276
|
+
<iframe data-loader="vimeo" data-src="176894130" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
277
|
+
```
|
278
|
+
|
279
|
+
**Please keep in mind:**
|
280
|
+
Because this is an iframe and there is no feedback javascript could check on, this loader can only return success to Lazy.
|
281
|
+
There is no way to check if the video was loaded correctly or your provided video id is existing.
|
282
|
+
|
283
|
+
|
284
|
+
## YouTube Video Loader
|
285
|
+
**Names:** `yt`, `youtube`
|
286
|
+
**Parameters:** `data-src`, `data-nocookie`
|
287
|
+
**Default for:** -
|
288
|
+
|
289
|
+
Loads youtube videos in an `<iframe>`.
|
290
|
+
This is the suggested way by youtube itself.
|
291
|
+
You can prepare the `<iframe>` element as you would do without Lazy.
|
292
|
+
Only add the youtube video id to the attribute `data-src` and add the loader name.
|
293
|
+
That's all.
|
294
|
+
|
295
|
+
```HTML
|
296
|
+
<iframe data-loader="youtube" data-src="1AYGnw6MwFM" width="560" height="315" frameborder="0"></iframe>
|
297
|
+
```
|
298
|
+
|
299
|
+
If you want to, you can control the cookie behavior of the embedded video with `data-nocookie="1"`.
|
300
|
+
This would change the url to `youtube-nocookie.com` instead of `youtube.com`.
|
301
|
+
|
302
|
+
```HTML
|
303
|
+
<iframe data-loader="youtube" data-src="1AYGnw6MwFM" data-nocookie="1" width="560" height="315" frameborder="0"></iframe>
|
304
|
+
```
|
305
|
+
|
306
|
+
**Please keep in mind:**
|
307
|
+
Because this is an iframe and there is no feedback javascript could check on, this loader can only return success to Lazy.
|
308
|
+
There is no way to check if the video was loaded correctly or your provided video id is existing.
|
309
|
+
|
310
|
+
|
311
|
+
## Bugs / Feature request
|
312
|
+
Please [report](http://github.com/dkern/jquery.lazy/issues) bugs and feel free to [ask](http://github.com/dkern/jquery.lazy/issues) for new features and loaders directly on GitHub.
|
313
|
+
|
314
|
+
|
315
|
+
## License
|
316
|
+
Lazy plugins are dual-licensed under [MIT](http://www.opensource.org/licenses/mit-license.php) and [GPL-2.0](http://www.gnu.org/licenses/gpl-2.0.html) license.
|
317
|
+
|
318
|
+
|
319
|
+
## Donation
|
320
|
+
_You like to support me?_
|
321
|
+
_You appreciate my work?_
|
322
|
+
_You use it in commercial projects?_
|
323
|
+
|
324
|
+
Feel free to make a little [donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FFL6VQJCUZMXC)! :wink:
|
@@ -0,0 +1,188 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery & Zepto Lazy - Picture Plugin - v1.3
|
3
|
+
* http://jquery.eisbehr.de/lazy/
|
4
|
+
*
|
5
|
+
* Copyright 2012 - 2018, Daniel 'Eisbehr' Kern
|
6
|
+
*
|
7
|
+
* Dual licensed under the MIT and GPL-2.0 licenses:
|
8
|
+
* http://www.opensource.org/licenses/mit-license.php
|
9
|
+
* http://www.gnu.org/licenses/gpl-2.0.html
|
10
|
+
*/
|
11
|
+
;(function($) {
|
12
|
+
var srcAttr = 'data-src',
|
13
|
+
srcsetAttr = 'data-srcset',
|
14
|
+
mediaAttr = 'data-media',
|
15
|
+
sizesAttr = 'data-sizes',
|
16
|
+
typeAttr = 'data-type';
|
17
|
+
|
18
|
+
// loads picture elements like:
|
19
|
+
// <picture>
|
20
|
+
// <data-src srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" media="(min-width: 600px)" type="image/jpeg"></data-src>
|
21
|
+
// <data-src srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" media="(min-width: 400px)" type="image/jpeg"></data-src>
|
22
|
+
// <data-img src="default.jpg" >
|
23
|
+
// </picture>
|
24
|
+
//
|
25
|
+
// or:
|
26
|
+
// <picture data-src="default.jpg">
|
27
|
+
// <data-src srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" media="(min-width: 600px)" type="image/jpeg"></data-src>
|
28
|
+
// <data-src srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" media="(min-width: 400px)" type="image/jpeg"></data-src>
|
29
|
+
// </picture>
|
30
|
+
//
|
31
|
+
// or just with attributes in one line:
|
32
|
+
// <picture data-src="default.jpg" data-srcset="1x.jpg 1x, 2x.jpg 2x, 3x.jpg 3x" data-media="(min-width: 600px)" data-sizes="" data-type="image/jpeg" />
|
33
|
+
$.lazy(['pic', 'picture'], ['picture'], function(element, response) {
|
34
|
+
var elementTagName = element[0].tagName.toLowerCase();
|
35
|
+
|
36
|
+
if (elementTagName === 'picture') {
|
37
|
+
var sources = element.find(srcAttr),
|
38
|
+
image = element.find('data-img'),
|
39
|
+
imageBase = this.config('imageBase') || '';
|
40
|
+
|
41
|
+
// handle as child elements
|
42
|
+
if (sources.length) {
|
43
|
+
sources.each(function() {
|
44
|
+
renameElementTag($(this), 'source', imageBase);
|
45
|
+
});
|
46
|
+
|
47
|
+
// create img tag from child
|
48
|
+
if (image.length === 1) {
|
49
|
+
image = renameElementTag(image, 'img', imageBase);
|
50
|
+
|
51
|
+
// bind event callbacks to new image tag
|
52
|
+
image.on('load', function() {
|
53
|
+
response(true);
|
54
|
+
}).on('error', function() {
|
55
|
+
response(false);
|
56
|
+
});
|
57
|
+
|
58
|
+
image.attr('src', image.attr(srcAttr));
|
59
|
+
|
60
|
+
if (this.config('removeAttribute')) {
|
61
|
+
image.removeAttr(srcAttr);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
// create img tag from attribute
|
66
|
+
else if (element.attr(srcAttr)) {
|
67
|
+
// create image tag
|
68
|
+
createImageObject(element, imageBase + element.attr(srcAttr), response);
|
69
|
+
|
70
|
+
if (this.config('removeAttribute')) {
|
71
|
+
element.removeAttr(srcAttr);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
// pass error state
|
76
|
+
else {
|
77
|
+
// use response function for Zepto
|
78
|
+
response(false);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
// handle as attributes
|
83
|
+
else if( element.attr(srcsetAttr) ) {
|
84
|
+
// create source elements before img tag
|
85
|
+
$('<source>').attr({
|
86
|
+
media: element.attr(mediaAttr),
|
87
|
+
sizes: element.attr(sizesAttr),
|
88
|
+
type: element.attr(typeAttr),
|
89
|
+
srcset: getCorrectedSrcSet(element.attr(srcsetAttr), imageBase)
|
90
|
+
})
|
91
|
+
.appendTo(element);
|
92
|
+
|
93
|
+
// create image tag
|
94
|
+
createImageObject(element, imageBase + element.attr(srcAttr), response);
|
95
|
+
|
96
|
+
// remove attributes from parent picture element
|
97
|
+
if (this.config('removeAttribute')) {
|
98
|
+
element.removeAttr(srcAttr + ' ' + srcsetAttr + ' ' + mediaAttr + ' ' + sizesAttr + ' ' + typeAttr);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
// pass error state
|
103
|
+
else {
|
104
|
+
// use response function for Zepto
|
105
|
+
response(false);
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
else {
|
110
|
+
// pass error state
|
111
|
+
// use response function for Zepto
|
112
|
+
response(false);
|
113
|
+
}
|
114
|
+
});
|
115
|
+
|
116
|
+
/**
|
117
|
+
* create a new child element and copy attributes
|
118
|
+
* @param {jQuery|object} element
|
119
|
+
* @param {string} toType
|
120
|
+
* @param {string} imageBase
|
121
|
+
* @return {jQuery|object}
|
122
|
+
*/
|
123
|
+
function renameElementTag(element, toType, imageBase) {
|
124
|
+
var attributes = element.prop('attributes'),
|
125
|
+
target = $('<' + toType + '>');
|
126
|
+
|
127
|
+
$.each(attributes, function(index, attribute) {
|
128
|
+
// build srcset with image base
|
129
|
+
if (attribute.name === 'srcset' || attribute.name === srcAttr) {
|
130
|
+
attribute.value = getCorrectedSrcSet(attribute.value, imageBase);
|
131
|
+
}
|
132
|
+
|
133
|
+
target.attr(attribute.name, attribute.value);
|
134
|
+
});
|
135
|
+
|
136
|
+
element.replaceWith(target);
|
137
|
+
return target;
|
138
|
+
}
|
139
|
+
|
140
|
+
/**
|
141
|
+
* create a new image element inside parent element
|
142
|
+
* @param {jQuery|object} parent
|
143
|
+
* @param {string} src
|
144
|
+
* @param {function} response
|
145
|
+
* @return void
|
146
|
+
*/
|
147
|
+
function createImageObject(parent, src, response) {
|
148
|
+
// create image tag
|
149
|
+
var imageObj = $('<img>')
|
150
|
+
|
151
|
+
// create image tag an bind callbacks for correct response
|
152
|
+
.one('load', function() {
|
153
|
+
response(true);
|
154
|
+
})
|
155
|
+
.one('error', function() {
|
156
|
+
response(false);
|
157
|
+
})
|
158
|
+
|
159
|
+
// set into picture element
|
160
|
+
.appendTo(parent)
|
161
|
+
|
162
|
+
// set src attribute at last to prevent early kick-in
|
163
|
+
.attr('src', src);
|
164
|
+
|
165
|
+
// call after load even on cached image
|
166
|
+
imageObj.complete && imageObj.load(); // jshint ignore : line
|
167
|
+
}
|
168
|
+
|
169
|
+
/**
|
170
|
+
* prepend image base to all srcset entries
|
171
|
+
* @param {string} srcset
|
172
|
+
* @param {string} imageBase
|
173
|
+
* @returns {string}
|
174
|
+
*/
|
175
|
+
function getCorrectedSrcSet(srcset, imageBase) {
|
176
|
+
if (imageBase) {
|
177
|
+
// trim, remove unnecessary spaces and split entries
|
178
|
+
var entries = srcset.split(',');
|
179
|
+
srcset = '';
|
180
|
+
|
181
|
+
for (var i = 0, l = entries.length; i < l; i++) {
|
182
|
+
srcset += imageBase + entries[i].trim() + (i !== l - 1 ? ',' : '');
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
return srcset;
|
187
|
+
}
|
188
|
+
})(window.jQuery || window.Zepto);
|
@@ -1641,7 +1641,7 @@
|
|
1641
1641
|
_this.settings.loadYouTubePoster &&
|
1642
1642
|
!element.poster &&
|
1643
1643
|
element.__slideVideoInfo.youtube) {
|
1644
|
-
element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/
|
1644
|
+
element.poster = "//img.youtube.com/vi/" + element.__slideVideoInfo.youtube[1] + "/mqdefault.jpg";
|
1645
1645
|
}
|
1646
1646
|
});
|
1647
1647
|
};
|