rails-active-ui 0.3.0 → 0.3.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 (195) hide show
  1. checksums.yaml +4 -4
  2. data/formantic-ui/components/accordion.css +369 -0
  3. data/formantic-ui/components/accordion.js +595 -0
  4. data/formantic-ui/components/accordion.min.css +9 -0
  5. data/formantic-ui/components/accordion.min.js +11 -0
  6. data/formantic-ui/components/ad.css +264 -0
  7. data/formantic-ui/components/ad.min.css +10 -0
  8. data/formantic-ui/components/api.js +1225 -0
  9. data/formantic-ui/components/api.min.js +11 -0
  10. data/formantic-ui/components/breadcrumb.css +135 -0
  11. data/formantic-ui/components/breadcrumb.min.css +9 -0
  12. data/formantic-ui/components/button.css +4058 -0
  13. data/formantic-ui/components/button.min.css +9 -0
  14. data/formantic-ui/components/calendar.css +327 -0
  15. data/formantic-ui/components/calendar.js +2045 -0
  16. data/formantic-ui/components/calendar.min.css +9 -0
  17. data/formantic-ui/components/calendar.min.js +11 -0
  18. data/formantic-ui/components/card.css +1881 -0
  19. data/formantic-ui/components/card.min.css +9 -0
  20. data/formantic-ui/components/checkbox.css +785 -0
  21. data/formantic-ui/components/checkbox.js +888 -0
  22. data/formantic-ui/components/checkbox.min.css +9 -0
  23. data/formantic-ui/components/checkbox.min.js +11 -0
  24. data/formantic-ui/components/comment.css +283 -0
  25. data/formantic-ui/components/comment.min.css +9 -0
  26. data/formantic-ui/components/container.css +300 -0
  27. data/formantic-ui/components/container.min.css +9 -0
  28. data/formantic-ui/components/dimmer.css +367 -0
  29. data/formantic-ui/components/dimmer.js +732 -0
  30. data/formantic-ui/components/dimmer.min.css +9 -0
  31. data/formantic-ui/components/dimmer.min.js +11 -0
  32. data/formantic-ui/components/divider.css +287 -0
  33. data/formantic-ui/components/divider.min.css +9 -0
  34. data/formantic-ui/components/dropdown.css +2087 -0
  35. data/formantic-ui/components/dropdown.js +4432 -0
  36. data/formantic-ui/components/dropdown.min.css +9 -0
  37. data/formantic-ui/components/dropdown.min.js +11 -0
  38. data/formantic-ui/components/embed.css +155 -0
  39. data/formantic-ui/components/embed.js +688 -0
  40. data/formantic-ui/components/embed.min.css +9 -0
  41. data/formantic-ui/components/embed.min.js +11 -0
  42. data/formantic-ui/components/emoji.css +15311 -0
  43. data/formantic-ui/components/emoji.min.css +9 -0
  44. data/formantic-ui/components/feed.css +799 -0
  45. data/formantic-ui/components/feed.min.css +9 -0
  46. data/formantic-ui/components/flag.css +1149 -0
  47. data/formantic-ui/components/flag.min.css +9 -0
  48. data/formantic-ui/components/flyout.css +546 -0
  49. data/formantic-ui/components/flyout.js +1551 -0
  50. data/formantic-ui/components/flyout.min.css +9 -0
  51. data/formantic-ui/components/flyout.min.js +11 -0
  52. data/formantic-ui/components/form.css +1885 -0
  53. data/formantic-ui/components/form.js +2199 -0
  54. data/formantic-ui/components/form.min.css +9 -0
  55. data/formantic-ui/components/form.min.js +11 -0
  56. data/formantic-ui/components/grid.css +1952 -0
  57. data/formantic-ui/components/grid.min.css +9 -0
  58. data/formantic-ui/components/header.css +778 -0
  59. data/formantic-ui/components/header.min.css +9 -0
  60. data/formantic-ui/components/icon.css +7066 -0
  61. data/formantic-ui/components/icon.min.css +9 -0
  62. data/formantic-ui/components/image.css +315 -0
  63. data/formantic-ui/components/image.min.css +9 -0
  64. data/formantic-ui/components/input.css +1566 -0
  65. data/formantic-ui/components/input.min.css +9 -0
  66. data/formantic-ui/components/item.css +534 -0
  67. data/formantic-ui/components/item.min.css +9 -0
  68. data/formantic-ui/components/label.css +2114 -0
  69. data/formantic-ui/components/label.min.css +9 -0
  70. data/formantic-ui/components/list.css +955 -0
  71. data/formantic-ui/components/list.min.css +9 -0
  72. data/formantic-ui/components/loader.css +787 -0
  73. data/formantic-ui/components/loader.min.css +9 -0
  74. data/formantic-ui/components/menu.css +2131 -0
  75. data/formantic-ui/components/menu.min.css +9 -0
  76. data/formantic-ui/components/message.css +619 -0
  77. data/formantic-ui/components/message.min.css +9 -0
  78. data/formantic-ui/components/modal.css +779 -0
  79. data/formantic-ui/components/modal.js +1637 -0
  80. data/formantic-ui/components/modal.min.css +9 -0
  81. data/formantic-ui/components/modal.min.js +11 -0
  82. data/formantic-ui/components/nag.css +290 -0
  83. data/formantic-ui/components/nag.js +566 -0
  84. data/formantic-ui/components/nag.min.css +9 -0
  85. data/formantic-ui/components/nag.min.js +11 -0
  86. data/formantic-ui/components/placeholder.css +228 -0
  87. data/formantic-ui/components/placeholder.min.css +9 -0
  88. data/formantic-ui/components/popup.css +1184 -0
  89. data/formantic-ui/components/popup.js +1561 -0
  90. data/formantic-ui/components/popup.min.css +9 -0
  91. data/formantic-ui/components/popup.min.js +11 -0
  92. data/formantic-ui/components/progress.css +761 -0
  93. data/formantic-ui/components/progress.js +979 -0
  94. data/formantic-ui/components/progress.min.css +9 -0
  95. data/formantic-ui/components/progress.min.js +11 -0
  96. data/formantic-ui/components/rail.css +147 -0
  97. data/formantic-ui/components/rail.min.css +9 -0
  98. data/formantic-ui/components/rating.css +414 -0
  99. data/formantic-ui/components/rating.js +540 -0
  100. data/formantic-ui/components/rating.min.css +9 -0
  101. data/formantic-ui/components/rating.min.js +11 -0
  102. data/formantic-ui/components/reset.css +386 -0
  103. data/formantic-ui/components/reset.min.css +9 -0
  104. data/formantic-ui/components/reveal.css +277 -0
  105. data/formantic-ui/components/reveal.min.css +9 -0
  106. data/formantic-ui/components/search.css +541 -0
  107. data/formantic-ui/components/search.js +1641 -0
  108. data/formantic-ui/components/search.min.css +9 -0
  109. data/formantic-ui/components/search.min.js +11 -0
  110. data/formantic-ui/components/segment.css +1053 -0
  111. data/formantic-ui/components/segment.min.css +9 -0
  112. data/formantic-ui/components/shape.css +144 -0
  113. data/formantic-ui/components/shape.js +797 -0
  114. data/formantic-ui/components/shape.min.css +9 -0
  115. data/formantic-ui/components/shape.min.js +11 -0
  116. data/formantic-ui/components/sidebar.css +539 -0
  117. data/formantic-ui/components/sidebar.js +1054 -0
  118. data/formantic-ui/components/sidebar.min.css +9 -0
  119. data/formantic-ui/components/sidebar.min.js +11 -0
  120. data/formantic-ui/components/site.css +286 -0
  121. data/formantic-ui/components/site.js +455 -0
  122. data/formantic-ui/components/site.min.css +9 -0
  123. data/formantic-ui/components/site.min.js +11 -0
  124. data/formantic-ui/components/slider.css +926 -0
  125. data/formantic-ui/components/slider.js +1546 -0
  126. data/formantic-ui/components/slider.min.css +9 -0
  127. data/formantic-ui/components/slider.min.js +11 -0
  128. data/formantic-ui/components/state.js +697 -0
  129. data/formantic-ui/components/state.min.js +11 -0
  130. data/formantic-ui/components/statistic.css +586 -0
  131. data/formantic-ui/components/statistic.min.css +9 -0
  132. data/formantic-ui/components/step.css +1538 -0
  133. data/formantic-ui/components/step.min.css +9 -0
  134. data/formantic-ui/components/sticky.css +73 -0
  135. data/formantic-ui/components/sticky.js +917 -0
  136. data/formantic-ui/components/sticky.min.css +9 -0
  137. data/formantic-ui/components/sticky.min.js +11 -0
  138. data/formantic-ui/components/tab.css +84 -0
  139. data/formantic-ui/components/tab.js +967 -0
  140. data/formantic-ui/components/tab.min.css +9 -0
  141. data/formantic-ui/components/tab.min.js +11 -0
  142. data/formantic-ui/components/table.css +3473 -0
  143. data/formantic-ui/components/table.min.css +9 -0
  144. data/formantic-ui/components/text.css +155 -0
  145. data/formantic-ui/components/text.min.css +9 -0
  146. data/formantic-ui/components/toast.css +751 -0
  147. data/formantic-ui/components/toast.js +964 -0
  148. data/formantic-ui/components/toast.min.css +9 -0
  149. data/formantic-ui/components/toast.min.js +11 -0
  150. data/formantic-ui/components/transition.css +1148 -0
  151. data/formantic-ui/components/transition.js +1034 -0
  152. data/formantic-ui/components/transition.min.css +9 -0
  153. data/formantic-ui/components/transition.min.js +11 -0
  154. data/formantic-ui/components/visibility.js +1292 -0
  155. data/formantic-ui/components/visibility.min.js +11 -0
  156. data/formantic-ui/semantic.css +78485 -0
  157. data/formantic-ui/semantic.js +31036 -0
  158. data/formantic-ui/semantic.min.css +11 -0
  159. data/formantic-ui/semantic.min.js +11 -0
  160. data/formantic-ui/themes/basic/assets/fonts/LICENSE.txt +91 -0
  161. data/formantic-ui/themes/basic/assets/fonts/icons.woff +0 -0
  162. data/formantic-ui/themes/basic/assets/fonts/icons.woff2 +0 -0
  163. data/formantic-ui/themes/default/assets/fonts/LICENSE_Lato.txt +94 -0
  164. data/formantic-ui/themes/default/assets/fonts/LICENSE_icons.txt +165 -0
  165. data/formantic-ui/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  166. data/formantic-ui/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
  167. data/formantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  168. data/formantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
  169. data/formantic-ui/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  170. data/formantic-ui/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
  171. data/formantic-ui/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  172. data/formantic-ui/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
  173. data/formantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  174. data/formantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
  175. data/formantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  176. data/formantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
  177. data/formantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  178. data/formantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
  179. data/formantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  180. data/formantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
  181. data/formantic-ui/themes/default/assets/fonts/brand-icons.woff +0 -0
  182. data/formantic-ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
  183. data/formantic-ui/themes/default/assets/fonts/icons.woff +0 -0
  184. data/formantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
  185. data/formantic-ui/themes/default/assets/fonts/outline-icons.woff +0 -0
  186. data/formantic-ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
  187. data/formantic-ui/themes/famfamfam/assets/images/flags.png +0 -0
  188. data/formantic-ui/themes/github/assets/fonts/LICENSE.txt +94 -0
  189. data/formantic-ui/themes/github/assets/fonts/octicons.woff +0 -0
  190. data/formantic-ui/themes/github/assets/fonts/octicons.woff2 +0 -0
  191. data/formantic-ui/themes/material/assets/fonts/LICENSE.txt +202 -0
  192. data/formantic-ui/themes/material/assets/fonts/icons.woff +0 -0
  193. data/formantic-ui/themes/material/assets/fonts/icons.woff2 +0 -0
  194. data/lib/ui/version.rb +1 -1
  195. metadata +193 -1
