devops4lib-jekyll-theme-conference 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +9 -0
  3. data/README.md +781 -0
  4. data/_includes/js/conference.js +55 -0
  5. data/_includes/js/init.js +39 -0
  6. data/_includes/js/lib/a_popper.min.js +4 -0
  7. data/_includes/js/lib/bootstrap.js +6 -0
  8. data/_includes/js/lib/jquery-3.5.1.min.js +2 -0
  9. data/_includes/js/lib/leaflet-easybutton.js +376 -0
  10. data/_includes/js/lib/leaflet-locatecontrol.js +4 -0
  11. data/_includes/js/lib/leaflet-providers.js +877 -0
  12. data/_includes/js/lib/leaflet.js +5 -0
  13. data/_includes/js/lib/syncscroll.js +140 -0
  14. data/_includes/js/live.js +779 -0
  15. data/_includes/js/map.js +43 -0
  16. data/_includes/js/modal.js +78 -0
  17. data/_includes/js/program.js +41 -0
  18. data/_includes/partials/checks.html +69 -0
  19. data/_includes/partials/footer.html +18 -0
  20. data/_includes/partials/get_day_hash.html +20 -0
  21. data/_includes/partials/get_day_time.html +21 -0
  22. data/_includes/partials/get_enable_map.html +11 -0
  23. data/_includes/partials/get_link.html +85 -0
  24. data/_includes/partials/get_link_types.html +15 -0
  25. data/_includes/partials/get_live_timestamps.html +49 -0
  26. data/_includes/partials/get_main_category.html +9 -0
  27. data/_includes/partials/get_page_description.html +23 -0
  28. data/_includes/partials/get_page_title.html +33 -0
  29. data/_includes/partials/get_room_live_href.html +8 -0
  30. data/_includes/partials/get_talk_time.html +24 -0
  31. data/_includes/partials/get_talk_timestamp.html +15 -0
  32. data/_includes/partials/get_time_pronoun.html +6 -0
  33. data/_includes/partials/header.html +67 -0
  34. data/_includes/partials/info_bar.html +38 -0
  35. data/_includes/partials/list_categories.html +4 -0
  36. data/_includes/partials/list_page_meta.html +23 -0
  37. data/_includes/partials/list_speakers.html +22 -0
  38. data/_includes/partials/list_sub_categories.html +8 -0
  39. data/_includes/partials/modal_link.html +21 -0
  40. data/_includes/partials/modal_live.html +49 -0
  41. data/_includes/partials/navbar.html +97 -0
  42. data/_includes/partials/navbar_rooms.html +36 -0
  43. data/_includes/partials/show_live_button.html +21 -0
  44. data/_includes/partials/show_room.html +5 -0
  45. data/_includes/partials/show_talk.html +5 -0
  46. data/_includes/partials/show_talk_duration.html +3 -0
  47. data/_includes/partials/show_talk_time.html +17 -0
  48. data/_layouts/config.html +78 -0
  49. data/_layouts/data.html +126 -0
  50. data/_layouts/default.html +5 -0
  51. data/_layouts/home.html +87 -0
  52. data/_layouts/location.html +25 -0
  53. data/_layouts/page.html +13 -0
  54. data/_layouts/program.html +201 -0
  55. data/_layouts/room.html +70 -0
  56. data/_layouts/speaker-overview.html +47 -0
  57. data/_layouts/speaker.html +111 -0
  58. data/_layouts/stream-overview.html +43 -0
  59. data/_layouts/talk-overview.html +112 -0
  60. data/_layouts/talk.html +123 -0
  61. data/_sass/bootstrap/_alert.scss +52 -0
  62. data/_sass/bootstrap/_badge.scss +54 -0
  63. data/_sass/bootstrap/_breadcrumb.scss +44 -0
  64. data/_sass/bootstrap/_button-group.scss +163 -0
  65. data/_sass/bootstrap/_buttons.scss +142 -0
  66. data/_sass/bootstrap/_card.scss +286 -0
  67. data/_sass/bootstrap/_carousel.scss +197 -0
  68. data/_sass/bootstrap/_close.scss +40 -0
  69. data/_sass/bootstrap/_code.scss +48 -0
  70. data/_sass/bootstrap/_custom-forms.scss +524 -0
  71. data/_sass/bootstrap/_dropdown.scss +192 -0
  72. data/_sass/bootstrap/_forms.scss +347 -0
  73. data/_sass/bootstrap/_functions.scss +144 -0
  74. data/_sass/bootstrap/_grid.scss +73 -0
  75. data/_sass/bootstrap/_images.scss +42 -0
  76. data/_sass/bootstrap/_input-group.scss +192 -0
  77. data/_sass/bootstrap/_jumbotron.scss +17 -0
  78. data/_sass/bootstrap/_list-group.scss +154 -0
  79. data/_sass/bootstrap/_media.scss +8 -0
  80. data/_sass/bootstrap/_mixins.scss +47 -0
  81. data/_sass/bootstrap/_modal.scss +240 -0
  82. data/_sass/bootstrap/_nav.scss +123 -0
  83. data/_sass/bootstrap/_navbar.scss +324 -0
  84. data/_sass/bootstrap/_pagination.scss +74 -0
  85. data/_sass/bootstrap/_popover.scss +170 -0
  86. data/_sass/bootstrap/_print.scss +141 -0
  87. data/_sass/bootstrap/_progress.scss +47 -0
  88. data/_sass/bootstrap/_reboot.scss +484 -0
  89. data/_sass/bootstrap/_root.scss +20 -0
  90. data/_sass/bootstrap/_spinners.scss +56 -0
  91. data/_sass/bootstrap/_tables.scss +185 -0
  92. data/_sass/bootstrap/_toasts.scss +46 -0
  93. data/_sass/bootstrap/_tooltip.scss +115 -0
  94. data/_sass/bootstrap/_transitions.scss +20 -0
  95. data/_sass/bootstrap/_type.scss +125 -0
  96. data/_sass/bootstrap/_utilities.scss +18 -0
  97. data/_sass/bootstrap/_variables.scss +1142 -0
  98. data/_sass/bootstrap/bootstrap-grid.scss +29 -0
  99. data/_sass/bootstrap/bootstrap-reboot.scss +12 -0
  100. data/_sass/bootstrap/bootstrap.scss +44 -0
  101. data/_sass/bootstrap/mixins/_alert.scss +13 -0
  102. data/_sass/bootstrap/mixins/_background-variant.scss +23 -0
  103. data/_sass/bootstrap/mixins/_badge.scss +17 -0
  104. data/_sass/bootstrap/mixins/_border-radius.scss +76 -0
  105. data/_sass/bootstrap/mixins/_box-shadow.scss +20 -0
  106. data/_sass/bootstrap/mixins/_breakpoints.scss +123 -0
  107. data/_sass/bootstrap/mixins/_buttons.scss +110 -0
  108. data/_sass/bootstrap/mixins/_caret.scss +62 -0
  109. data/_sass/bootstrap/mixins/_clearfix.scss +7 -0
  110. data/_sass/bootstrap/mixins/_deprecate.scss +10 -0
  111. data/_sass/bootstrap/mixins/_float.scss +14 -0
  112. data/_sass/bootstrap/mixins/_forms.scss +178 -0
  113. data/_sass/bootstrap/mixins/_gradients.scss +45 -0
  114. data/_sass/bootstrap/mixins/_grid-framework.scss +80 -0
  115. data/_sass/bootstrap/mixins/_grid.scss +69 -0
  116. data/_sass/bootstrap/mixins/_hover.scss +37 -0
  117. data/_sass/bootstrap/mixins/_image.scss +36 -0
  118. data/_sass/bootstrap/mixins/_list-group.scss +21 -0
  119. data/_sass/bootstrap/mixins/_lists.scss +7 -0
  120. data/_sass/bootstrap/mixins/_nav-divider.scss +11 -0
  121. data/_sass/bootstrap/mixins/_pagination.scss +22 -0
  122. data/_sass/bootstrap/mixins/_reset-text.scss +17 -0
  123. data/_sass/bootstrap/mixins/_resize.scss +6 -0
  124. data/_sass/bootstrap/mixins/_screen-reader.scss +34 -0
  125. data/_sass/bootstrap/mixins/_size.scss +7 -0
  126. data/_sass/bootstrap/mixins/_table-row.scss +39 -0
  127. data/_sass/bootstrap/mixins/_text-emphasis.scss +17 -0
  128. data/_sass/bootstrap/mixins/_text-hide.scss +11 -0
  129. data/_sass/bootstrap/mixins/_text-truncate.scss +8 -0
  130. data/_sass/bootstrap/mixins/_transition.scss +26 -0
  131. data/_sass/bootstrap/mixins/_visibility.scss +8 -0
  132. data/_sass/bootstrap/utilities/_align.scss +8 -0
  133. data/_sass/bootstrap/utilities/_background.scss +19 -0
  134. data/_sass/bootstrap/utilities/_borders.scss +75 -0
  135. data/_sass/bootstrap/utilities/_clearfix.scss +3 -0
  136. data/_sass/bootstrap/utilities/_display.scss +26 -0
  137. data/_sass/bootstrap/utilities/_embed.scss +39 -0
  138. data/_sass/bootstrap/utilities/_flex.scss +51 -0
  139. data/_sass/bootstrap/utilities/_float.scss +11 -0
  140. data/_sass/bootstrap/utilities/_interactions.scss +5 -0
  141. data/_sass/bootstrap/utilities/_overflow.scss +5 -0
  142. data/_sass/bootstrap/utilities/_position.scss +32 -0
  143. data/_sass/bootstrap/utilities/_screenreaders.scss +11 -0
  144. data/_sass/bootstrap/utilities/_shadows.scss +6 -0
  145. data/_sass/bootstrap/utilities/_sizing.scss +20 -0
  146. data/_sass/bootstrap/utilities/_spacing.scss +73 -0
  147. data/_sass/bootstrap/utilities/_stretched-link.scss +19 -0
  148. data/_sass/bootstrap/utilities/_text.scss +72 -0
  149. data/_sass/bootstrap/utilities/_visibility.scss +13 -0
  150. data/_sass/bootstrap/vendor/_rfs.scss +204 -0
  151. data/_sass/conference.scss +255 -0
  152. data/_sass/font-awesome/_animated.scss +20 -0
  153. data/_sass/font-awesome/_bordered-pulled.scss +20 -0
  154. data/_sass/font-awesome/_core.scss +21 -0
  155. data/_sass/font-awesome/_fixed-width.scss +6 -0
  156. data/_sass/font-awesome/_icons.scss +1462 -0
  157. data/_sass/font-awesome/_larger.scss +23 -0
  158. data/_sass/font-awesome/_list.scss +18 -0
  159. data/_sass/font-awesome/_mixins.scss +56 -0
  160. data/_sass/font-awesome/_rotated-flipped.scss +24 -0
  161. data/_sass/font-awesome/_screen-reader.scss +5 -0
  162. data/_sass/font-awesome/_shims.scss +2066 -0
  163. data/_sass/font-awesome/_stacked.scss +31 -0
  164. data/_sass/font-awesome/_variables.scss +1479 -0
  165. data/_sass/font-awesome/brands.scss +23 -0
  166. data/_sass/font-awesome/fontawesome.scss +16 -0
  167. data/_sass/font-awesome/regular.scss +23 -0
  168. data/_sass/font-awesome/scss/_animated.scss +20 -0
  169. data/_sass/font-awesome/scss/_bordered-pulled.scss +20 -0
  170. data/_sass/font-awesome/scss/_core.scss +21 -0
  171. data/_sass/font-awesome/scss/_fixed-width.scss +6 -0
  172. data/_sass/font-awesome/scss/_icons.scss +1441 -0
  173. data/_sass/font-awesome/scss/_larger.scss +23 -0
  174. data/_sass/font-awesome/scss/_list.scss +18 -0
  175. data/_sass/font-awesome/scss/_mixins.scss +56 -0
  176. data/_sass/font-awesome/scss/_rotated-flipped.scss +24 -0
  177. data/_sass/font-awesome/scss/_screen-reader.scss +5 -0
  178. data/_sass/font-awesome/scss/_shims.scss +2066 -0
  179. data/_sass/font-awesome/scss/_stacked.scss +31 -0
  180. data/_sass/font-awesome/scss/_variables.scss +1458 -0
  181. data/_sass/font-awesome/scss/brands.scss +23 -0
  182. data/_sass/font-awesome/scss/fontawesome.scss +16 -0
  183. data/_sass/font-awesome/scss/regular.scss +23 -0
  184. data/_sass/font-awesome/scss/solid.scss +24 -0
  185. data/_sass/font-awesome/scss/v4-shims.scss +6 -0
  186. data/_sass/font-awesome/solid.scss +24 -0
  187. data/_sass/font-awesome/v4-shims.scss +6 -0
  188. data/_sass/leaflet/leaflet-easybutton.scss +56 -0
  189. data/_sass/leaflet/leaflet-locatecontrol.scss +2 -0
  190. data/_sass/leaflet/leaflet.scss +640 -0
  191. data/assets/css/main.scss +6 -0
  192. data/assets/icons/live.svg +57 -0
  193. data/assets/js/config.json +3 -0
  194. data/assets/js/data.json +3 -0
  195. data/assets/js/main.js +4 -0
  196. data/assets/webfonts/fa-brands-400.eot +0 -0
  197. data/assets/webfonts/fa-brands-400.svg +3717 -0
  198. data/assets/webfonts/fa-brands-400.ttf +0 -0
  199. data/assets/webfonts/fa-brands-400.woff +0 -0
  200. data/assets/webfonts/fa-brands-400.woff2 +0 -0
  201. data/assets/webfonts/fa-regular-400.eot +0 -0
  202. data/assets/webfonts/fa-regular-400.svg +801 -0
  203. data/assets/webfonts/fa-regular-400.ttf +0 -0
  204. data/assets/webfonts/fa-regular-400.woff +0 -0
  205. data/assets/webfonts/fa-regular-400.woff2 +0 -0
  206. data/assets/webfonts/fa-solid-900.eot +0 -0
  207. data/assets/webfonts/fa-solid-900.svg +5028 -0
  208. data/assets/webfonts/fa-solid-900.ttf +0 -0
  209. data/assets/webfonts/fa-solid-900.woff +0 -0
  210. data/assets/webfonts/fa-solid-900.woff2 +0 -0
  211. metadata +296 -0
