jekyll-theme-glueckkanja 0.8.3 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -3
- data/_sass/font-awesome/scss/_icons.scss +91 -0
- data/_sass/font-awesome/scss/_rotated-flipped.scss +3 -2
- data/_sass/font-awesome/scss/_variables.scss +93 -1
- data/_sass/font-awesome/scss/brands.scss +1 -4
- data/_sass/font-awesome/scss/fontawesome.scss +0 -4
- data/_sass/font-awesome/scss/regular.scss +1 -4
- data/_sass/font-awesome/scss/solid.scss +1 -4
- data/_sass/font-awesome/scss/v4-shims.scss +0 -4
- data/assets/favicons/de.svg +5 -0
- data/assets/favicons/gk-logo-white.png +0 -0
- data/assets/favicons/us.svg +10 -0
- data/assets/img/cbp-sprite.png +0 -0
- data/assets/js/components/_hs.dropdown.js +612 -0
- data/assets/js/components/gmap/hs.map.js +347 -0
- data/assets/js/components/hs.ajax-autocomplete.js +103 -0
- data/assets/js/components/hs.autocomplete-local-search.js +113 -0
- data/assets/js/components/hs.autocomplete.js +125 -0
- data/assets/js/components/hs.bg-video.js +70 -0
- data/assets/js/components/hs.carousel-materialize.js +75 -0
- data/assets/js/components/hs.carousel-owl.js +89 -0
- data/assets/js/components/hs.carousel-swiper.js +123 -0
- data/assets/js/components/hs.carousel.js +283 -0
- data/assets/js/components/hs.chart-pie.js +220 -0
- data/assets/js/components/hs.chart.js +155 -0
- data/assets/js/components/hs.count-qty.js +92 -0
- data/assets/js/components/hs.countdown.js +359 -0
- data/assets/js/components/hs.counter.js +220 -0
- data/assets/js/components/hs.cubeportfolio.js +163 -0
- data/assets/js/components/hs.datepicker.js +149 -0
- data/assets/js/components/hs.dropdown.js +522 -0
- data/assets/js/components/hs.file-attachement.js +135 -0
- data/assets/js/components/hs.flickr.js +180 -0
- data/assets/js/components/hs.go-to.js +121 -0
- data/assets/js/components/hs.header-fullscreen.js +397 -0
- data/assets/js/components/hs.header-side.js +1096 -0
- data/assets/js/components/hs.header.js +2128 -0
- data/assets/js/components/hs.instagram.js +94 -0
- data/assets/js/components/hs.map.pin.js +82 -0
- data/assets/js/components/hs.map.svg.js +80 -0
- data/assets/js/components/hs.markup-copy.js +102 -0
- data/assets/js/components/hs.masked-input.js +74 -0
- data/assets/js/components/hs.modal-event.js +134 -0
- data/assets/js/components/hs.modal-window.js +422 -0
- data/assets/js/components/hs.navigation.js +690 -0
- data/assets/js/components/hs.nl-form.js +70 -0
- data/assets/js/components/hs.onscroll-animation.js +190 -0
- data/assets/js/components/hs.popup.js +310 -0
- data/assets/js/components/hs.progress-bar.js +353 -0
- data/assets/js/components/hs.rating.js +153 -0
- data/assets/js/components/hs.scroll-nav.js +373 -0
- data/assets/js/components/hs.scrollbar.js +102 -0
- data/assets/js/components/hs.select.js +91 -0
- data/assets/js/components/hs.slider.js +99 -0
- data/assets/js/components/hs.smart-menu.js +233 -0
- data/assets/js/components/hs.step-form-old.js +94 -0
- data/assets/js/components/hs.step-form.js +93 -0
- data/assets/js/components/hs.sticky-block.js +418 -0
- data/assets/js/components/hs.tabs.js +186 -0
- data/assets/js/components/hs.twitter.js +111 -0
- data/assets/js/components/hs.validation.js +111 -0
- data/assets/js/components/hs.video-audio.js +70 -0
- data/assets/js/components/text-animation/hs.text-slideshow.js +348 -0
- data/assets/js/helpers/hs.bg-video.js +23 -0
- data/assets/js/helpers/hs.chart.js +66 -0
- data/assets/js/helpers/hs.compressed-form.js +55 -0
- data/assets/js/helpers/hs.file-attachments.js +39 -0
- data/assets/js/helpers/hs.focus-state.js +37 -0
- data/assets/js/helpers/hs.hamburgers.js +69 -0
- data/assets/js/helpers/hs.height-calc.js +31 -0
- data/assets/js/helpers/hs.hover-blocks.js +43 -0
- data/assets/js/helpers/hs.modal-markup.js +89 -0
- data/assets/js/helpers/hs.navigation-splitted.js +169 -0
- data/assets/js/helpers/hs.not-empty-state.js +34 -0
- data/assets/js/helpers/hs.rating.js +45 -0
- data/assets/js/helpers/hs.selecter.js +14 -0
- data/assets/js/helpers/hs.shortcode-filter.js +39 -0
- data/assets/js/hs.core.js +250 -0
- data/assets/js/hs.popup.js +155 -0
- data/assets/js/vendor/jquery.cubeportfolio.js +6054 -0
- data/assets/js/vendor/jquery.fancybox.js +4936 -0
- data/assets/nav/pixel-trans.png +0 -0
- data/assets/nav/pixel-trans@2x.png +0 -0
- metadata +75 -1
@@ -0,0 +1,347 @@
|
|
1
|
+
/**
|
2
|
+
* Gmap wrapper.
|
3
|
+
*
|
4
|
+
* @author Htmlstream
|
5
|
+
* @version 1.0
|
6
|
+
* @requires
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
;(function ($) {
|
10
|
+
'use strict';
|
11
|
+
|
12
|
+
$.HSCore.components.HSGMap = {
|
13
|
+
/**
|
14
|
+
*
|
15
|
+
*
|
16
|
+
* @var Object _baseConfig
|
17
|
+
*/
|
18
|
+
_baseConfig: {
|
19
|
+
zoom: 14,
|
20
|
+
scrollwheel: false
|
21
|
+
},
|
22
|
+
|
23
|
+
/**
|
24
|
+
*
|
25
|
+
*
|
26
|
+
* @var jQuery pageCollection
|
27
|
+
*/
|
28
|
+
pageCollection: $(),
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Initialization of Gmap wrapper.
|
32
|
+
*
|
33
|
+
* @param String selector (optional)
|
34
|
+
* @param Object config (optional)
|
35
|
+
*
|
36
|
+
* @return jQuery pageCollection - collection of initialized items.
|
37
|
+
*/
|
38
|
+
|
39
|
+
init: function (selector, config) {
|
40
|
+
|
41
|
+
this.collection = selector && $(selector).length ? $(selector) : $();
|
42
|
+
if (!$(selector).length) return;
|
43
|
+
|
44
|
+
this.config = config && $.isPlainObject(config) ?
|
45
|
+
$.extend({}, this._baseConfig, config) : this._baseConfig;
|
46
|
+
|
47
|
+
this.config.itemSelector = selector;
|
48
|
+
|
49
|
+
this.initGMap();
|
50
|
+
|
51
|
+
return this.pageCollection;
|
52
|
+
|
53
|
+
},
|
54
|
+
|
55
|
+
initGMap: function () {
|
56
|
+
//Variables
|
57
|
+
var $self = this,
|
58
|
+
config = $self.config,
|
59
|
+
collection = $self.pageCollection;
|
60
|
+
|
61
|
+
//Actions
|
62
|
+
this.collection.each(function (i, el) {
|
63
|
+
//Variables
|
64
|
+
var $this = $(el),
|
65
|
+
ID = $this.attr('id'),
|
66
|
+
gMapType = $this.data('type'),
|
67
|
+
gMapLat = $this.data('lat'),
|
68
|
+
gMapLng = $this.data('lng'),
|
69
|
+
gMapZoom = $this.data('zoom'),
|
70
|
+
gMapTitle = $this.data('title'),
|
71
|
+
|
72
|
+
gMapStyles = JSON.parse(el.getAttribute('data-styles')),
|
73
|
+
gMapStylesArray = [],
|
74
|
+
|
75
|
+
polygon,
|
76
|
+
gMapPolygon = Boolean($this.data('polygon')),
|
77
|
+
gMapPolygonCords = JSON.parse(el.getAttribute('data-polygon-cords')),
|
78
|
+
gMapPolygonStyles = JSON.parse(el.getAttribute('data-polygon-styles')),
|
79
|
+
|
80
|
+
polylines,
|
81
|
+
gMapPolylines = Boolean($this.data('polylines')),
|
82
|
+
gMapPolylinesCords = JSON.parse(el.getAttribute('data-polylines-cords')),
|
83
|
+
gMapPolylinesStyles = JSON.parse(el.getAttribute('data-polylines-styles')),
|
84
|
+
|
85
|
+
gMapRoutes = Boolean($this.data('routes')),
|
86
|
+
gMapRoutesCords = JSON.parse(el.getAttribute('data-routes-cords')),
|
87
|
+
gMapRoutesStyles = JSON.parse(el.getAttribute('data-routes-styles')),
|
88
|
+
|
89
|
+
gMapGeolocation = Boolean($this.data('geolocation')),
|
90
|
+
|
91
|
+
gMapGeocoding = Boolean($this.data('geocoding')),
|
92
|
+
gMapCordsTarget = $this.data('cords-target'),
|
93
|
+
|
94
|
+
gMapPin = Boolean($this.data('pin')),
|
95
|
+
gMapPinIcon = $this.data('pin-icon'),
|
96
|
+
|
97
|
+
$gMap;
|
98
|
+
|
99
|
+
//Map Type
|
100
|
+
if (gMapType == 'satellite') {
|
101
|
+
$gMap = new google.maps.Map(document.getElementById(ID), {
|
102
|
+
zoom: gMapZoom ? gMapZoom : config['zoom'],
|
103
|
+
scrollwheel: config['scrollwheel']
|
104
|
+
});
|
105
|
+
|
106
|
+
$gMap.setCenter({
|
107
|
+
lat: gMapLat,
|
108
|
+
lng: gMapLng
|
109
|
+
});
|
110
|
+
|
111
|
+
$gMap.setMapTypeId(google.maps.MapTypeId.SATELLITE);
|
112
|
+
} else if (gMapType == 'terrain') {
|
113
|
+
$gMap = new google.maps.Map(document.getElementById(ID), {
|
114
|
+
zoom: gMapZoom ? gMapZoom : config['zoom'],
|
115
|
+
scrollwheel: config['scrollwheel']
|
116
|
+
});
|
117
|
+
|
118
|
+
$gMap.setCenter({
|
119
|
+
lat: gMapLat,
|
120
|
+
lng: gMapLng
|
121
|
+
});
|
122
|
+
|
123
|
+
$gMap.setMapTypeId(google.maps.MapTypeId.TERRAIN);
|
124
|
+
} else if (gMapType == 'street-view') {
|
125
|
+
$gMap = new google.maps.StreetViewPanorama(document.getElementById(ID), {
|
126
|
+
zoom: gMapZoom ? gMapZoom : config['zoom'],
|
127
|
+
scrollwheel: config['scrollwheel']
|
128
|
+
});
|
129
|
+
|
130
|
+
$gMap.setPosition({
|
131
|
+
lat: gMapLat,
|
132
|
+
lng: gMapLng
|
133
|
+
});
|
134
|
+
} else if (gMapType == 'static') {
|
135
|
+
$(document).ready(function () {
|
136
|
+
$gMap = GMaps.staticMapURL({
|
137
|
+
size: [2048, 2048],
|
138
|
+
lat: gMapLat,
|
139
|
+
lng: gMapLng,
|
140
|
+
zoom: gMapZoom ? gMapZoom : config['zoom']
|
141
|
+
});
|
142
|
+
|
143
|
+
$('#' + ID).css('background-image', 'url(' + $gMap + ')');
|
144
|
+
});
|
145
|
+
} else if (gMapType == 'custom') {
|
146
|
+
var arrL = gMapStyles.length;
|
147
|
+
|
148
|
+
for (var i = 0; i < arrL; i++) {
|
149
|
+
var featureType = gMapStyles[i][0],
|
150
|
+
elementType = gMapStyles[i][1],
|
151
|
+
stylers = gMapStyles[i][2],
|
152
|
+
obj = $.extend({}, gMapStylesArray[i]);
|
153
|
+
|
154
|
+
if (featureType != "") {
|
155
|
+
obj.featureType = featureType;
|
156
|
+
}
|
157
|
+
|
158
|
+
if (elementType != "") {
|
159
|
+
obj.elementType = elementType;
|
160
|
+
}
|
161
|
+
|
162
|
+
obj.stylers = stylers;
|
163
|
+
|
164
|
+
gMapStylesArray.push(obj);
|
165
|
+
}
|
166
|
+
|
167
|
+
$gMap = new GMaps({
|
168
|
+
div: '#' + ID,
|
169
|
+
lat: gMapLat,
|
170
|
+
lng: gMapLng,
|
171
|
+
zoom: gMapZoom ? gMapZoom : config['zoom'],
|
172
|
+
scrollwheel: config['scrollwheel'],
|
173
|
+
styles: gMapStylesArray
|
174
|
+
});
|
175
|
+
|
176
|
+
//Pin
|
177
|
+
if (gMapPin) {
|
178
|
+
$gMap.addMarker({
|
179
|
+
lat: gMapLat,
|
180
|
+
lng: gMapLng,
|
181
|
+
title: gMapTitle,
|
182
|
+
icon: gMapPinIcon
|
183
|
+
});
|
184
|
+
}
|
185
|
+
//End Pin
|
186
|
+
} else {
|
187
|
+
$gMap = new GMaps({
|
188
|
+
div: '#' + ID,
|
189
|
+
lat: gMapLat,
|
190
|
+
lng: gMapLng,
|
191
|
+
zoom: gMapZoom ? gMapZoom : config['zoom'],
|
192
|
+
scrollwheel: config['scrollwheel']
|
193
|
+
});
|
194
|
+
|
195
|
+
//Pin
|
196
|
+
if (gMapPin) {
|
197
|
+
$gMap.addMarker({
|
198
|
+
lat: gMapLat,
|
199
|
+
lng: gMapLng,
|
200
|
+
title: gMapTitle,
|
201
|
+
icon: gMapPinIcon
|
202
|
+
});
|
203
|
+
}
|
204
|
+
//End Pin
|
205
|
+
}
|
206
|
+
//End Map Type
|
207
|
+
|
208
|
+
//Pin
|
209
|
+
if (gMapPin && gMapType == 'satellite' || gMapType == 'terrain' || gMapType == 'street-view') {
|
210
|
+
//Variables
|
211
|
+
var $pin = new google.maps.Marker({
|
212
|
+
position: {
|
213
|
+
lat: gMapLat,
|
214
|
+
lng: gMapLng
|
215
|
+
},
|
216
|
+
map: $gMap
|
217
|
+
});
|
218
|
+
|
219
|
+
if (gMapPinIcon) {
|
220
|
+
var $pinIcon = new google.maps.MarkerImage(gMapPinIcon);
|
221
|
+
$pin.setIcon($pinIcon);
|
222
|
+
}
|
223
|
+
|
224
|
+
if (gMapTitle) {
|
225
|
+
$pin.setOptions({
|
226
|
+
title: gMapTitle
|
227
|
+
});
|
228
|
+
}
|
229
|
+
}
|
230
|
+
//End Pin
|
231
|
+
|
232
|
+
//Auto Center markers on window resize
|
233
|
+
if (!gMapGeolocation) {
|
234
|
+
google.maps.event.addDomListener(window, 'resize', function () {
|
235
|
+
setTimeout(function () {
|
236
|
+
$gMap.setCenter({
|
237
|
+
lat: gMapLat,
|
238
|
+
lng: gMapLng
|
239
|
+
});
|
240
|
+
}, 100);
|
241
|
+
});
|
242
|
+
}
|
243
|
+
|
244
|
+
//Polygon
|
245
|
+
if (gMapPolygon) {
|
246
|
+
$(document).ready(function () {
|
247
|
+
polygon = $gMap.drawPolygon({
|
248
|
+
paths: gMapPolygonCords,
|
249
|
+
strokeColor: gMapPolygonStyles.strokeColor,
|
250
|
+
strokeOpacity: gMapPolygonStyles.strokeOpacity,
|
251
|
+
strokeWeight: gMapPolygonStyles.strokeWeight,
|
252
|
+
fillColor: gMapPolygonStyles.fillColor,
|
253
|
+
fillOpacity: gMapPolygonStyles.fillOpacity
|
254
|
+
});
|
255
|
+
});
|
256
|
+
}
|
257
|
+
//End Polygon
|
258
|
+
|
259
|
+
//Polylines
|
260
|
+
if (gMapPolylines) {
|
261
|
+
$(document).ready(function () {
|
262
|
+
$gMap.drawPolyline({
|
263
|
+
path: gMapPolylinesCords,
|
264
|
+
strokeColor: gMapPolylinesStyles.strokeColor,
|
265
|
+
strokeOpacity: gMapPolylinesStyles.strokeOpacity,
|
266
|
+
strokeWeight: gMapPolylinesStyles.strokeWeight
|
267
|
+
});
|
268
|
+
});
|
269
|
+
}
|
270
|
+
//End Polylines
|
271
|
+
|
272
|
+
//Routes
|
273
|
+
if (gMapRoutes) {
|
274
|
+
$(document).ready(function () {
|
275
|
+
$gMap.drawRoute({
|
276
|
+
origin: gMapRoutesCords[0],
|
277
|
+
destination: gMapRoutesCords[1],
|
278
|
+
travelMode: gMapRoutesStyles.travelMode,
|
279
|
+
strokeColor: gMapRoutesStyles.strokeColor,
|
280
|
+
strokeOpacity: gMapRoutesStyles.strokeOpacity,
|
281
|
+
strokeWeight: gMapRoutesStyles.strokeWeight
|
282
|
+
});
|
283
|
+
});
|
284
|
+
}
|
285
|
+
//End Routes
|
286
|
+
|
287
|
+
//Geolocation
|
288
|
+
if (gMapGeolocation) {
|
289
|
+
GMaps.geolocate({
|
290
|
+
success: function (position) {
|
291
|
+
$gMap.setCenter({
|
292
|
+
lat: position.coords.latitude,
|
293
|
+
lng: position.coords.longitude
|
294
|
+
});
|
295
|
+
|
296
|
+
google.maps.event.addDomListener(window, 'resize', function () {
|
297
|
+
setTimeout(function () {
|
298
|
+
$gMap.setCenter({
|
299
|
+
lat: position.coords.latitude,
|
300
|
+
lng: position.coords.longitude
|
301
|
+
});
|
302
|
+
}, 100);
|
303
|
+
});
|
304
|
+
},
|
305
|
+
error: function (error) {
|
306
|
+
alert('Geolocation failed: ' + error.message);
|
307
|
+
},
|
308
|
+
not_supported: function () {
|
309
|
+
alert('Your browser does not support geolocation');
|
310
|
+
}
|
311
|
+
});
|
312
|
+
}
|
313
|
+
//End Geolocation
|
314
|
+
|
315
|
+
//Geocoding
|
316
|
+
if (gMapGeocoding) {
|
317
|
+
$(document).ready(function () {
|
318
|
+
var targetCordsParent = $(gMapCordsTarget).closest('form');
|
319
|
+
|
320
|
+
$(targetCordsParent).submit(function (e) {
|
321
|
+
e.preventDefault();
|
322
|
+
|
323
|
+
GMaps.geocode({
|
324
|
+
address: $(gMapCordsTarget).val().trim(),
|
325
|
+
callback: function (results, status) {
|
326
|
+
if (status == 'OK') {
|
327
|
+
var latlng = results[0].geometry.location;
|
328
|
+
|
329
|
+
$gMap.setCenter(latlng.lat(), latlng.lng());
|
330
|
+
$gMap.addMarker({
|
331
|
+
lat: latlng.lat(),
|
332
|
+
lng: latlng.lng()
|
333
|
+
});
|
334
|
+
}
|
335
|
+
}
|
336
|
+
});
|
337
|
+
});
|
338
|
+
});
|
339
|
+
}
|
340
|
+
//End Geocoding
|
341
|
+
|
342
|
+
//Actions
|
343
|
+
collection = collection.add($this);
|
344
|
+
});
|
345
|
+
}
|
346
|
+
}
|
347
|
+
})(jQuery);
|
@@ -0,0 +1,103 @@
|
|
1
|
+
/**
|
2
|
+
* Ajax autocomplete wrapper.
|
3
|
+
*
|
4
|
+
* @author Htmlstream
|
5
|
+
* @version 1.0
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
;(function ($) {
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
$.HSCore.components.HSAjaxAutocomplete = {
|
12
|
+
/**
|
13
|
+
*
|
14
|
+
*
|
15
|
+
* @var Object _baseConfig
|
16
|
+
*/
|
17
|
+
_baseConfig: {
|
18
|
+
animation: 'fade',
|
19
|
+
animationSpeed: 400
|
20
|
+
},
|
21
|
+
|
22
|
+
/**
|
23
|
+
*
|
24
|
+
*
|
25
|
+
* @var jQuery pageCollection
|
26
|
+
*/
|
27
|
+
pageCollection: $(),
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Initialization of Ajax autocomplete wrapper.
|
31
|
+
*
|
32
|
+
* @param String selector (optional)
|
33
|
+
* @param Object config (optional)
|
34
|
+
*
|
35
|
+
* @return jQuery pageCollection - collection of initialized items.
|
36
|
+
*/
|
37
|
+
|
38
|
+
init: function (selector, config) {
|
39
|
+
|
40
|
+
this.collection = selector && $(selector).length ? $(selector) : $();
|
41
|
+
if (!$(selector).length) return;
|
42
|
+
|
43
|
+
this.config = config && $.isPlainObject(config) ?
|
44
|
+
$.extend({}, this._baseConfig, config) : this._baseConfig;
|
45
|
+
|
46
|
+
this.config.itemSelector = selector;
|
47
|
+
|
48
|
+
this.initAjaxAutocomplete();
|
49
|
+
|
50
|
+
return this.pageCollection;
|
51
|
+
|
52
|
+
},
|
53
|
+
|
54
|
+
initAjaxAutocomplete: function () {
|
55
|
+
//Variables
|
56
|
+
var $self = this,
|
57
|
+
config = $self.config,
|
58
|
+
collection = $self.pageCollection;
|
59
|
+
|
60
|
+
//Actions
|
61
|
+
this.collection.each(function (i, el) {
|
62
|
+
//Variables
|
63
|
+
var $this = $(el),
|
64
|
+
$target = $this.data('target'),
|
65
|
+
animation = $this.data('animation'),
|
66
|
+
animationSpeed = $this.data('animation-speed');
|
67
|
+
|
68
|
+
$this.on('keyup', function () {
|
69
|
+
if (animation == 'fade') {
|
70
|
+
if ($this.val()) {
|
71
|
+
$('#' + $target).fadeIn(animationSpeed);
|
72
|
+
}
|
73
|
+
|
74
|
+
else {
|
75
|
+
$('#' + $target).fadeOut(animationSpeed);
|
76
|
+
}
|
77
|
+
} else {
|
78
|
+
if ($this.val()) {
|
79
|
+
$('#' + $target).slideDown(animationSpeed);
|
80
|
+
}
|
81
|
+
|
82
|
+
else {
|
83
|
+
$('#' + $target).slideUp(animationSpeed);
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
$this.on('focusout', function () {
|
89
|
+
if (animation == 'fade') {
|
90
|
+
$('#' + $target).fadeOut(animationSpeed);
|
91
|
+
} else {
|
92
|
+
$('#' + $target).slideUp(animationSpeed);
|
93
|
+
}
|
94
|
+
});
|
95
|
+
|
96
|
+
//Actions
|
97
|
+
collection = collection.add($this);
|
98
|
+
});
|
99
|
+
}
|
100
|
+
|
101
|
+
};
|
102
|
+
|
103
|
+
})(jQuery);
|
@@ -0,0 +1,113 @@
|
|
1
|
+
/**
|
2
|
+
* Autocomplete wrapper.
|
3
|
+
*
|
4
|
+
* @author Htmlstream
|
5
|
+
* @version 1.0
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
;(function ($) {
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
$.widget('custom.localcatcomplete', $.ui.autocomplete, {
|
12
|
+
_create: function () {
|
13
|
+
this._super();
|
14
|
+
this.widget().menu('option', 'items', '> :not(.ui-autocomplete-category)');
|
15
|
+
},
|
16
|
+
_renderItem: function (ul, item) {
|
17
|
+
if (item.url) {
|
18
|
+
return $('<li><a href="' + window.location.protocol + '//' + window.location.host + '/' + window.location.pathname.split('/')[1] + '/' + item.url + '">' + item.label + '<span class="g-opacity-0_3 g-ml-5">· ' + item.category + '</span></a></li>')
|
19
|
+
.appendTo(ul);
|
20
|
+
} else {
|
21
|
+
return $('<li>' + item.label + '</li>')
|
22
|
+
.appendTo(ul);
|
23
|
+
}
|
24
|
+
},
|
25
|
+
/*_renderMenu: function (ul, items) {
|
26
|
+
var that = this,
|
27
|
+
currentCategory = '';
|
28
|
+
|
29
|
+
$.each(items, function (index, item) {
|
30
|
+
var li;
|
31
|
+
|
32
|
+
if (item.category != currentCategory) {
|
33
|
+
ul.append('<li class="ui-autocomplete-category">' + item.category + '2</li>');
|
34
|
+
currentCategory = item.category;
|
35
|
+
}
|
36
|
+
|
37
|
+
li = that._renderItemData(ul, item);
|
38
|
+
|
39
|
+
if (item.category) {
|
40
|
+
li.attr('aria-label', item.category + ' : ' + item.label);
|
41
|
+
}
|
42
|
+
});
|
43
|
+
}*/
|
44
|
+
});
|
45
|
+
|
46
|
+
$.HSCore.components.HSLocalSearchAutocomplete = {
|
47
|
+
/**
|
48
|
+
*
|
49
|
+
*
|
50
|
+
* @var Object _baseConfig
|
51
|
+
*/
|
52
|
+
_baseConfig: {
|
53
|
+
minLength: 2
|
54
|
+
},
|
55
|
+
|
56
|
+
/**
|
57
|
+
*
|
58
|
+
*
|
59
|
+
* @var jQuery pageCollection
|
60
|
+
*/
|
61
|
+
pageCollection: $(),
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Initialization of Autocomplete wrapper.
|
65
|
+
*
|
66
|
+
* @param String selector (optional)
|
67
|
+
* @param Object config (optional)
|
68
|
+
*
|
69
|
+
* @return jQuery pageCollection - collection of initialized items.
|
70
|
+
*/
|
71
|
+
|
72
|
+
init: function (selector, config) {
|
73
|
+
|
74
|
+
this.collection = selector && $(selector).length ? $(selector) : $();
|
75
|
+
if (!$(selector).length) return;
|
76
|
+
|
77
|
+
this.config = config && $.isPlainObject(config) ?
|
78
|
+
$.extend({}, this._baseConfig, config) : this._baseConfig;
|
79
|
+
|
80
|
+
this.config.itemSelector = selector;
|
81
|
+
|
82
|
+
this.initAutocomplete();
|
83
|
+
|
84
|
+
return this.pageCollection;
|
85
|
+
|
86
|
+
},
|
87
|
+
|
88
|
+
initAutocomplete: function () {
|
89
|
+
//Variables
|
90
|
+
var $self = this,
|
91
|
+
config = $self.config,
|
92
|
+
collection = $self.pageCollection;
|
93
|
+
|
94
|
+
//Actions
|
95
|
+
this.collection.each(function (i, el) {
|
96
|
+
var $this = $(el),
|
97
|
+
dataUrl = $this.data('url');
|
98
|
+
|
99
|
+
$.getJSON(dataUrl, function (data) {
|
100
|
+
$this.localcatcomplete({
|
101
|
+
delay: 0,
|
102
|
+
source: data
|
103
|
+
});
|
104
|
+
});
|
105
|
+
|
106
|
+
//Actions
|
107
|
+
collection = collection.add($this);
|
108
|
+
});
|
109
|
+
}
|
110
|
+
|
111
|
+
};
|
112
|
+
|
113
|
+
})(jQuery);
|
@@ -0,0 +1,125 @@
|
|
1
|
+
/**
|
2
|
+
* Autocomplete wrapper.
|
3
|
+
*
|
4
|
+
* @author Htmlstream
|
5
|
+
* @version 1.0
|
6
|
+
*
|
7
|
+
*/
|
8
|
+
;(function ($) {
|
9
|
+
'use strict';
|
10
|
+
|
11
|
+
$.widget('custom.catcomplete', $.ui.autocomplete, {
|
12
|
+
_create: function () {
|
13
|
+
this._super();
|
14
|
+
this.widget().menu('option', 'items', '> :not(.ui-autocomplete-category)');
|
15
|
+
},
|
16
|
+
_renderMenu: function (ul, items) {
|
17
|
+
var that = this,
|
18
|
+
currentCategory = '';
|
19
|
+
$.each(items, function (index, item) {
|
20
|
+
var li;
|
21
|
+
|
22
|
+
if (!item.category) {
|
23
|
+
li = that._renderItemData(ul, item);
|
24
|
+
return;
|
25
|
+
}
|
26
|
+
|
27
|
+
if (item.category != currentCategory) {
|
28
|
+
ul.append('<li class="ui-autocomplete-category">' + item.category + '</li>');
|
29
|
+
currentCategory = item.category;
|
30
|
+
}
|
31
|
+
li = that._renderItemData(ul, item);
|
32
|
+
if (item.category) {
|
33
|
+
li.html(item.label);
|
34
|
+
li.attr('aria-label', item.category + ' : ' + item.label);
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
});
|
39
|
+
|
40
|
+
$.HSCore.components.HSAutocomplete = {
|
41
|
+
/**
|
42
|
+
*
|
43
|
+
*
|
44
|
+
* @var Object _baseConfig
|
45
|
+
*/
|
46
|
+
_baseConfig: {
|
47
|
+
minLength: 2
|
48
|
+
},
|
49
|
+
|
50
|
+
/**
|
51
|
+
*
|
52
|
+
*
|
53
|
+
* @var jQuery pageCollection
|
54
|
+
*/
|
55
|
+
pageCollection: $(),
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Initialization of Autocomplete wrapper.
|
59
|
+
*
|
60
|
+
* @param String selector (optional)
|
61
|
+
* @param Object config (optional)
|
62
|
+
*
|
63
|
+
* @return jQuery pageCollection - collection of initialized items.
|
64
|
+
*/
|
65
|
+
|
66
|
+
init: function (selector, config) {
|
67
|
+
|
68
|
+
this.collection = selector && $(selector).length ? $(selector) : $();
|
69
|
+
if (!$(selector).length) return;
|
70
|
+
|
71
|
+
this.config = config && $.isPlainObject(config) ?
|
72
|
+
$.extend({}, this._baseConfig, config) : this._baseConfig;
|
73
|
+
|
74
|
+
this.config.itemSelector = selector;
|
75
|
+
|
76
|
+
this.initAutocomplete();
|
77
|
+
|
78
|
+
return this.pageCollection;
|
79
|
+
|
80
|
+
},
|
81
|
+
|
82
|
+
initAutocomplete: function () {
|
83
|
+
//Variables
|
84
|
+
var $self = this,
|
85
|
+
config = $self.config,
|
86
|
+
collection = $self.pageCollection;
|
87
|
+
|
88
|
+
//Actions
|
89
|
+
this.collection.each(function (i, el) {
|
90
|
+
var $this = $(el),
|
91
|
+
dataUrl = $this.data('url');
|
92
|
+
|
93
|
+
$.getJSON(dataUrl, function (data) {
|
94
|
+
$this.catcomplete({
|
95
|
+
delay: 0,
|
96
|
+
source: data,
|
97
|
+
dataType: 'json',
|
98
|
+
minLength: config['minLength'],
|
99
|
+
select: function (event, ui) {
|
100
|
+
var currentItem = $(this);
|
101
|
+
|
102
|
+
setTimeout(function () {
|
103
|
+
var currentVal = currentItem.val();
|
104
|
+
$(currentItem).val($(currentVal).get(0).textContent);
|
105
|
+
}, 1);
|
106
|
+
},
|
107
|
+
focus: function (event, ui) {
|
108
|
+
var currentItem = $(this);
|
109
|
+
|
110
|
+
setTimeout(function () {
|
111
|
+
var currentVal = currentItem.val();
|
112
|
+
$(currentItem).val($(currentVal).get(0).textContent);
|
113
|
+
});
|
114
|
+
}
|
115
|
+
});
|
116
|
+
});
|
117
|
+
|
118
|
+
//Actions
|
119
|
+
collection = collection.add($this);
|
120
|
+
});
|
121
|
+
}
|
122
|
+
|
123
|
+
};
|
124
|
+
|
125
|
+
})(jQuery);
|