@@ -0,0 +1,688 @@
1
+ /*!
2
+ * # Fomantic-UI 2.9.4 - Embed
3
+ * https://github.com/fomantic/Fomantic-UI/
4
+ *
5
+ *
6
+ * Released under the MIT license
7
+ * https://opensource.org/licenses/MIT
8
+ *
9
+ */
10
+
11
+ (function ($, window, document) {
12
+ 'use strict';
13
+
14
+ function isFunction(obj) {
15
+ return typeof obj === 'function' && typeof obj.nodeType !== 'number';
16
+ }
17
+
18
+ window = window !== undefined && window.Math === Math
19
+ ? window
20
+ : globalThis;
21
+
22
+ $.fn.embed = function (parameters) {
23
+ var
24
+ $allModules = $(this),
25
+
26
+ time = Date.now(),
27
+ performance = [],
28
+
29
+ query = arguments[0],
30
+ methodInvoked = typeof query === 'string',
31
+ queryArguments = [].slice.call(arguments, 1),
32
+
33
+ returnedValue
34
+ ;
35
+
36
+ $allModules.each(function () {
37
+ var
38
+ settings = $.isPlainObject(parameters)
39
+ ? $.extend(true, {}, $.fn.embed.settings, parameters)
40
+ : $.extend({}, $.fn.embed.settings),
41
+
42
+ selector = settings.selector,
43
+ className = settings.className,
44
+ sources = settings.sources,
45
+ error = settings.error,
46
+ metadata = settings.metadata,
47
+ namespace = settings.namespace,
48
+ templates = settings.templates,
49
+
50
+ eventNamespace = '.' + namespace,
51
+ moduleNamespace = 'module-' + namespace,
52
+
53
+ $module = $(this),
54
+ $placeholder = $module.find(selector.placeholder),
55
+ $icon = $module.find(selector.icon),
56
+ $embed = $module.find(selector.embed),
57
+
58
+ element = this,
59
+ instance = $module.data(moduleNamespace),
60
+ module
61
+ ;
62
+
63
+ module = {
64
+
65
+ initialize: function () {
66
+ module.debug('Initializing embed');
67
+ module.determine.autoplay();
68
+ module.create();
69
+ module.bind.events();
70
+ module.instantiate();
71
+ },
72
+
73
+ instantiate: function () {
74
+ module.verbose('Storing instance of module', module);
75
+ instance = module;
76
+ $module
77
+ .data(moduleNamespace, module)
78
+ ;
79
+ },
80
+
81
+ destroy: function () {
82
+ module.verbose('Destroying previous instance of embed');
83
+ module.reset();
84
+ $module
85
+ .removeData(moduleNamespace)
86
+ .off(eventNamespace)
87
+ ;
88
+ },
89
+
90
+ refresh: function () {
91
+ module.verbose('Refreshing selector cache');
92
+ $placeholder = $module.find(selector.placeholder);
93
+ $icon = $module.find(selector.icon);
94
+ $embed = $module.find(selector.embed);
95
+ },
96
+
97
+ bind: {
98
+ events: function () {
99
+ if (module.has.placeholder()) {
100
+ module.debug('Adding placeholder events');
101
+ $module
102
+ .on('click' + eventNamespace, selector.placeholder, module.createAndShow)
103
+ .on('click' + eventNamespace, selector.icon, module.createAndShow)
104
+ ;
105
+ }
106
+ },
107
+ },
108
+
109
+ create: function () {
110
+ var
111
+ placeholder = module.get.placeholder()
112
+ ;
113
+ if (placeholder) {
114
+ module.createPlaceholder();
115
+ } else {
116
+ module.createAndShow();
117
+ }
118
+ },
119
+
120
+ createPlaceholder: function (placeholder) {
121
+ var
122
+ icon = module.get.icon(),
123
+ alt = module.get.alt()
124
+ ;
125
+ placeholder = placeholder || module.get.placeholder();
126
+ $module.html(templates.placeholder(placeholder, icon, alt));
127
+ module.debug('Creating placeholder for embed', placeholder, icon, alt);
128
+ },
129
+
130
+ createEmbed: function (url) {
131
+ module.refresh();
132
+ url = url || module.get.url();
133
+ $embed = $('<div/>')
134
+ .addClass(className.embed)
135
+ .html(module.generate.embed(url))
136
+ .appendTo($module)
137
+ ;
138
+ settings.onCreate.call(element, url);
139
+ module.debug('Creating embed object', $embed);
140
+ },
141
+
142
+ changeEmbed: function (url) {
143
+ $embed
144
+ .html(module.generate.embed(url))
145
+ ;
146
+ },
147
+
148
+ createAndShow: function () {
149
+ module.createEmbed();
150
+ module.show();
151
+ },
152
+
153
+ // sets new embed
154
+ change: function (source, id, url) {
155
+ module.debug('Changing video to ', source, id, url);
156
+ $module
157
+ .data(metadata.source, source)
158
+ .data(metadata.id, id)
159
+ ;
160
+ if (url) {
161
+ $module.data(metadata.url, url);
162
+ } else {
163
+ $module.removeData(metadata.url);
164
+ }
165
+ if (module.has.embed()) {
166
+ module.changeEmbed();
167
+ } else {
168
+ module.create();
169
+ }
170
+ },
171
+
172
+ // clears embed
173
+ reset: function () {
174
+ module.debug('Clearing embed and showing placeholder');
175
+ module.remove.data();
176
+ module.remove.active();
177
+ module.remove.embed();
178
+ module.showPlaceholder();
179
+ settings.onReset.call(element);
180
+ },
181
+
182
+ // shows current embed
183
+ show: function () {
184
+ module.debug('Showing embed');
185
+ module.set.active();
186
+ settings.onDisplay.call(element);
187
+ },
188
+
189
+ hide: function () {
190
+ module.debug('Hiding embed');
191
+ module.showPlaceholder();
192
+ },
193
+
194
+ showPlaceholder: function () {
195
+ module.debug('Showing placeholder image');
196
+ module.remove.active();
197
+ settings.onPlaceholderDisplay.call(element);
198
+ },
199
+
200
+ get: {
201
+ id: function () {
202
+ return settings.id || $module.data(metadata.id);
203
+ },
204
+ placeholder: function () {
205
+ return settings.placeholder || $module.data(metadata.placeholder);
206
+ },
207
+ alt: function () {
208
+ return settings.alt || $module.data(metadata.alt);
209
+ },
210
+ icon: function () {
211
+ return settings.icon || ($module.data(metadata.icon) !== undefined
212
+ ? $module.data(metadata.icon)
213
+ : module.determine.icon());
214
+ },
215
+ source: function (url) {
216
+ return settings.source || ($module.data(metadata.source) !== undefined
217
+ ? $module.data(metadata.source)
218
+ : module.determine.source());
219
+ },
220
+ type: function () {
221
+ var source = module.get.source();
222
+
223
+ return sources[source] !== undefined
224
+ ? sources[source].type
225
+ : false;
226
+ },
227
+ url: function () {
228
+ return settings.url || ($module.data(metadata.url) !== undefined
229
+ ? $module.data(metadata.url)
230
+ : module.determine.url());
231
+ },
232
+ },
233
+
234
+ determine: {
235
+ autoplay: function () {
236
+ if (module.should.autoplay()) {
237
+ settings.autoplay = true;
238
+ }
239
+ },
240
+ source: function (url) {
241
+ var
242
+ matchedSource = false
243
+ ;
244
+ url = url || module.get.url();
245
+ if (url) {
246
+ $.each(sources, function (name, source) {
247
+ if (url.search(source.domain) !== -1) {
248
+ matchedSource = name;
249
+
250
+ return false;
251
+ }
252
+ });
253
+ }
254
+
255
+ return matchedSource;
256
+ },
257
+ icon: function () {
258
+ var
259
+ source = module.get.source()
260
+ ;
261
+
262
+ return sources[source] !== undefined
263
+ ? sources[source].icon
264
+ : false;
265
+ },
266
+ url: function () {
267
+ var
268
+ id = settings.id || $module.data(metadata.id),
269
+ source = settings.source || $module.data(metadata.source),
270
+ url
271
+ ;
272
+ url = sources[source] !== undefined
273
+ ? sources[source].url.replace('{id}', id)
274
+ : false;
275
+ if (url) {
276
+ $module.data(metadata.url, url);
277
+ }
278
+
279
+ return url;
280
+ },
281
+ },
282
+
283
+ set: {
284
+ active: function () {
285
+ $module.addClass(className.active);
286
+ },
287
+ },
288
+
289
+ remove: {
290
+ data: function () {
291
+ $module
292
+ .removeData(metadata.id)
293
+ .removeData(metadata.icon)
294
+ .removeData(metadata.placeholder)
295
+ .removeData(metadata.alt)
296
+ .removeData(metadata.source)
297
+ .removeData(metadata.url)
298
+ ;
299
+ },
300
+ active: function () {
301
+ $module.removeClass(className.active);
302
+ },
303
+ embed: function () {
304
+ $embed.empty();
305
+ },
306
+ },
307
+
308
+ encode: {
309
+ parameters: function (parameters) {
310
+ var
311
+ urlString = [],
312
+ index
313
+ ;
314
+ for (index in parameters) {
315
+ urlString.push(encodeURIComponent(index) + '=' + encodeURIComponent(parameters[index]));
316
+ }
317
+
318
+ return urlString.join('&amp;');
319
+ },
320
+ },
321
+
322
+ generate: {
323
+ embed: function (url) {
324
+ module.debug('Generating embed html');
325
+ var
326
+ source = module.get.source(),
327
+ html,
328
+ parameters
329
+ ;
330
+ url = module.get.url(url);
331
+ if (url) {
332
+ parameters = module.generate.parameters(source);
333
+ html = templates.iframe(url, parameters);
334
+ } else {
335
+ module.error(error.noURL, $module);
336
+ }
337
+
338
+ return html;
339
+ },
340
+ parameters: function (source, extraParameters) {
341
+ var
342
+ parameters = sources[source] && sources[source].parameters !== undefined
343
+ ? sources[source].parameters(settings)
344
+ : {}
345
+ ;
346
+ extraParameters = extraParameters || settings.parameters;
347
+ if (extraParameters) {
348
+ parameters = $.extend({}, parameters, extraParameters);
349
+ }
350
+ parameters = settings.onEmbed(parameters);
351
+
352
+ return module.encode.parameters(parameters);
353
+ },
354
+ },
355
+
356
+ has: {
357
+ embed: function () {
358
+ return $embed.length > 0;
359
+ },
360
+ placeholder: function () {
361
+ return settings.placeholder || $module.data(metadata.placeholder);
362
+ },
363
+ },
364
+
365
+ should: {
366
+ autoplay: function () {
367
+ return settings.autoplay === 'auto'
368
+ ? settings.placeholder || $module.data(metadata.placeholder) !== undefined
369
+ : settings.autoplay;
370
+ },
371
+ },
372
+
373
+ is: {
374
+ video: function () {
375
+ return module.get.type() === 'video';
376
+ },
377
+ },
378
+
379
+ setting: function (name, value) {
380
+ module.debug('Changing setting', name, value);
381
+ if ($.isPlainObject(name)) {
382
+ $.extend(true, settings, name);
383
+ } else if (value !== undefined) {
384
+ if ($.isPlainObject(settings[name])) {
385
+ $.extend(true, settings[name], value);
386
+ } else {
387
+ settings[name] = value;
388
+ }
389
+ } else {
390
+ return settings[name];
391
+ }
392
+ },
393
+ internal: function (name, value) {
394
+ if ($.isPlainObject(name)) {
395
+ $.extend(true, module, name);
396
+ } else if (value !== undefined) {
397
+ module[name] = value;
398
+ } else {
399
+ return module[name];
400
+ }
401
+ },
402
+ debug: function () {
403
+ if (!settings.silent && settings.debug) {
404
+ if (settings.performance) {
405
+ module.performance.log(arguments);
406
+ } else {
407
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
408
+ module.debug.apply(console, arguments);
409
+ }
410
+ }
411
+ },
412
+ verbose: function () {
413
+ if (!settings.silent && settings.verbose && settings.debug) {
414
+ if (settings.performance) {
415
+ module.performance.log(arguments);
416
+ } else {
417
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
418
+ module.verbose.apply(console, arguments);
419
+ }
420
+ }
421
+ },
422
+ error: function () {
423
+ if (!settings.silent) {
424
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
425
+ module.error.apply(console, arguments);
426
+ }
427
+ },
428
+ performance: {
429
+ log: function (message) {
430
+ var
431
+ currentTime,
432
+ executionTime,
433
+ previousTime
434
+ ;
435
+ if (settings.performance) {
436
+ currentTime = Date.now();
437
+ previousTime = time || currentTime;
438
+ executionTime = currentTime - previousTime;
439
+ time = currentTime;
440
+ performance.push({
441
+ Name: message[0],
442
+ Arguments: [].slice.call(message, 1) || '',
443
+ Element: element,
444
+ 'Execution Time': executionTime,
445
+ });
446
+ }
447
+ clearTimeout(module.performance.timer);
448
+ module.performance.timer = setTimeout(function () {
449
+ module.performance.display();
450
+ }, 500);
451
+ },
452
+ display: function () {
453
+ var
454
+ title = settings.name + ':',
455
+ totalTime = 0
456
+ ;
457
+ time = false;
458
+ clearTimeout(module.performance.timer);
459
+ $.each(performance, function (index, data) {
460
+ totalTime += data['Execution Time'];
461
+ });
462
+ title += ' ' + totalTime + 'ms';
463
+ if ($allModules.length > 1) {
464
+ title += ' (' + $allModules.length + ')';
465
+ }
466
+ if (performance.length > 0) {
467
+ console.groupCollapsed(title);
468
+ if (console.table) {
469
+ console.table(performance);
470
+ } else {
471
+ $.each(performance, function (index, data) {
472
+ console.log(data.Name + ': ' + data['Execution Time'] + 'ms');
473
+ });
474
+ }
475
+ console.groupEnd();
476
+ }
477
+ performance = [];
478
+ },
479
+ },
480
+ invoke: function (query, passedArguments, context) {
481
+ var
482
+ object = instance,
483
+ maxDepth,
484
+ found,
485
+ response
486
+ ;
487
+ passedArguments = passedArguments || queryArguments;
488
+ context = context || element;
489
+ if (typeof query === 'string' && object !== undefined) {
490
+ query = query.split(/[ .]/);
491
+ maxDepth = query.length - 1;
492
+ $.each(query, function (depth, value) {
493
+ var camelCaseValue = depth !== maxDepth
494
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
495
+ : query
496
+ ;
497
+ if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
498
+ object = object[camelCaseValue];
499
+ } else if (object[camelCaseValue] !== undefined) {
500
+ found = object[camelCaseValue];
501
+
502
+ return false;
503
+ } else if ($.isPlainObject(object[value]) && (depth !== maxDepth)) {
504
+ object = object[value];
505
+ } else if (object[value] !== undefined) {
506
+ found = object[value];
507
+
508
+ return false;
509
+ } else {
510
+ module.error(error.method, query);
511
+
512
+ return false;
513
+ }
514
+ });
515
+ }
516
+ if (isFunction(found)) {
517
+ response = found.apply(context, passedArguments);
518
+ } else if (found !== undefined) {
519
+ response = found;
520
+ }
521
+ if (Array.isArray(returnedValue)) {
522
+ returnedValue.push(response);
523
+ } else if (returnedValue !== undefined) {
524
+ returnedValue = [returnedValue, response];
525
+ } else if (response !== undefined) {
526
+ returnedValue = response;
527
+ }
528
+
529
+ return found;
530
+ },
531
+ };
532
+
533
+ if (methodInvoked) {
534
+ if (instance === undefined) {
535
+ module.initialize();
536
+ }
537
+ module.invoke(query);
538
+ } else {
539
+ if (instance !== undefined) {
540
+ instance.invoke('destroy');
541
+ }
542
+ module.initialize();
543
+ }
544
+ });
545
+
546
+ return returnedValue !== undefined
547
+ ? returnedValue
548
+ : this;
549
+ };
550
+
551
+ $.fn.embed.settings = {
552
+
553
+ name: 'Embed',
554
+ namespace: 'embed',
555
+
556
+ silent: false,
557
+ debug: false,
558
+ verbose: false,
559
+ performance: true,
560
+
561
+ icon: false,
562
+ source: false,
563
+ url: false,
564
+ id: false,
565
+ placeholder: false,
566
+ alt: false,
567
+
568
+ // standard video settings
569
+ autoplay: 'auto',
570
+ color: '#444',
571
+ hd: true,
572
+ brandedUI: false,
573
+
574
+ // additional parameters to include with the embed
575
+ parameters: false,
576
+
577
+ onDisplay: function () {},
578
+ onPlaceholderDisplay: function () {},
579
+ onReset: function () {},
580
+ onCreate: function (url) {},
581
+ onEmbed: function (parameters) {
582
+ return parameters;
583
+ },
584
+
585
+ metadata: {
586
+ id: 'id',
587
+ icon: 'icon',
588
+ placeholder: 'placeholder',
589
+ alt: 'alt',
590
+ source: 'source',
591
+ url: 'url',
592
+ },
593
+
594
+ error: {
595
+ noURL: 'No URL specified',
596
+ method: 'The method you called is not defined',
597
+ },
598
+
599
+ className: {
600
+ active: 'active',
601
+ embed: 'embed',
602
+ },
603
+
604
+ selector: {
605
+ embed: '.embed',
606
+ placeholder: '.placeholder',
607
+ icon: '.icon',
608
+ },
609
+
610
+ sources: {
611
+ youtube: {
612
+ name: 'youtube',
613
+ type: 'video',
614
+ icon: 'video play',
615
+ domain: 'youtube.com',
616
+ url: '//www.youtube.com/embed/{id}',
617
+ parameters: function (settings) {
618
+ return {
619
+ autohide: !settings.brandedUI,
620
+ autoplay: settings.autoplay,
621
+ color: settings.color || undefined,
622
+ hq: settings.hd,
623
+ jsapi: settings.api,
624
+ modestbranding: !settings.brandedUI,
625
+ };
626
+ },
627
+ },
628
+ vimeo: {
629
+ name: 'vimeo',
630
+ type: 'video',
631
+ icon: 'video play',
632
+ domain: 'vimeo.com',
633
+ url: '//player.vimeo.com/video/{id}',
634
+ parameters: function (settings) {
635
+ return {
636
+ api: settings.api,
637
+ autoplay: settings.autoplay,
638
+ byline: settings.brandedUI,
639
+ color: settings.color || undefined,
640
+ portrait: settings.brandedUI,
641
+ title: settings.brandedUI,
642
+ };
643
+ },
644
+ },
645
+ },
646
+
647
+ templates: {
648
+ deQuote: function (string, encode) {
649
+ return String(string).replace(/"/g, encode ? '&quot;' : '');
650
+ },
651
+ iframe: function (url, parameters) {
652
+ var
653
+ src = url,
654
+ deQuote = $.fn.embed.settings.templates.deQuote
655
+ ;
656
+ if (parameters) {
657
+ src += '?' + parameters;
658
+ }
659
+
660
+ return ''
661
+ + '<iframe src="' + deQuote(src) + '"'
662
+ + ' width="100%" height="100%"'
663
+ + ' msallowFullScreen allowFullScreen></iframe>';
664
+ },
665
+ placeholder: function (image, icon, alt) {
666
+ var
667
+ html = '',
668
+ deQuote = $.fn.embed.settings.templates.deQuote
669
+ ;
670
+ if (icon) {
671
+ html += '<i class="' + deQuote(icon) + ' icon"></i>';
672
+ }
673
+ if (image) {
674
+ html += '<img class="placeholder" src="' + deQuote(image) + (alt ? '" alt="' + deQuote(alt) : '') + '">';
675
+ }
676
+
677
+ return html;
678
+ },
679
+ },
680
+
681
+ // NOT YET IMPLEMENTED
682
+ api: false,
683
+ onPause: function () {},
684
+ onPlay: function () {},
685
+ onStop: function () {},
686
+
687
+ };
688
+ })(jQuery, window, document);
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * # Fomantic-UI 2.9.4 - Embed
3
+ * https://github.com/fomantic/Fomantic-UI/
4
+ *
5
+ *
6
+ * Released under the MIT license
7
+ * https://opensource.org/licenses/MIT
8
+ *
9
+ */.ui.embed{position:relative;max-width:100%;height:0;overflow:hidden;background:#dcddde;padding-bottom:56.25%}.ui.embed embed,.ui.embed iframe,.ui.embed object{position:absolute;border:none;width:100%;height:100%;top:0;left:0;margin:0;padding:0;overflow:hidden}.ui.embed>.embed{display:none}.ui.embed>.placeholder{position:absolute;cursor:pointer;top:0;left:0;display:block;width:100%;height:100%;background:radial-gradient(transparent 45%,rgba(0,0,0,.3))}.ui.embed>i.icon{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2}.ui.embed>i.icon::after{position:absolute;top:0;left:0;width:100%;height:100%;z-index:3;content:"";background:radial-gradient(transparent 45%,rgba(0,0,0,.3));opacity:.5;transition:opacity .5s ease}.ui.embed>i.icon::before{position:absolute;top:50%;left:50%;transform:translateX(-50%) translateY(-50%);color:#fff;font-size:6rem;text-shadow:0 2px 10px rgba(34,36,38,.2);transition:opacity .5s ease,color .5s ease;z-index:10}.ui.embed i.icon:hover::after{background:radial-gradient(transparent 45%,rgba(0,0,0,.3));opacity:1}.ui.embed i.icon:hover::before{color:#fff}.ui.active.embed>.placeholder,.ui.active.embed>i.icon{display:none}.ui.active.embed>.embed{display:block}.ui.square.embed{padding-bottom:100%}.ui[class*="4:3"].embed{padding-bottom:75%}.ui[class*="16:9"].embed{padding-bottom:56.25%}.ui[class*="21:9"].embed{padding-bottom:42.85714286%}