@@ -0,0 +1,376 @@
1
+ (function(){
2
+
3
+ // This is for grouping buttons into a bar
4
+ // takes an array of `L.easyButton`s and
5
+ // then the usual `.addTo(map)`
6
+ L.Control.EasyBar = L.Control.extend({
7
+
8
+ options: {
9
+ position: 'topleft', // part of leaflet's defaults
10
+ id: null, // an id to tag the Bar with
11
+ leafletClasses: true // use leaflet classes?
12
+ },
13
+
14
+
15
+ initialize: function(buttons, options){
16
+
17
+ if(options){
18
+ L.Util.setOptions( this, options );
19
+ }
20
+
21
+ this._buildContainer();
22
+ this._buttons = [];
23
+
24
+ for(var i = 0; i < buttons.length; i++){
25
+ buttons[i]._bar = this;
26
+ buttons[i]._container = buttons[i].button;
27
+ this._buttons.push(buttons[i]);
28
+ this.container.appendChild(buttons[i].button);
29
+ }
30
+
31
+ },
32
+
33
+
34
+ _buildContainer: function(){
35
+ this._container = this.container = L.DomUtil.create('div', '');
36
+ this.options.leafletClasses && L.DomUtil.addClass(this.container, 'leaflet-bar easy-button-container leaflet-control');
37
+ this.options.id && (this.container.id = this.options.id);
38
+ },
39
+
40
+
41
+ enable: function(){
42
+ L.DomUtil.addClass(this.container, 'enabled');
43
+ L.DomUtil.removeClass(this.container, 'disabled');
44
+ this.container.setAttribute('aria-hidden', 'false');
45
+ return this;
46
+ },
47
+
48
+
49
+ disable: function(){
50
+ L.DomUtil.addClass(this.container, 'disabled');
51
+ L.DomUtil.removeClass(this.container, 'enabled');
52
+ this.container.setAttribute('aria-hidden', 'true');
53
+ return this;
54
+ },
55
+
56
+
57
+ onAdd: function () {
58
+ return this.container;
59
+ },
60
+
61
+ addTo: function (map) {
62
+ this._map = map;
63
+
64
+ for(var i = 0; i < this._buttons.length; i++){
65
+ this._buttons[i]._map = map;
66
+ }
67
+
68
+ var container = this._container = this.onAdd(map),
69
+ pos = this.getPosition(),
70
+ corner = map._controlCorners[pos];
71
+
72
+ L.DomUtil.addClass(container, 'leaflet-control');
73
+
74
+ if (pos.indexOf('bottom') !== -1) {
75
+ corner.insertBefore(container, corner.firstChild);
76
+ } else {
77
+ corner.appendChild(container);
78
+ }
79
+
80
+ return this;
81
+ }
82
+
83
+ });
84
+
85
+ L.easyBar = function(){
86
+ var args = [L.Control.EasyBar];
87
+ for(var i = 0; i < arguments.length; i++){
88
+ args.push( arguments[i] );
89
+ }
90
+ return new (Function.prototype.bind.apply(L.Control.EasyBar, args));
91
+ };
92
+
93
+ // L.EasyButton is the actual buttons
94
+ // can be called without being grouped into a bar
95
+ L.Control.EasyButton = L.Control.extend({
96
+
97
+ options: {
98
+ position: 'topleft', // part of leaflet's defaults
99
+
100
+ id: null, // an id to tag the button with
101
+
102
+ type: 'replace', // [(replace|animate)]
103
+ // replace swaps out elements
104
+ // animate changes classes with all elements inserted
105
+
106
+ states: [], // state names look like this
107
+ // {
108
+ // stateName: 'untracked',
109
+ // onClick: function(){ handle_nav_manually(); };
110
+ // title: 'click to make inactive',
111
+ // icon: 'fa-circle', // wrapped with <a>
112
+ // }
113
+
114
+ leafletClasses: true, // use leaflet styles for the button
115
+ tagName: 'button',
116
+ },
117
+
118
+
119
+
120
+ initialize: function(icon, onClick, title, id){
121
+
122
+ // clear the states manually
123
+ this.options.states = [];
124
+
125
+ // add id to options
126
+ if(id != null){
127
+ this.options.id = id;
128
+ }
129
+
130
+ // storage between state functions
131
+ this.storage = {};
132
+
133
+ // is the last item an object?
134
+ if( typeof arguments[arguments.length-1] === 'object' ){
135
+
136
+ // if so, it should be the options
137
+ L.Util.setOptions( this, arguments[arguments.length-1] );
138
+ }
139
+
140
+ // if there aren't any states in options
141
+ // use the early params
142
+ if( this.options.states.length === 0 &&
143
+ typeof icon === 'string' &&
144
+ typeof onClick === 'function'){
145
+
146
+ // turn the options object into a state
147
+ this.options.states.push({
148
+ icon: icon,
149
+ onClick: onClick,
150
+ title: typeof title === 'string' ? title : ''
151
+ });
152
+ }
153
+
154
+ // curate and move user's states into
155
+ // the _states for internal use
156
+ this._states = [];
157
+
158
+ for(var i = 0; i < this.options.states.length; i++){
159
+ this._states.push( new State(this.options.states[i], this) );
160
+ }
161
+
162
+ this._buildButton();
163
+
164
+ this._activateState(this._states[0]);
165
+
166
+ },
167
+
168
+ _buildButton: function(){
169
+
170
+ this.button = L.DomUtil.create(this.options.tagName, '');
171
+
172
+ if (this.options.tagName === 'button') {
173
+ this.button.setAttribute('type', 'button');
174
+ }
175
+
176
+ if (this.options.id ){
177
+ this.button.id = this.options.id;
178
+ }
179
+
180
+ if (this.options.leafletClasses){
181
+ L.DomUtil.addClass(this.button, 'easy-button-button leaflet-bar-part leaflet-interactive');
182
+ }
183
+
184
+ // don't let double clicks and mousedown get to the map
185
+ L.DomEvent.addListener(this.button, 'dblclick', L.DomEvent.stop);
186
+ L.DomEvent.addListener(this.button, 'mousedown', L.DomEvent.stop);
187
+ L.DomEvent.addListener(this.button, 'mouseup', L.DomEvent.stop);
188
+
189
+ // take care of normal clicks
190
+ L.DomEvent.addListener(this.button,'click', function(e){
191
+ L.DomEvent.stop(e);
192
+ this._currentState.onClick(this, this._map ? this._map : null );
193
+ this._map && this._map.getContainer().focus();
194
+ }, this);
195
+
196
+ // prep the contents of the control
197
+ if(this.options.type == 'replace'){
198
+ this.button.appendChild(this._currentState.icon);
199
+ } else {
200
+ for(var i=0;i<this._states.length;i++){
201
+ this.button.appendChild(this._states[i].icon);
202
+ }
203
+ }
204
+ },
205
+
206
+
207
+ _currentState: {
208
+ // placeholder content
209
+ stateName: 'unnamed',
210
+ icon: (function(){ return document.createElement('span'); })()
211
+ },
212
+
213
+
214
+
215
+ _states: null, // populated on init
216
+
217
+
218
+
219
+ state: function(newState){
220
+
221
+ // when called with no args, it's a getter
222
+ if (arguments.length === 0) {
223
+ return this._currentState.stateName;
224
+ }
225
+
226
+ // activate by name
227
+ if(typeof newState == 'string'){
228
+
229
+ this._activateStateNamed(newState);
230
+
231
+ // activate by index
232
+ } else if (typeof newState == 'number'){
233
+
234
+ this._activateState(this._states[newState]);
235
+ }
236
+
237
+ return this;
238
+ },
239
+
240
+
241
+ _activateStateNamed: function(stateName){
242
+ for(var i = 0; i < this._states.length; i++){
243
+ if( this._states[i].stateName == stateName ){
244
+ this._activateState( this._states[i] );
245
+ }
246
+ }
247
+ },
248
+
249
+ _activateState: function(newState){
250
+
251
+ if( newState === this._currentState ){
252
+
253
+ // don't touch the dom if it'll just be the same after
254
+ return;
255
+
256
+ } else {
257
+
258
+ // swap out elements... if you're into that kind of thing
259
+ if( this.options.type == 'replace' ){
260
+ this.button.appendChild(newState.icon);
261
+ this.button.removeChild(this._currentState.icon);
262
+ }
263
+
264
+ if( newState.title ){
265
+ this.button.title = newState.title;
266
+ } else {
267
+ this.button.removeAttribute('title');
268
+ }
269
+
270
+ // update classes for animations
271
+ for(var i=0;i<this._states.length;i++){
272
+ L.DomUtil.removeClass(this._states[i].icon, this._currentState.stateName + '-active');
273
+ L.DomUtil.addClass(this._states[i].icon, newState.stateName + '-active');
274
+ }
275
+
276
+ // update classes for animations
277
+ L.DomUtil.removeClass(this.button, this._currentState.stateName + '-active');
278
+ L.DomUtil.addClass(this.button, newState.stateName + '-active');
279
+
280
+ // update the record
281
+ this._currentState = newState;
282
+
283
+ }
284
+ },
285
+
286
+ enable: function(){
287
+ L.DomUtil.addClass(this.button, 'enabled');
288
+ L.DomUtil.removeClass(this.button, 'disabled');
289
+ this.button.setAttribute('aria-hidden', 'false');
290
+ return this;
291
+ },
292
+
293
+ disable: function(){
294
+ L.DomUtil.addClass(this.button, 'disabled');
295
+ L.DomUtil.removeClass(this.button, 'enabled');
296
+ this.button.setAttribute('aria-hidden', 'true');
297
+ return this;
298
+ },
299
+
300
+ onAdd: function(map){
301
+ var bar = L.easyBar([this], {
302
+ position: this.options.position,
303
+ leafletClasses: this.options.leafletClasses
304
+ });
305
+ this._anonymousBar = bar;
306
+ this._container = bar.container;
307
+ return this._anonymousBar.container;
308
+ },
309
+
310
+ removeFrom: function (map) {
311
+ if (this._map === map)
312
+ this.remove();
313
+ return this;
314
+ },
315
+
316
+ });
317
+
318
+ L.easyButton = function(/* args will pass automatically */){
319
+ var args = Array.prototype.concat.apply([L.Control.EasyButton],arguments);
320
+ return new (Function.prototype.bind.apply(L.Control.EasyButton, args));
321
+ };
322
+
323
+ /*************************
324
+ *
325
+ * util functions
326
+ *
327
+ *************************/
328
+
329
+ // constructor for states so only curated
330
+ // states end up getting called
331
+ function State(template, easyButton){
332
+
333
+ this.title = template.title;
334
+ this.stateName = template.stateName ? template.stateName : 'unnamed-state';
335
+
336
+ // build the wrapper
337
+ this.icon = L.DomUtil.create('span', '');
338
+
339
+ L.DomUtil.addClass(this.icon, 'button-state state-' + this.stateName.replace(/(^\s*|\s*$)/g,''));
340
+ this.icon.innerHTML = buildIcon(template.icon);
341
+ this.onClick = L.Util.bind(template.onClick?template.onClick:function(){}, easyButton);
342
+ }
343
+
344
+ function buildIcon(ambiguousIconString) {
345
+
346
+ var tmpIcon;
347
+
348
+ // does this look like html? (i.e. not a class)
349
+ if( ambiguousIconString.match(/[&;=<>"']/) ){
350
+
351
+ // if so, the user should have put in html
352
+ // so move forward as such
353
+ tmpIcon = ambiguousIconString;
354
+
355
+ // then it wasn't html, so
356
+ // it's a class list, figure out what kind
357
+ } else {
358
+ ambiguousIconString = ambiguousIconString.replace(/(^\s*|\s*$)/g,'');
359
+ tmpIcon = L.DomUtil.create('span', '');
360
+
361
+ if( ambiguousIconString.indexOf('fa-') === 0 ){
362
+ L.DomUtil.addClass(tmpIcon, 'fa ' + ambiguousIconString)
363
+ } else if ( ambiguousIconString.indexOf('glyphicon-') === 0 ) {
364
+ L.DomUtil.addClass(tmpIcon, 'glyphicon ' + ambiguousIconString)
365
+ } else {
366
+ L.DomUtil.addClass(tmpIcon, /*rollwithit*/ ambiguousIconString)
367
+ }
368
+
369
+ // make this a string so that it's easy to set innerHTML below
370
+ tmpIcon = tmpIcon.outerHTML;
371
+ }
372
+
373
+ return tmpIcon;
374
+ }
375
+
376
+ })();
@@ -0,0 +1,4 @@
1
+ /*! Version: 0.72.1
2
+ Copyright (c) 2016 Dominik Moritz */
3
+
4
+ !function(t,i){"function"==typeof define&&define.amd?define(["leaflet"],t):"object"==typeof exports&&(void 0!==i&&i.L?module.exports=t(L):module.exports=t(require("leaflet"))),void 0!==i&&i.L&&(i.L.Control.Locate=t(L))}(function(l){function o(i,o,t){(t=t.split(" ")).forEach(function(t){l.DomUtil[i].call(this,o,t)})}function i(t,i){o("addClass",t,i)}function s(t,i){o("removeClass",t,i)}var t=l.Marker.extend({initialize:function(t,i){l.Util.setOptions(this,i),this._latlng=t,this.createIcon()},createIcon:function(){var t=this.options,i="";void 0!==t.color&&(i+="stroke:"+t.color+";"),void 0!==t.weight&&(i+="stroke-width:"+t.weight+";"),void 0!==t.fillColor&&(i+="fill:"+t.fillColor+";"),void 0!==t.fillOpacity&&(i+="fill-opacity:"+t.fillOpacity+";"),void 0!==t.opacity&&(i+="opacity:"+t.opacity+";");var o=this._getIconSVG(t,i);this._locationIcon=l.divIcon({className:o.className,html:o.svg,iconSize:[o.w,o.h]}),this.setIcon(this._locationIcon)},_getIconSVG:function(t,i){var o=t.radius,s=o+t.weight,e=2*s;return{className:"leaflet-control-locate-location",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="'+e+'" height="'+e+'" version="1.1" viewBox="-'+s+" -"+s+" "+e+" "+e+'"><circle r="'+o+'" style="'+i+'" /></svg>',w:e,h:e}},setStyle:function(t){l.Util.setOptions(this,t),this.createIcon()}}),e=t.extend({initialize:function(t,i,o){l.Util.setOptions(this,o),this._latlng=t,this._heading=i,this.createIcon()},setHeading:function(t){this._heading=t},_getIconSVG:function(t,i){var o=t.radius,s=t.width+t.weight,e=2*(o+t.depth+t.weight),n="M0,0 l"+t.width/2+","+t.depth+" l-"+s+",0 z";return{className:"leaflet-control-locate-heading",svg:'<svg xmlns="http://www.w3.org/2000/svg" width="'+s+'" height="'+e+'" version="1.1" viewBox="-'+s/2+" 0 "+s+" "+e+'" style="'+("transform: rotate("+this._heading+"deg)")+'"><path d="'+n+'" style="'+i+'" /></svg>',w:s,h:e}}}),n=l.Control.extend({options:{position:"topleft",layer:void 0,setView:"untilPanOrZoom",keepCurrentZoomLevel:!1,initialZoomLevel:!1,getLocationBounds:function(t){return t.bounds},flyTo:!1,clickBehavior:{inView:"stop",outOfView:"setView",inViewNotFollowing:"inView"},returnToPrevBounds:!1,cacheLocation:!0,drawCircle:!0,drawMarker:!0,showCompass:!0,markerClass:t,compassClass:e,circleStyle:{className:"leaflet-control-locate-circle",color:"#136AEC",fillColor:"#136AEC",fillOpacity:.15,weight:0},markerStyle:{className:"leaflet-control-locate-marker",color:"#fff",fillColor:"#2A93EE",fillOpacity:1,weight:3,opacity:1,radius:9},compassStyle:{fillColor:"#2A93EE",fillOpacity:1,weight:0,color:"#fff",opacity:1,radius:9,width:9,depth:6},followCircleStyle:{},followMarkerStyle:{},followCompassStyle:{},icon:"fa fa-map-marker",iconLoading:"fa fa-spinner fa-spin",iconElementTag:"span",circlePadding:[0,0],metric:!0,createButtonCallback:function(t,i){var o=l.DomUtil.create("a","leaflet-bar-part leaflet-bar-part-single",t);return o.title=i.strings.title,o.role="button",o.href="#",{link:o,icon:l.DomUtil.create(i.iconElementTag,i.icon,o)}},onLocationError:function(t,i){alert(t.message)},onLocationOutsideMapBounds:function(t){t.stop(),alert(t.options.strings.outsideMapBoundsMsg)},showPopup:!0,strings:{title:"Show me where I am",metersUnit:"meters",feetUnit:"feet",popup:"You are within {distance} {unit} from this point",outsideMapBoundsMsg:"You seem located outside the boundaries of the map"},locateOptions:{maxZoom:1/0,watch:!0,setView:!1}},initialize:function(t){for(var i in t)"object"==typeof this.options[i]?l.extend(this.options[i],t[i]):this.options[i]=t[i];this.options.followMarkerStyle=l.extend({},this.options.markerStyle,this.options.followMarkerStyle),this.options.followCircleStyle=l.extend({},this.options.circleStyle,this.options.followCircleStyle),this.options.followCompassStyle=l.extend({},this.options.compassStyle,this.options.followCompassStyle)},onAdd:function(t){var i=l.DomUtil.create("div","leaflet-control-locate leaflet-bar leaflet-control");this._container=i,this._map=t,this._layer=this.options.layer||new l.LayerGroup,this._layer.addTo(t),this._event=void 0,this._compassHeading=null,this._prevBounds=null;var o=this.options.createButtonCallback(i,this.options);return this._link=o.link,this._icon=o.icon,l.DomEvent.on(this._link,"click",l.DomEvent.stopPropagation).on(this._link,"click",l.DomEvent.preventDefault).on(this._link,"click",this._onClick,this).on(this._link,"dblclick",l.DomEvent.stopPropagation),this._resetVariables(),this._map.on("unload",this._unload,this),i},_onClick:function(){this._justClicked=!0;var t=this._isFollowing();if(this._userPanned=!1,this._userZoomed=!1,this._active&&!this._event)this.stop();else if(this._active&&void 0!==this._event){var i=this.options.clickBehavior,o=i.outOfView;switch(this._map.getBounds().contains(this._event.latlng)&&(o=t?i.inView:i.inViewNotFollowing),i[o]&&(o=i[o]),o){case"setView":this.setView();break;case"stop":this.stop(),this.options.returnToPrevBounds&&(this.options.flyTo?this._map.flyToBounds:this._map.fitBounds).bind(this._map)(this._prevBounds)}}else this.options.returnToPrevBounds&&(this._prevBounds=this._map.getBounds()),this.start();this._updateContainerStyle()},start:function(){this._activate(),this._event&&(this._drawMarker(this._map),this.options.setView&&this.setView()),this._updateContainerStyle()},stop:function(){this._deactivate(),this._cleanClasses(),this._resetVariables(),this._removeMarker()},stopFollowing:function(){this._userPanned=!0,this._updateContainerStyle(),this._drawMarker()},_activate:function(){var t,i,o;this._active||(this._map.locate(this.options.locateOptions),this._active=!0,this._map.on("locationfound",this._onLocationFound,this),this._map.on("locationerror",this._onLocationError,this),this._map.on("dragstart",this._onDrag,this),this._map.on("zoomstart",this._onZoom,this),this._map.on("zoomend",this._onZoomEnd,this),!this.options.showCompass||((t="ondeviceorientationabsolute"in window)||"ondeviceorientation"in window)&&(i=this,o=function(){l.DomEvent.on(window,t?"deviceorientationabsolute":"deviceorientation",i._onDeviceOrientation,i)},DeviceOrientationEvent&&"function"==typeof DeviceOrientationEvent.requestPermission?DeviceOrientationEvent.requestPermission().then(function(t){"granted"===t&&o()}):o()))},_deactivate:function(){this._map.stopLocate(),this._active=!1,this.options.cacheLocation||(this._event=void 0),this._map.off("locationfound",this._onLocationFound,this),this._map.off("locationerror",this._onLocationError,this),this._map.off("dragstart",this._onDrag,this),this._map.off("zoomstart",this._onZoom,this),this._map.off("zoomend",this._onZoomEnd,this),this.options.showCompass&&(this._compassHeading=null,"ondeviceorientationabsolute"in window?l.DomEvent.off(window,"deviceorientationabsolute",this._onDeviceOrientation,this):"ondeviceorientation"in window&&l.DomEvent.off(window,"deviceorientation",this._onDeviceOrientation,this))},setView:function(){var t;this._drawMarker(),this._isOutsideMapBounds()?(this._event=void 0,this.options.onLocationOutsideMapBounds(this)):this._justClicked&&!1!==this.options.initialZoomLevel?(t=this.options.flyTo?this._map.flyTo:this._map.setView).bind(this._map)([this._event.latitude,this._event.longitude],this.options.initialZoomLevel):this.options.keepCurrentZoomLevel?(t=this.options.flyTo?this._map.flyTo:this._map.panTo).bind(this._map)([this._event.latitude,this._event.longitude]):(t=this.options.flyTo?this._map.flyToBounds:this._map.fitBounds,this._ignoreEvent=!0,t.bind(this._map)(this.options.getLocationBounds(this._event),{padding:this.options.circlePadding,maxZoom:this.options.locateOptions.maxZoom}),l.Util.requestAnimFrame(function(){this._ignoreEvent=!1},this))},_drawCompass:function(){var t,i;this._event&&(t=this._event.latlng,this.options.showCompass&&t&&null!==this._compassHeading&&(i=this._isFollowing()?this.options.followCompassStyle:this.options.compassStyle,this._compass?(this._compass.setLatLng(t),this._compass.setHeading(this._compassHeading),this._compass.setStyle&&this._compass.setStyle(i)):this._compass=new this.options.compassClass(t,this._compassHeading,i).addTo(this._layer)),!this._compass||this.options.showCompass&&null!==this._compassHeading||(this._compass.removeFrom(this._layer),this._compass=null))},_drawMarker:function(){void 0===this._event.accuracy&&(this._event.accuracy=0);var t,i,o,s,e=this._event.accuracy,n=this._event.latlng;this.options.drawCircle&&(t=this._isFollowing()?this.options.followCircleStyle:this.options.circleStyle,this._circle?this._circle.setLatLng(n).setRadius(e).setStyle(t):this._circle=l.circle(n,e,t).addTo(this._layer)),o=this.options.metric?(i=e.toFixed(0),this.options.strings.metersUnit):(i=(3.2808399*e).toFixed(0),this.options.strings.feetUnit),this.options.drawMarker&&(s=this._isFollowing()?this.options.followMarkerStyle:this.options.markerStyle,this._marker?(this._marker.setLatLng(n),this._marker.setStyle&&this._marker.setStyle(s)):this._marker=new this.options.markerClass(n,s).addTo(this._layer)),this._drawCompass();var a=this.options.strings.popup;function h(){return"string"==typeof a?l.Util.template(a,{distance:i,unit:o}):"function"==typeof a?a({distance:i,unit:o}):a}this.options.showPopup&&a&&this._marker&&this._marker.bindPopup(h())._popup.setLatLng(n),this.options.showPopup&&a&&this._compass&&this._compass.bindPopup(h())._popup.setLatLng(n)},_removeMarker:function(){this._layer.clearLayers(),this._marker=void 0,this._circle=void 0},_unload:function(){this.stop(),this._map.off("unload",this._unload,this)},_setCompassHeading:function(t){!isNaN(parseFloat(t))&&isFinite(t)?(t=Math.round(t),this._compassHeading=t,l.Util.requestAnimFrame(this._drawCompass,this)):this._compassHeading=null},_onCompassNeedsCalibration:function(){this._setCompassHeading()},_onDeviceOrientation:function(t){this._active&&(t.webkitCompassHeading?this._setCompassHeading(t.webkitCompassHeading):t.absolute&&t.alpha&&this._setCompassHeading(360-t.alpha))},_onLocationError:function(t){3==t.code&&this.options.locateOptions.watch||(this.stop(),this.options.onLocationError(t,this))},_onLocationFound:function(t){if((!this._event||this._event.latlng.lat!==t.latlng.lat||this._event.latlng.lng!==t.latlng.lng||this._event.accuracy!==t.accuracy)&&this._active){switch(this._event=t,this._drawMarker(),this._updateContainerStyle(),this.options.setView){case"once":this._justClicked&&this.setView();break;case"untilPan":this._userPanned||this.setView();break;case"untilPanOrZoom":this._userPanned||this._userZoomed||this.setView();break;case"always":this.setView()}this._justClicked=!1}},_onDrag:function(){this._event&&!this._ignoreEvent&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_onZoom:function(){this._event&&!this._ignoreEvent&&(this._userZoomed=!0,this._updateContainerStyle(),this._drawMarker())},_onZoomEnd:function(){this._event&&this._drawCompass(),this._event&&!this._ignoreEvent&&this._marker&&!this._map.getBounds().pad(-.3).contains(this._marker.getLatLng())&&(this._userPanned=!0,this._updateContainerStyle(),this._drawMarker())},_isFollowing:function(){return!!this._active&&("always"===this.options.setView||("untilPan"===this.options.setView?!this._userPanned:"untilPanOrZoom"===this.options.setView?!this._userPanned&&!this._userZoomed:void 0))},_isOutsideMapBounds:function(){return void 0!==this._event&&(this._map.options.maxBounds&&!this._map.options.maxBounds.contains(this._event.latlng))},_updateContainerStyle:function(){this._container&&(this._active&&!this._event?this._setClasses("requesting"):this._isFollowing()?this._setClasses("following"):this._active?this._setClasses("active"):this._cleanClasses())},_setClasses:function(t){"requesting"==t?(s(this._container,"active following"),i(this._container,"requesting"),s(this._icon,this.options.icon),i(this._icon,this.options.iconLoading)):"active"==t?(s(this._container,"requesting following"),i(this._container,"active"),s(this._icon,this.options.iconLoading),i(this._icon,this.options.icon)):"following"==t&&(s(this._container,"requesting"),i(this._container,"active following"),s(this._icon,this.options.iconLoading),i(this._icon,this.options.icon))},_cleanClasses:function(){l.DomUtil.removeClass(this._container,"requesting"),l.DomUtil.removeClass(this._container,"active"),l.DomUtil.removeClass(this._container,"following"),s(this._icon,this.options.iconLoading),i(this._icon,this.options.icon)},_resetVariables:function(){this._active=!1,this._justClicked=!1,this._userPanned=!1,this._userZoomed=!1}});return l.control.locate=function(t){return new l.Control.Locate(t)},n},window);