j1-template 2020.0.2 → 2020.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/_includes/themes/j1/modules/navigator/generator.html +24 -18
  3. data/assets/data/menu.html +4 -4
  4. data/assets/data/mmenu.html +455 -0
  5. data/assets/themes/j1/core/css/bootstrap.css +116 -93
  6. data/assets/themes/j1/core/css/bootstrap.min.css +4 -4
  7. data/assets/themes/j1/core/css/theme_extensions.css +11 -22
  8. data/assets/themes/j1/core/css/theme_extensions.min.css +1 -1
  9. data/assets/themes/j1/core/css/uno.css +11 -22
  10. data/assets/themes/j1/core/css/uno.min.css +1 -1
  11. data/assets/themes/j1/core/css/vendor.css +130 -104
  12. data/assets/themes/j1/core/css/vendor.min.css +4 -4
  13. data/assets/themes/j1/core/js/template.js +296 -24
  14. data/assets/themes/j1/core/js/template.js.map +1 -1
  15. data/assets/themes/j1/core/js/template.min.js +1 -1
  16. data/lib/j1/version.rb +1 -1
  17. data/lib/j1_app/j1_auth_manager/auth_manager.rb +8 -0
  18. data/lib/starter_web/Gemfile +1 -1
  19. data/lib/starter_web/_config.yml +1 -1
  20. data/lib/starter_web/_data/modules/defaults/navigator.yml +27 -4
  21. data/lib/starter_web/_data/modules/navigator.yml +7 -1
  22. data/lib/starter_web/_data/resources.yml +44 -5
  23. data/lib/starter_web/apps/public/{cc → cc/cc.yml} +0 -0
  24. data/lib/starter_web/apps/public/cc/index.adoc +107 -0
  25. data/lib/starter_web/assets/themes/j1/adapter/js/algolia.js +321 -0
  26. data/lib/starter_web/assets/themes/j1/adapter/js/mmenu.js +269 -0
  27. data/lib/starter_web/assets/themes/j1/adapter/js/navigator.js +21 -15
  28. data/lib/starter_web/assets/themes/j1/extensions/mmenu-light/css/mmenu-light.css +384 -0
  29. data/lib/starter_web/assets/themes/j1/extensions/mmenu-light/css/mmenu-light.min.css +10 -0
  30. data/lib/starter_web/assets/themes/j1/extensions/mmenu-light/js/mmenu-light.js +213 -0
  31. data/lib/starter_web/assets/themes/j1/extensions/mmenu-light/js/mmenu-light.min.js +205 -0
  32. data/lib/starter_web/assets/themes/j1/extensions/mmenu-light/js/mmenu-light.polyfills.js +118 -0
  33. data/lib/starter_web/package.json +1 -1
  34. data/lib/starter_web/pages/public/site_search.adoc +196 -0
  35. data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
  36. data/lib/starter_web/utilsrv/package.json +1 -1
  37. metadata +13 -3
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Mmenu Light
3
+ * mmenujs.com/mmenu-light v3.0.4
4
+ *
5
+ * Copyright (c) Fred Heusschen
6
+ * www.frebsite.nl
7
+ *
8
+ * License: CC-BY-4.0
9
+ * http://creativecommons.org/licenses/by/4.0/
10
+ */:root{--mm-ocd-width:80%;--mm-ocd-min-width:200px;--mm-ocd-max-width:440px}body.mm-ocd-opened{overflow-y:hidden;-ms-scroll-chaining:none;overscroll-behavior:none}.mm-ocd{position:fixed;top:0;right:0;bottom:100%;left:0;z-index:9999;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:contain;background:rgba(0,0,0,0);-webkit-transition-property:bottom,background-color;-o-transition-property:bottom,background-color;transition-property:bottom,background-color;-webkit-transition-duration:0s,.3s;-o-transition-duration:0s,.3s;transition-duration:0s,.3s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-delay:.45s,.15s;-o-transition-delay:.45s,.15s;transition-delay:.45s,.15s}.mm-ocd--open{bottom:0;background:rgba(0,0,0,.25);-webkit-transition-delay:0s;-o-transition-delay:0s;transition-delay:0s}.mm-ocd__content{position:absolute;top:0;bottom:0;z-index:2;width:80%;width:var(--mm-ocd-width);min-width:200px;min-width:var(--mm-ocd-min-width);max-width:440px;max-width:var(--mm-ocd-max-width);background:#fff;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;-o-transition-property:transform;transition-property:transform;transition-property:transform,-webkit-transform;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.mm-ocd--left .mm-ocd__content{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.mm-ocd--right .mm-ocd__content{right:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.mm-ocd--open .mm-ocd__content{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mm-ocd__backdrop{position:absolute;top:0;bottom:0;z-index:3;width:calc(100% - 80%);width:calc(100% - var(--mm-ocd-width));min-width:calc(100% - 440px);min-width:calc(100% - var(--mm-ocd-max-width));max-width:calc(100% - 200px);max-width:calc(100% - var(--mm-ocd-min-width));background:rgba(3,2,1,0)}.mm-ocd--left .mm-ocd__backdrop{right:0}.mm-ocd--right .mm-ocd__backdrop{left:0}.mm-spn,.mm-spn a,.mm-spn li,.mm-spn span,.mm-spn ul{display:block;padding:0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}:root{--mm-spn-item-height:50px;--mm-spn-item-indent:20px;--mm-spn-line-height:24px}.mm-spn{width:100%;height:100%;-webkit-tap-highlight-color:transparent;-webkit-overflow-scrolling:touch;overflow:hidden;-webkit-clip-path:inset(0 0 0 0);clip-path:inset(0 0 0 0);-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0)}.mm-spn ul{-webkit-overflow-scrolling:touch;position:fixed;top:0;left:100%;bottom:0;z-index:2;width:130%;padding-right:30%;line-height:24px;line-height:var(--mm-spn-line-height);overflow:visible;overflow-y:auto;background:inherit;-webkit-transition:left .3s ease 0s;-o-transition:left .3s ease 0s;transition:left .3s ease 0s;cursor:default}.mm-spn ul:after{content:'';display:block;height:50px;height:var(--mm-spn-item-height)}.mm-spn>ul{left:0}.mm-spn ul.mm-spn--open{left:0}.mm-spn ul.mm-spn--parent{left:-30%;overflow-y:hidden}.mm-spn li{position:relative;background:inherit;cursor:pointer}.mm-spn li:before{content:'';display:block;position:absolute;top:25px;top:calc(var(--mm-spn-item-height)/ 2);right:25px;right:calc(var(--mm-spn-item-height)/ 2);z-index:0;width:10px;height:10px;border-top:2px solid;border-right:2px solid;-webkit-transform:rotate(45deg) translate(0,-50%);-ms-transform:rotate(45deg) translate(0,-50%);transform:rotate(45deg) translate(0,-50%);opacity:.4}.mm-spn li:after{content:'';display:block;margin-left:20px;margin-left:var(--mm-spn-item-indent);border-top:1px solid;opacity:.15}.mm-spn a,.mm-spn span{position:relative;z-index:1;padding:13px 20px;padding:calc((var(--mm-spn-item-height) - var(--mm-spn-line-height))/ 2) var(--mm-spn-item-indent)}.mm-spn a{background:inherit;color:inherit;text-decoration:none}.mm-spn a:not(:last-child){width:calc(100% - 50px);width:calc(100% - var(--mm-spn-item-height))}.mm-spn a:not(:last-child):after{content:'';display:block;position:absolute;top:0;right:0;bottom:0;border-right:1px solid;opacity:.15}.mm-spn span{background:0}.mm-spn.mm-spn--navbar{cursor:pointer}.mm-spn.mm-spn--navbar:before{content:'';display:block;position:absolute;top:25px;top:calc(var(--mm-spn-item-height)/ 2);left:20px;left:var(--mm-spn-item-indent);width:10px;height:10px;margin-top:2px;border-top:2px solid;border-left:2px solid;-webkit-transform:rotate(-45deg) translate(50%,-50%);-ms-transform:rotate(-45deg) translate(50%,-50%);transform:rotate(-45deg) translate(50%,-50%);opacity:.4}.mm-spn.mm-spn--navbar.mm-spn--main{cursor:default}.mm-spn.mm-spn--navbar.mm-spn--main:before{content:none;display:none}.mm-spn.mm-spn--navbar:after{content:attr(data-mm-spn-title);display:block;position:absolute;top:0;left:0;right:0;height:50px;height:var(--mm-spn-item-height);padding:0 40px;padding:0 calc(var(--mm-spn-item-indent) * 2);line-height:50px;line-height:var(--mm-spn-item-height);opacity:.4;text-align:center;overflow:hidden;white-space:nowrap;-o-text-overflow:ellipsis;text-overflow:ellipsis}.mm-spn.mm-spn--navbar.mm-spn--main:after{padding-left:20px;padding-left:var(--mm-spn-item-indent)}.mm-spn.mm-spn--navbar ul{top:51px;top:calc(var(--mm-spn-item-height)+1px)}.mm-spn.mm-spn--navbar ul:before{content:'';display:block;position:fixed;top:inherit;z-index:2;width:100%;border-top:1px solid currentColor;opacity:.15}.mm-spn.mm-spn--light{color:#444;background:#f3f3f3}.mm-spn.mm-spn--dark{color:#ddd;background:#333}.mm-spn.mm-spn--vertical{overflow-y:auto}.mm-spn.mm-spn--vertical ul{width:100%;padding-right:0;position:static}.mm-spn.mm-spn--vertical ul ul{display:none;padding-left:20px;padding-left:var(--mm-spn-item-indent)}.mm-spn.mm-spn--vertical ul ul:after{height:25px;height:calc(var(--mm-spn-item-height)/ 2)}.mm-spn.mm-spn--vertical ul.mm-spn--open{display:block}.mm-spn.mm-spn--vertical li.mm-spn--open:before{-webkit-transform:rotate(135deg) translate(-50%,0);-ms-transform:rotate(135deg) translate(-50%,0);transform:rotate(135deg) translate(-50%,0)}.mm-spn.mm-spn--vertical ul ul li:last-child:after{content:none;display:none}
@@ -0,0 +1,213 @@
1
+ /*!
2
+ * Mmenu Light
3
+ * mmenujs.com/mmenu-light v3.0.4
4
+ *
5
+ * Copyright (c) Fred Heusschen
6
+ * www.frebsite.nl
7
+ *
8
+ * License: CC-BY-4.0
9
+ * http://creativecommons.org/licenses/by/4.0/
10
+ */
11
+ ! function (t) {
12
+ var e = {};
13
+
14
+ function n(i) {
15
+ if (e[i]) return e[i].exports;
16
+ var s = e[i] = {
17
+ i: i,
18
+ l: !1,
19
+ exports: {}
20
+ };
21
+ return t[i].call(s.exports, s, s.exports, n), s.l = !0, s.exports
22
+ }
23
+ n.m = t, n.c = e, n.d = function (t, e, i) {
24
+ n.o(t, e) || Object.defineProperty(t, e, {
25
+ enumerable: !0,
26
+ get: i
27
+ })
28
+ }, n.r = function (t) {
29
+ "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
30
+ value: "Module"
31
+ }), Object.defineProperty(t, "__esModule", {
32
+ value: !0
33
+ })
34
+ }, n.t = function (t, e) {
35
+ if (1 & e && (t = n(t)), 8 & e) return t;
36
+ if (4 & e && "object" == typeof t && t && t.__esModule) return t;
37
+ var i = Object.create(null);
38
+ if (n.r(i), Object.defineProperty(i, "default", {
39
+ enumerable: !0,
40
+ value: t
41
+ }), 2 & e && "string" != typeof t)
42
+ for (var s in t) n.d(i, s, function (e) {
43
+ return t[e]
44
+ }.bind(null, s));
45
+ return i
46
+ }, n.n = function (t) {
47
+ var e = t && t.__esModule ? function () {
48
+ return t.default
49
+ } : function () {
50
+ return t
51
+ };
52
+ return n.d(e, "a", e), e
53
+ }, n.o = function (t, e) {
54
+ return Object.prototype.hasOwnProperty.call(t, e)
55
+ }, n.p = "", n(n.s = 0)
56
+ }([function (t, e, n) {
57
+ "use strict";
58
+ n.r(e);
59
+ var i = function () {
60
+ function t(t) {
61
+ var e = this;
62
+ this.listener = function (t) {
63
+ (t.matches ? e.matchFns : e.unmatchFns).forEach((function (t) {
64
+ t()
65
+ }))
66
+ }, this.toggler = window.matchMedia(t), this.toggler.addListener(this.listener), this.matchFns = [], this.unmatchFns = []
67
+ }
68
+ return t.prototype.add = function (t, e) {
69
+ this.matchFns.push(t), this.unmatchFns.push(e), (this.toggler.matches ? t : e)()
70
+ }, t
71
+ }(),
72
+ s = function (t) {
73
+ return Array.prototype.slice.call(t)
74
+ },
75
+ o = function (t, e) {
76
+ return s((e || document).querySelectorAll(t))
77
+ },
78
+ r = ("ontouchstart" in window || navigator.msMaxTouchPoints, navigator.userAgent.indexOf("MSIE") > -1 || navigator.appVersion.indexOf("Trident/") > -1),
79
+ a = "mm-spn",
80
+ c = function () {
81
+ function t(t, e, n, i, s) {
82
+ this.node = t, this.title = e, this.slidingSubmenus = i, this.selectedClass = n, this.node.classList.add(a), r && (this.slidingSubmenus = !1), this.node.classList.add(a + "--" + s), this.node.classList.add(a + "--" + (this.slidingSubmenus ? "navbar" : "vertical")), this._setSelectedl(), this._initAnchors()
83
+ }
84
+ return Object.defineProperty(t.prototype, "prefix", {
85
+ get: function () {
86
+ return a
87
+ },
88
+ enumerable: !0,
89
+ configurable: !0
90
+ }), t.prototype.openPanel = function (t) {
91
+ var e = t.parentElement;
92
+ if (this.slidingSubmenus) {
93
+ var n = t.dataset.mmSpnTitle;
94
+ e === this.node ? this.node.classList.add(a + "--main") : (this.node.classList.remove(a + "--main"), n || s(e.children).forEach((function (t) {
95
+ t.matches("a, span") && (n = t.textContent)
96
+ }))), n || (n = this.title), this.node.dataset.mmSpnTitle = n, o("." + a + "--open", this.node).forEach((function (t) {
97
+ t.classList.remove(a + "--open"), t.classList.remove(a + "--parent")
98
+ })), t.classList.add(a + "--open"), t.classList.remove(a + "--parent");
99
+ for (var i = t.parentElement.closest("ul"); i;) i.classList.add(a + "--open"), i.classList.add(a + "--parent"), i = i.parentElement.closest("ul")
100
+ } else {
101
+ var r = t.matches("." + a + "--open");
102
+ o("." + a + "--open", this.node).forEach((function (t) {
103
+ t.classList.remove(a + "--open")
104
+ })), t.classList[r ? "remove" : "add"](a + "--open");
105
+ for (var c = t.parentElement.closest("ul"); c;) c.classList.add(a + "--open"), c = c.parentElement.closest("ul")
106
+ }
107
+ }, t.prototype._setSelectedl = function () {
108
+ var t = o("." + this.selectedClass, this.node),
109
+ e = t[t.length - 1],
110
+ n = null;
111
+ e && (n = e.closest("ul")), n || (n = this.node.querySelector("ul")), this.openPanel(n)
112
+ }, t.prototype._initAnchors = function () {
113
+ var t = this;
114
+ this.node.addEventListener("click", (function (e) {
115
+ var n = e.target,
116
+ i = !1;
117
+ (i = (i = (i = i || function (t) {
118
+ return !!t.matches("a")
119
+ }(n)) || function (e) {
120
+ var n;
121
+ return !!(n = e.closest("span") ? e.parentElement : !!e.closest("li") && e) && (s(n.children).forEach((function (e) {
122
+ e.matches("ul") && t.openPanel(e)
123
+ })), !0)
124
+ }(n)) || function (e) {
125
+ var n = o("." + a + "--open", e),
126
+ i = n[n.length - 1];
127
+ if (i) {
128
+ var s = i.parentElement.closest("ul");
129
+ if (s) return t.openPanel(s), !0
130
+ }
131
+ return !1
132
+ }(n)) && e.stopImmediatePropagation()
133
+ }))
134
+ }, t
135
+ }(),
136
+ u = "mm-ocd",
137
+ d = function () {
138
+ function t(t, e) {
139
+ var n = this;
140
+ // jadams, 2020-06-21: deactivate bubble up control by preventDefault
141
+ // on so-called passive events to suppress error messages issues by
142
+ // (Google) Chromium browsers. Google has changed the behavior of
143
+ // passive event listeners only for window, document or body elements.
144
+ //
145
+ // See: https://developers.google.com/web/updates/2017/01/scrolling-intervention
146
+ //
147
+ var passiveSupported = false;
148
+ void 0 === t && (t = null), this.wrapper = document.createElement("div"), this.wrapper.classList.add("" + u), this.wrapper.classList.add(u + "--" + e), this.content = document.createElement("div"), this.content.classList.add(u + "__content"), this.wrapper.append(this.content), this.backdrop = document.createElement("div"), this.backdrop.classList.add(u + "__backdrop"), this.wrapper.append(this.backdrop), document.body.append(this.wrapper), t && this.content.append(t);
149
+ var i = function (t) {
150
+ // jadams, 2020-06-21: deactivate close drawer on mouse click event
151
+ // n.close();
152
+ if (passiveSupported) { t.preventDefault() }
153
+ t.stopImmediatePropagation()
154
+ };
155
+ this.backdrop.addEventListener("touchstart", i, {
156
+ passive: !0
157
+ }), this.backdrop.addEventListener("mousedown", i, {
158
+ passive: !0
159
+ })
160
+ }
161
+ return Object.defineProperty(t.prototype, "prefix", {
162
+ get: function () {
163
+ return u
164
+ },
165
+ enumerable: !0,
166
+ configurable: !0
167
+ }), t.prototype.open = function () {
168
+ this.wrapper.classList.add(u + "--open"), document.body.classList.add(u + "-opened")
169
+ }, t.prototype.close = function () {
170
+ this.wrapper.classList.remove(u + "--open"), document.body.classList.remove(u + "-opened")
171
+ }, t
172
+ }(),
173
+ l = function () {
174
+ function t(t, e) {
175
+ void 0 === e && (e = "all"), this.menu = t, this.toggler = new i(e)
176
+ }
177
+ return t.prototype.navigation = function (t) {
178
+ var e = this;
179
+ if (!this.navigator) {
180
+ var n = (t = t || {}).title,
181
+ i = void 0 === n ? "Menu" : n,
182
+ s = t.selectedClass,
183
+ o = void 0 === s ? "Selected" : s,
184
+ r = t.slidingSubmenus,
185
+ a = void 0 === r || r,
186
+ u = t.theme,
187
+ d = void 0 === u ? "light" : u;
188
+ this.navigator = new c(this.menu, i, o, a, d), this.toggler.add((function () {
189
+ return e.menu.classList.add(e.navigator.prefix)
190
+ }), (function () {
191
+ return e.menu.classList.remove(e.navigator.prefix)
192
+ }))
193
+ }
194
+ return this.navigator
195
+ }, t.prototype.offcanvas = function (t) {
196
+ var e = this;
197
+ if (!this.drawer) {
198
+ var n = (t = t || {}).position,
199
+ i = void 0 === n ? "left" : n;
200
+ this.drawer = new d(null, i);
201
+ var s = document.createComment("original mmenu location");
202
+ this.menu.after(s), this.toggler.add((function () {
203
+ e.drawer.content.append(e.menu)
204
+ }), (function () {
205
+ e.drawer.close(), s.after(e.menu)
206
+ }))
207
+ }
208
+ return this.drawer
209
+ }, t
210
+ }();
211
+ e.default = l;
212
+ window.MmenuLight = l
213
+ }]);
@@ -0,0 +1,205 @@
1
+ /*!
2
+ * Mmenu Light
3
+ * mmenujs.com/mmenu-light v3.0.4
4
+ *
5
+ * Copyright (c) Fred Heusschen
6
+ * www.frebsite.nl
7
+ *
8
+ * License: CC-BY-4.0
9
+ * http://creativecommons.org/licenses/by/4.0/
10
+ */
11
+ ! function (t) {
12
+ var e = {};
13
+
14
+ function n(i) {
15
+ if (e[i]) return e[i].exports;
16
+ var s = e[i] = {
17
+ i: i,
18
+ l: !1,
19
+ exports: {}
20
+ };
21
+ return t[i].call(s.exports, s, s.exports, n), s.l = !0, s.exports
22
+ }
23
+ n.m = t, n.c = e, n.d = function (t, e, i) {
24
+ n.o(t, e) || Object.defineProperty(t, e, {
25
+ enumerable: !0,
26
+ get: i
27
+ })
28
+ }, n.r = function (t) {
29
+ "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
30
+ value: "Module"
31
+ }), Object.defineProperty(t, "__esModule", {
32
+ value: !0
33
+ })
34
+ }, n.t = function (t, e) {
35
+ if (1 & e && (t = n(t)), 8 & e) return t;
36
+ if (4 & e && "object" == typeof t && t && t.__esModule) return t;
37
+ var i = Object.create(null);
38
+ if (n.r(i), Object.defineProperty(i, "default", {
39
+ enumerable: !0,
40
+ value: t
41
+ }), 2 & e && "string" != typeof t)
42
+ for (var s in t) n.d(i, s, function (e) {
43
+ return t[e]
44
+ }.bind(null, s));
45
+ return i
46
+ }, n.n = function (t) {
47
+ var e = t && t.__esModule ? function () {
48
+ return t.default
49
+ } : function () {
50
+ return t
51
+ };
52
+ return n.d(e, "a", e), e
53
+ }, n.o = function (t, e) {
54
+ return Object.prototype.hasOwnProperty.call(t, e)
55
+ }, n.p = "", n(n.s = 0)
56
+ }([function (t, e, n) {
57
+ "use strict";
58
+ n.r(e);
59
+ var i = function () {
60
+ function t(t) {
61
+ var e = this;
62
+ this.listener = function (t) {
63
+ (t.matches ? e.matchFns : e.unmatchFns).forEach((function (t) {
64
+ t()
65
+ }))
66
+ }, this.toggler = window.matchMedia(t), this.toggler.addListener(this.listener), this.matchFns = [], this.unmatchFns = []
67
+ }
68
+ return t.prototype.add = function (t, e) {
69
+ this.matchFns.push(t), this.unmatchFns.push(e), (this.toggler.matches ? t : e)()
70
+ }, t
71
+ }(),
72
+ s = function (t) {
73
+ return Array.prototype.slice.call(t)
74
+ },
75
+ o = function (t, e) {
76
+ return s((e || document).querySelectorAll(t))
77
+ },
78
+ r = ("ontouchstart" in window || navigator.msMaxTouchPoints, navigator.userAgent.indexOf("MSIE") > -1 || navigator.appVersion.indexOf("Trident/") > -1),
79
+ a = "mm-spn",
80
+ c = function () {
81
+ function t(t, e, n, i, s) {
82
+ this.node = t, this.title = e, this.slidingSubmenus = i, this.selectedClass = n, this.node.classList.add(a), r && (this.slidingSubmenus = !1), this.node.classList.add(a + "--" + s), this.node.classList.add(a + "--" + (this.slidingSubmenus ? "navbar" : "vertical")), this._setSelectedl(), this._initAnchors()
83
+ }
84
+ return Object.defineProperty(t.prototype, "prefix", {
85
+ get: function () {
86
+ return a
87
+ },
88
+ enumerable: !0,
89
+ configurable: !0
90
+ }), t.prototype.openPanel = function (t) {
91
+ var e = t.parentElement;
92
+ if (this.slidingSubmenus) {
93
+ var n = t.dataset.mmSpnTitle;
94
+ e === this.node ? this.node.classList.add(a + "--main") : (this.node.classList.remove(a + "--main"), n || s(e.children).forEach((function (t) {
95
+ t.matches("a, span") && (n = t.textContent)
96
+ }))), n || (n = this.title), this.node.dataset.mmSpnTitle = n, o("." + a + "--open", this.node).forEach((function (t) {
97
+ t.classList.remove(a + "--open"), t.classList.remove(a + "--parent")
98
+ })), t.classList.add(a + "--open"), t.classList.remove(a + "--parent");
99
+ for (var i = t.parentElement.closest("ul"); i;) i.classList.add(a + "--open"), i.classList.add(a + "--parent"), i = i.parentElement.closest("ul")
100
+ } else {
101
+ var r = t.matches("." + a + "--open");
102
+ o("." + a + "--open", this.node).forEach((function (t) {
103
+ t.classList.remove(a + "--open")
104
+ })), t.classList[r ? "remove" : "add"](a + "--open");
105
+ for (var c = t.parentElement.closest("ul"); c;) c.classList.add(a + "--open"), c = c.parentElement.closest("ul")
106
+ }
107
+ }, t.prototype._setSelectedl = function () {
108
+ var t = o("." + this.selectedClass, this.node),
109
+ e = t[t.length - 1],
110
+ n = null;
111
+ e && (n = e.closest("ul")), n || (n = this.node.querySelector("ul")), this.openPanel(n)
112
+ }, t.prototype._initAnchors = function () {
113
+ var t = this;
114
+ this.node.addEventListener("click", (function (e) {
115
+ var n = e.target,
116
+ i = !1;
117
+ (i = (i = (i = i || function (t) {
118
+ return !!t.matches("a")
119
+ }(n)) || function (e) {
120
+ var n;
121
+ return !!(n = e.closest("span") ? e.parentElement : !!e.closest("li") && e) && (s(n.children).forEach((function (e) {
122
+ e.matches("ul") && t.openPanel(e)
123
+ })), !0)
124
+ }(n)) || function (e) {
125
+ var n = o("." + a + "--open", e),
126
+ i = n[n.length - 1];
127
+ if (i) {
128
+ var s = i.parentElement.closest("ul");
129
+ if (s) return t.openPanel(s), !0
130
+ }
131
+ return !1
132
+ }(n)) && e.stopImmediatePropagation()
133
+ }))
134
+ }, t
135
+ }(),
136
+ u = "mm-ocd",
137
+ d = function () {
138
+ function t(t, e) {
139
+ var n = this;
140
+ var passiveSupported = false;
141
+ void 0 === t && (t = null), this.wrapper = document.createElement("div"), this.wrapper.classList.add("" + u), this.wrapper.classList.add(u + "--" + e), this.content = document.createElement("div"), this.content.classList.add(u + "__content"), this.wrapper.append(this.content), this.backdrop = document.createElement("div"), this.backdrop.classList.add(u + "__backdrop"), this.wrapper.append(this.backdrop), document.body.append(this.wrapper), t && this.content.append(t);
142
+ var i = function (t) {
143
+ n.close();
144
+ if (passiveSupported) { t.preventDefault() }
145
+ t.stopImmediatePropagation();
146
+ };
147
+ this.backdrop.addEventListener("touchstart", i, {
148
+ passive: !0
149
+ }), this.backdrop.addEventListener("mousedown", i, {
150
+ passive: !0
151
+ })
152
+ }
153
+ return Object.defineProperty(t.prototype, "prefix", {
154
+ get: function () {
155
+ return u
156
+ },
157
+ enumerable: !0,
158
+ configurable: !0
159
+ }), t.prototype.open = function () {
160
+ this.wrapper.classList.add(u + "--open"), document.body.classList.add(u + "-opened")
161
+ }, t.prototype.close = function () {
162
+ this.wrapper.classList.remove(u + "--open"), document.body.classList.remove(u + "-opened")
163
+ }, t
164
+ }(),
165
+ l = function () {
166
+ function t(t, e) {
167
+ void 0 === e && (e = "all"), this.menu = t, this.toggler = new i(e)
168
+ }
169
+ return t.prototype.navigation = function (t) {
170
+ var e = this;
171
+ if (!this.navigator) {
172
+ var n = (t = t || {}).title,
173
+ i = void 0 === n ? "Menu" : n,
174
+ s = t.selectedClass,
175
+ o = void 0 === s ? "Selected" : s,
176
+ r = t.slidingSubmenus,
177
+ a = void 0 === r || r,
178
+ u = t.theme,
179
+ d = void 0 === u ? "light" : u;
180
+ this.navigator = new c(this.menu, i, o, a, d), this.toggler.add((function () {
181
+ return e.menu.classList.add(e.navigator.prefix)
182
+ }), (function () {
183
+ return e.menu.classList.remove(e.navigator.prefix)
184
+ }))
185
+ }
186
+ return this.navigator
187
+ }, t.prototype.offcanvas = function (t) {
188
+ var e = this;
189
+ if (!this.drawer) {
190
+ var n = (t = t || {}).position,
191
+ i = void 0 === n ? "left" : n;
192
+ this.drawer = new d(null, i);
193
+ var s = document.createComment("original menu location");
194
+ this.menu.after(s), this.toggler.add((function () {
195
+ e.drawer.content.append(e.menu)
196
+ }), (function () {
197
+ e.drawer.close(), s.after(e.menu)
198
+ }))
199
+ }
200
+ return this.drawer
201
+ }, t
202
+ }();
203
+ e.default = l;
204
+ window.MmenuLight = l
205
+ }]);
@@ -0,0 +1,118 @@
1
+ // Source: https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach
2
+ if (window.NodeList && !NodeList.prototype.forEach) {
3
+ NodeList.prototype.forEach = function(callback, thisArg) {
4
+ thisArg = thisArg || window;
5
+ for (var i = 0; i < this.length; i++) {
6
+ callback.call(thisArg, this[i], i, this);
7
+ }
8
+ };
9
+ }
10
+
11
+ // Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
12
+ if (!Element.prototype.matches) {
13
+ Element.prototype.matches =
14
+ Element.prototype.matchesSelector ||
15
+ Element.prototype.mozMatchesSelector ||
16
+ Element.prototype.msMatchesSelector ||
17
+ Element.prototype.oMatchesSelector ||
18
+ Element.prototype.webkitMatchesSelector ||
19
+ function(s) {
20
+ var matches = (
21
+ this.document || this.ownerDocument
22
+ ).querySelectorAll(s),
23
+ i = matches.length;
24
+ while (--i >= 0 && matches.item(i) !== this) {}
25
+ return i > -1;
26
+ };
27
+ }
28
+
29
+ // Source: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
30
+ if (!Element.prototype.matches) {
31
+ Element.prototype.matches =
32
+ Element.prototype.msMatchesSelector ||
33
+ Element.prototype.webkitMatchesSelector;
34
+ }
35
+
36
+ if (!Element.prototype.closest) {
37
+ Element.prototype.closest = function(s) {
38
+ var el = this;
39
+
40
+ do {
41
+ if (el.matches(s)) return el;
42
+ el = el.parentElement || el.parentNode;
43
+ } while (el !== null && el.nodeType === 1);
44
+ return null;
45
+ };
46
+ }
47
+
48
+ // from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/after()/after().md
49
+ (function(arr) {
50
+ arr.forEach(function(item) {
51
+ if (item.hasOwnProperty('after')) {
52
+ return;
53
+ }
54
+ Object.defineProperty(item, 'after', {
55
+ configurable: true,
56
+ enumerable: true,
57
+ writable: true,
58
+ value: function after() {
59
+ var argArr = Array.prototype.slice.call(arguments),
60
+ docFrag = document.createDocumentFragment();
61
+
62
+ argArr.forEach(function(argItem) {
63
+ var isNode = argItem instanceof Node;
64
+ docFrag.appendChild(
65
+ isNode
66
+ ? argItem
67
+ : document.createTextNode(String(argItem))
68
+ );
69
+ });
70
+
71
+ this.parentNode.insertBefore(docFrag, this.nextSibling);
72
+ }
73
+ });
74
+ });
75
+ })([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
76
+
77
+ // Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
78
+ (function(arr) {
79
+ arr.forEach(function(item) {
80
+ if (item.hasOwnProperty('append')) {
81
+ return;
82
+ }
83
+ Object.defineProperty(item, 'append', {
84
+ configurable: true,
85
+ enumerable: true,
86
+ writable: true,
87
+ value: function append() {
88
+ var argArr = Array.prototype.slice.call(arguments),
89
+ docFrag = document.createDocumentFragment();
90
+
91
+ argArr.forEach(function(argItem) {
92
+ var isNode = argItem instanceof Node;
93
+ docFrag.appendChild(
94
+ isNode
95
+ ? argItem
96
+ : document.createTextNode(String(argItem))
97
+ );
98
+ });
99
+
100
+ this.appendChild(docFrag);
101
+ }
102
+ });
103
+ });
104
+ })([Element.prototype, Document.prototype, DocumentFragment.prototype]);
105
+
106
+ // from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
107
+ (function() {
108
+ if (typeof window.Event === 'function') return false;
109
+
110
+ function Event(event, params) {
111
+ params = params || { bubbles: false, cancelable: false };
112
+ var evt = document.createEvent('Event');
113
+ evt.initEvent(event, params.bubbles, params.cancelable);
114
+ return evt;
115
+ }
116
+
117
+ window.Event = Event;
118
+ })();