fomantic-ui 2.10.0-beta.7 → 2.10.0-beta.70

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 (362) hide show
  1. package/.eslintrc.js +6 -33
  2. package/.github/workflows/ci.yml +9 -9
  3. package/.github/workflows/depsreview.yml +1 -1
  4. package/.github/workflows/nightly.yml +7 -5
  5. package/.github/workflows/release.yml +2 -2
  6. package/.stylelintrc.js +1 -15
  7. package/CHANGELOG.md +5289 -2325
  8. package/README.md +11 -8
  9. package/changelog-setup.js +88 -72
  10. package/changelog-template.hbs +256 -251
  11. package/dist/components/accordion.css +1 -1
  12. package/dist/components/accordion.js +116 -164
  13. package/dist/components/accordion.min.css +1 -1
  14. package/dist/components/accordion.min.js +2 -2
  15. package/dist/components/ad.css +1 -1
  16. package/dist/components/ad.min.css +1 -1
  17. package/dist/components/api.js +190 -303
  18. package/dist/components/api.min.js +2 -2
  19. package/dist/components/breadcrumb.css +1 -1
  20. package/dist/components/breadcrumb.min.css +1 -1
  21. package/dist/components/button.css +5 -6
  22. package/dist/components/button.min.css +2 -2
  23. package/dist/components/calendar.css +3 -3
  24. package/dist/components/calendar.js +397 -482
  25. package/dist/components/calendar.min.css +2 -2
  26. package/dist/components/calendar.min.js +2 -2
  27. package/dist/components/card.css +1 -1
  28. package/dist/components/card.min.css +1 -1
  29. package/dist/components/checkbox.css +1 -1
  30. package/dist/components/checkbox.js +105 -166
  31. package/dist/components/checkbox.min.css +1 -1
  32. package/dist/components/checkbox.min.js +2 -2
  33. package/dist/components/comment.css +1 -1
  34. package/dist/components/comment.min.css +1 -1
  35. package/dist/components/container.css +1 -1
  36. package/dist/components/container.min.css +1 -1
  37. package/dist/components/dimmer.css +2 -2
  38. package/dist/components/dimmer.js +75 -121
  39. package/dist/components/dimmer.min.css +2 -2
  40. package/dist/components/dimmer.min.js +2 -2
  41. package/dist/components/divider.css +1 -1
  42. package/dist/components/divider.min.css +1 -1
  43. package/dist/components/dropdown.css +21 -35
  44. package/dist/components/dropdown.js +775 -1161
  45. package/dist/components/dropdown.min.css +2 -2
  46. package/dist/components/dropdown.min.js +2 -2
  47. package/dist/components/embed.css +1 -1
  48. package/dist/components/embed.js +95 -146
  49. package/dist/components/embed.min.css +1 -1
  50. package/dist/components/embed.min.js +2 -2
  51. package/dist/components/emoji.css +3809 -7617
  52. package/dist/components/emoji.min.css +2 -2
  53. package/dist/components/feed.css +1 -1
  54. package/dist/components/feed.min.css +1 -1
  55. package/dist/components/flag.css +1 -1
  56. package/dist/components/flag.min.css +1 -1
  57. package/dist/components/flyout.css +1 -1
  58. package/dist/components/flyout.js +242 -336
  59. package/dist/components/flyout.min.css +1 -1
  60. package/dist/components/flyout.min.js +2 -2
  61. package/dist/components/form.css +3 -5
  62. package/dist/components/form.js +425 -554
  63. package/dist/components/form.min.css +2 -2
  64. package/dist/components/form.min.js +2 -2
  65. package/dist/components/grid.css +2 -2
  66. package/dist/components/grid.min.css +2 -2
  67. package/dist/components/header.css +6 -6
  68. package/dist/components/header.min.css +2 -2
  69. package/dist/components/icon.css +10 -37
  70. package/dist/components/icon.min.css +2 -2
  71. package/dist/components/image.css +1 -1
  72. package/dist/components/image.min.css +1 -1
  73. package/dist/components/input.css +284 -12
  74. package/dist/components/input.min.css +2 -2
  75. package/dist/components/item.css +1 -1
  76. package/dist/components/item.min.css +1 -1
  77. package/dist/components/label.css +6 -14
  78. package/dist/components/label.min.css +2 -2
  79. package/dist/components/list.css +3 -3
  80. package/dist/components/list.min.css +2 -2
  81. package/dist/components/loader.css +53 -53
  82. package/dist/components/loader.min.css +2 -2
  83. package/dist/components/menu.css +45 -60
  84. package/dist/components/menu.min.css +2 -2
  85. package/dist/components/message.css +2 -2
  86. package/dist/components/message.min.css +2 -2
  87. package/dist/components/modal.css +5 -5
  88. package/dist/components/modal.js +274 -369
  89. package/dist/components/modal.min.css +2 -2
  90. package/dist/components/modal.min.js +2 -2
  91. package/dist/components/nag.css +1 -1
  92. package/dist/components/nag.js +109 -153
  93. package/dist/components/nag.min.css +1 -1
  94. package/dist/components/nag.min.js +2 -2
  95. package/dist/components/placeholder.css +2 -2
  96. package/dist/components/placeholder.min.css +2 -2
  97. package/dist/components/popup.css +19 -73
  98. package/dist/components/popup.js +210 -303
  99. package/dist/components/popup.min.css +2 -2
  100. package/dist/components/popup.min.js +2 -2
  101. package/dist/components/progress.css +4 -13
  102. package/dist/components/progress.js +128 -185
  103. package/dist/components/progress.min.css +2 -2
  104. package/dist/components/progress.min.js +2 -2
  105. package/dist/components/rail.css +1 -1
  106. package/dist/components/rail.min.css +1 -1
  107. package/dist/components/rating.css +1 -1
  108. package/dist/components/rating.js +92 -145
  109. package/dist/components/rating.min.css +1 -1
  110. package/dist/components/rating.min.js +2 -2
  111. package/dist/components/reset.css +48 -208
  112. package/dist/components/reset.min.css +2 -2
  113. package/dist/components/reveal.css +2 -5
  114. package/dist/components/reveal.min.css +2 -2
  115. package/dist/components/search.css +2 -3
  116. package/dist/components/search.js +311 -425
  117. package/dist/components/search.min.css +2 -2
  118. package/dist/components/search.min.js +2 -2
  119. package/dist/components/segment.css +6 -6
  120. package/dist/components/segment.min.css +2 -2
  121. package/dist/components/shape.css +1 -1
  122. package/dist/components/shape.js +173 -249
  123. package/dist/components/shape.min.css +1 -1
  124. package/dist/components/shape.min.js +2 -2
  125. package/dist/components/sidebar.css +1 -1
  126. package/dist/components/sidebar.js +138 -199
  127. package/dist/components/sidebar.min.css +1 -1
  128. package/dist/components/sidebar.min.js +2 -2
  129. package/dist/components/site.css +1 -1
  130. package/dist/components/site.js +59 -99
  131. package/dist/components/site.min.css +1 -1
  132. package/dist/components/site.min.js +2 -2
  133. package/dist/components/slider.css +1 -1
  134. package/dist/components/slider.js +267 -364
  135. package/dist/components/slider.min.css +1 -1
  136. package/dist/components/slider.min.js +2 -2
  137. package/dist/components/state.js +88 -132
  138. package/dist/components/state.min.js +2 -2
  139. package/dist/components/statistic.css +1 -1
  140. package/dist/components/statistic.min.css +1 -1
  141. package/dist/components/step.css +4 -4
  142. package/dist/components/step.min.css +2 -2
  143. package/dist/components/sticky.css +1 -1
  144. package/dist/components/sticky.js +163 -228
  145. package/dist/components/sticky.min.css +1 -1
  146. package/dist/components/sticky.min.js +2 -2
  147. package/dist/components/tab.css +1 -1
  148. package/dist/components/tab.js +192 -287
  149. package/dist/components/tab.min.css +1 -1
  150. package/dist/components/tab.min.js +2 -2
  151. package/dist/components/table.css +8 -8
  152. package/dist/components/table.min.css +2 -2
  153. package/dist/components/text.css +1 -1
  154. package/dist/components/text.min.css +1 -1
  155. package/dist/components/toast.css +1 -1
  156. package/dist/components/toast.js +118 -155
  157. package/dist/components/toast.min.css +1 -1
  158. package/dist/components/toast.min.js +2 -2
  159. package/dist/components/transition.css +1 -1
  160. package/dist/components/transition.js +114 -193
  161. package/dist/components/transition.min.css +1 -1
  162. package/dist/components/transition.min.js +2 -2
  163. package/dist/components/visibility.js +175 -271
  164. package/dist/components/visibility.min.js +2 -2
  165. package/dist/semantic.css +4479 -8221
  166. package/dist/semantic.js +5023 -7182
  167. package/dist/semantic.min.css +2 -2
  168. package/dist/semantic.min.js +2 -2
  169. package/examples/assets/show-examples.js +2 -4
  170. package/examples/attached.html +1 -1
  171. package/examples/components/menu.html +1 -1
  172. package/gulpfile.js +5 -7
  173. package/package.json +4 -5
  174. package/scripts/nightly-version.js +11 -14
  175. package/src/definitions/behaviors/api.js +189 -302
  176. package/src/definitions/behaviors/form.js +426 -555
  177. package/src/definitions/behaviors/state.js +87 -131
  178. package/src/definitions/behaviors/visibility.js +174 -270
  179. package/src/definitions/collections/breadcrumb.less +0 -1
  180. package/src/definitions/collections/form.less +3 -9
  181. package/src/definitions/collections/grid.less +1 -2
  182. package/src/definitions/collections/menu.less +106 -117
  183. package/src/definitions/collections/message.less +1 -2
  184. package/src/definitions/collections/table.less +7 -8
  185. package/src/definitions/elements/button.less +4 -6
  186. package/src/definitions/elements/container.less +0 -1
  187. package/src/definitions/elements/divider.less +1 -2
  188. package/src/definitions/elements/emoji.less +1 -1
  189. package/src/definitions/elements/flag.less +1 -1
  190. package/src/definitions/elements/header.less +4 -5
  191. package/src/definitions/elements/icon.less +10 -37
  192. package/src/definitions/elements/image.less +0 -1
  193. package/src/definitions/elements/input.less +4 -7
  194. package/src/definitions/elements/label.less +5 -14
  195. package/src/definitions/elements/list.less +2 -3
  196. package/src/definitions/elements/loader.less +10 -11
  197. package/src/definitions/elements/placeholder.less +1 -2
  198. package/src/definitions/elements/rail.less +0 -1
  199. package/src/definitions/elements/reveal.less +1 -5
  200. package/src/definitions/elements/segment.less +5 -6
  201. package/src/definitions/elements/step.less +3 -4
  202. package/src/definitions/elements/text.less +0 -1
  203. package/src/definitions/globals/reset.less +0 -1
  204. package/src/definitions/globals/site.js +58 -98
  205. package/src/definitions/globals/site.less +0 -1
  206. package/src/definitions/modules/accordion.js +115 -163
  207. package/src/definitions/modules/accordion.less +0 -1
  208. package/src/definitions/modules/calendar.js +396 -481
  209. package/src/definitions/modules/calendar.less +2 -3
  210. package/src/definitions/modules/checkbox.js +104 -165
  211. package/src/definitions/modules/checkbox.less +0 -1
  212. package/src/definitions/modules/dimmer.js +74 -120
  213. package/src/definitions/modules/dimmer.less +1 -2
  214. package/src/definitions/modules/dropdown.js +774 -1160
  215. package/src/definitions/modules/dropdown.less +27 -38
  216. package/src/definitions/modules/embed.js +94 -145
  217. package/src/definitions/modules/embed.less +0 -1
  218. package/src/definitions/modules/flyout.js +241 -335
  219. package/src/definitions/modules/flyout.less +0 -1
  220. package/src/definitions/modules/modal.js +273 -368
  221. package/src/definitions/modules/modal.less +3 -4
  222. package/src/definitions/modules/nag.js +108 -152
  223. package/src/definitions/modules/nag.less +0 -1
  224. package/src/definitions/modules/popup.js +209 -302
  225. package/src/definitions/modules/popup.less +18 -73
  226. package/src/definitions/modules/progress.js +127 -184
  227. package/src/definitions/modules/progress.less +3 -13
  228. package/src/definitions/modules/rating.js +93 -146
  229. package/src/definitions/modules/rating.less +0 -1
  230. package/src/definitions/modules/search.js +312 -426
  231. package/src/definitions/modules/search.less +2 -4
  232. package/src/definitions/modules/shape.js +172 -248
  233. package/src/definitions/modules/shape.less +0 -1
  234. package/src/definitions/modules/sidebar.js +137 -198
  235. package/src/definitions/modules/sidebar.less +0 -1
  236. package/src/definitions/modules/slider.js +266 -363
  237. package/src/definitions/modules/slider.less +0 -1
  238. package/src/definitions/modules/sticky.js +162 -227
  239. package/src/definitions/modules/sticky.less +0 -1
  240. package/src/definitions/modules/tab.js +191 -286
  241. package/src/definitions/modules/tab.less +0 -1
  242. package/src/definitions/modules/toast.js +117 -154
  243. package/src/definitions/modules/toast.less +0 -1
  244. package/src/definitions/modules/transition.js +113 -192
  245. package/src/definitions/modules/transition.less +1 -2
  246. package/src/definitions/views/ad.less +0 -1
  247. package/src/definitions/views/card.less +0 -1
  248. package/src/definitions/views/comment.less +0 -1
  249. package/src/definitions/views/feed.less +0 -1
  250. package/src/definitions/views/item.less +0 -1
  251. package/src/definitions/views/statistic.less +0 -1
  252. package/src/semantic.less +1 -1
  253. package/src/themes/amazon/elements/button.overrides +1 -1
  254. package/src/themes/amazon/elements/button.variables +5 -6
  255. package/src/themes/amazon/globals/site.variables +2 -3
  256. package/src/themes/bookish/elements/header.variables +2 -2
  257. package/src/themes/bootstrap3/elements/button.variables +4 -5
  258. package/src/themes/chubby/collections/menu.variables +1 -1
  259. package/src/themes/chubby/elements/button.overrides +4 -4
  260. package/src/themes/chubby/modules/accordion.overrides +1 -1
  261. package/src/themes/chubby/views/comment.overrides +2 -2
  262. package/src/themes/chubby/views/comment.variables +2 -2
  263. package/src/themes/classic/collections/table.variables +2 -2
  264. package/src/themes/classic/elements/button.variables +11 -11
  265. package/src/themes/classic/modules/progress.variables +2 -2
  266. package/src/themes/classic/views/card.variables +2 -2
  267. package/src/themes/default/collections/form.variables +2 -3
  268. package/src/themes/default/collections/menu.variables +28 -28
  269. package/src/themes/default/collections/message.variables +1 -1
  270. package/src/themes/default/collections/table.variables +4 -4
  271. package/src/themes/default/elements/button.variables +9 -10
  272. package/src/themes/default/elements/divider.variables +1 -1
  273. package/src/themes/default/elements/icon.variables +2 -2
  274. package/src/themes/default/elements/image.variables +1 -1
  275. package/src/themes/default/elements/input.variables +2 -2
  276. package/src/themes/default/elements/label.variables +4 -4
  277. package/src/themes/default/elements/list.variables +1 -1
  278. package/src/themes/default/elements/placeholder.variables +6 -6
  279. package/src/themes/default/elements/segment.variables +8 -8
  280. package/src/themes/default/globals/reset.overrides +45 -201
  281. package/src/themes/default/globals/site.variables +50 -50
  282. package/src/themes/default/globals/variation.variables +3 -2
  283. package/src/themes/default/modules/accordion.variables +0 -1
  284. package/src/themes/default/modules/checkbox.variables +1 -1
  285. package/src/themes/default/modules/dimmer.variables +12 -12
  286. package/src/themes/default/modules/dropdown.variables +17 -16
  287. package/src/themes/default/modules/embed.variables +2 -2
  288. package/src/themes/default/modules/flyout.variables +3 -3
  289. package/src/themes/default/modules/modal.variables +14 -14
  290. package/src/themes/default/modules/nag.variables +1 -1
  291. package/src/themes/default/modules/rating.variables +1 -1
  292. package/src/themes/default/modules/search.variables +1 -1
  293. package/src/themes/default/modules/shape.variables +1 -1
  294. package/src/themes/default/modules/sidebar.variables +2 -2
  295. package/src/themes/default/modules/toast.variables +4 -4
  296. package/src/themes/default/views/card.variables +6 -7
  297. package/src/themes/default/views/feed.variables +4 -4
  298. package/src/themes/default/views/item.variables +2 -3
  299. package/src/themes/flat/collections/form.variables +1 -1
  300. package/src/themes/flat/globals/site.variables +9 -9
  301. package/src/themes/github/collections/form.overrides +3 -3
  302. package/src/themes/github/collections/form.variables +3 -3
  303. package/src/themes/github/collections/menu.overrides +1 -1
  304. package/src/themes/github/collections/menu.variables +10 -10
  305. package/src/themes/github/collections/message.variables +6 -6
  306. package/src/themes/github/elements/button.variables +17 -17
  307. package/src/themes/github/elements/input.variables +3 -3
  308. package/src/themes/github/elements/segment.variables +2 -2
  309. package/src/themes/github/elements/step.overrides +4 -4
  310. package/src/themes/github/elements/step.variables +3 -3
  311. package/src/themes/github/globals/site.variables +2 -2
  312. package/src/themes/github/modules/dropdown.variables +1 -3
  313. package/src/themes/gmail/collections/message.variables +2 -2
  314. package/src/themes/material/collections/menu.variables +1 -1
  315. package/src/themes/material/elements/button.overrides +4 -4
  316. package/src/themes/material/elements/button.variables +5 -5
  317. package/src/themes/material/modules/dropdown.variables +1 -1
  318. package/src/themes/material/modules/modal.variables +1 -1
  319. package/src/themes/raised/elements/button.variables +1 -1
  320. package/src/themes/round/elements/button.variables +12 -12
  321. package/src/themes/striped/modules/progress.overrides +3 -3
  322. package/src/themes/timeline/views/feed.variables +2 -2
  323. package/src/themes/twitter/elements/button.overrides +1 -1
  324. package/src/themes/twitter/elements/button.variables +4 -5
  325. package/tasks/admin/components/create.js +87 -110
  326. package/tasks/admin/components/init.js +26 -33
  327. package/tasks/admin/components/update.js +46 -54
  328. package/tasks/admin/distributions/create.js +74 -125
  329. package/tasks/admin/distributions/init.js +27 -34
  330. package/tasks/admin/distributions/update.js +45 -53
  331. package/tasks/admin/register.js +11 -15
  332. package/tasks/build/assets.js +14 -18
  333. package/tasks/build/css.js +59 -68
  334. package/tasks/build/javascript.js +46 -54
  335. package/tasks/build.js +4 -6
  336. package/tasks/check-install.js +5 -7
  337. package/tasks/clean.js +2 -4
  338. package/tasks/collections/admin.js +13 -15
  339. package/tasks/collections/build.js +6 -8
  340. package/tasks/collections/docs.js +2 -4
  341. package/tasks/collections/install.js +2 -4
  342. package/tasks/collections/rtl.js +2 -4
  343. package/tasks/collections/various.js +2 -4
  344. package/tasks/config/admin/github.js +8 -10
  345. package/tasks/config/admin/templates/css-package.js +1 -3
  346. package/tasks/config/admin/templates/less-package.js +1 -3
  347. package/tasks/config/npm/gulpfile.js +4 -6
  348. package/tasks/config/project/config.js +26 -34
  349. package/tasks/config/project/install.js +58 -72
  350. package/tasks/config/project/release.js +7 -15
  351. package/tasks/config/tasks.js +23 -24
  352. package/tasks/config/user.js +9 -16
  353. package/tasks/docs/build.js +26 -31
  354. package/tasks/docs/metadata.js +35 -43
  355. package/tasks/docs/serve.js +20 -26
  356. package/tasks/install.js +77 -102
  357. package/tasks/rtl/build.js +2 -4
  358. package/tasks/rtl/watch.js +2 -4
  359. package/tasks/watch.js +9 -11
  360. package/test/meteor/assets.js +4 -4
  361. package/test/meteor/fonts.js +11 -13
  362. package/test/modules/module.spec.js +25 -27
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.7+13b1bae - Embed
2
+ * # Fomantic-UI 2.10.0-beta.70+88a499a - Embed
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -19,48 +19,43 @@
19
19
  ? window
20
20
  : globalThis;
21
21
 
22
- $.fn.embed = function (parameters) {
23
- var
24
- $allModules = $(this),
22
+ $.fn.embed = function (...args) {
23
+ const $allModules = $(this);
25
24
 
26
- time = Date.now(),
27
- performance = [],
25
+ let time = Date.now();
26
+ let performance = [];
28
27
 
29
- query = arguments[0],
30
- methodInvoked = typeof query === 'string',
31
- queryArguments = [].slice.call(arguments, 1),
28
+ const parameters = args[0];
29
+ const methodInvoked = typeof parameters === 'string';
30
+ const queryArguments = args.slice(1);
32
31
 
33
- returnedValue
34
- ;
32
+ let returnedValue;
35
33
 
36
34
  $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 = {
35
+ const settings = $.isPlainObject(parameters)
36
+ ? $.extend(true, {}, $.fn.embed.settings, parameters)
37
+ : $.extend({}, $.fn.embed.settings);
38
+
39
+ const selector = settings.selector;
40
+ const className = settings.className;
41
+ const sources = settings.sources;
42
+ const error = settings.error;
43
+ const metadata = settings.metadata;
44
+ const namespace = settings.namespace;
45
+ const templates = settings.templates;
46
+
47
+ const eventNamespace = '.' + namespace;
48
+ const moduleNamespace = 'module-' + namespace;
49
+
50
+ const $module = $(this);
51
+ let $placeholder = $module.find(selector.placeholder);
52
+ let $icon = $module.find(selector.icon);
53
+ let $embed = $module.find(selector.embed);
54
+
55
+ const element = this;
56
+ let instance = $module.data(moduleNamespace);
57
+
58
+ const module = {
64
59
 
65
60
  initialize: function () {
66
61
  module.debug('Initializing embed');
@@ -74,8 +69,7 @@
74
69
  module.verbose('Storing instance of module', module);
75
70
  instance = module;
76
71
  $module
77
- .data(moduleNamespace, module)
78
- ;
72
+ .data(moduleNamespace, module);
79
73
  },
80
74
 
81
75
  destroy: function () {
@@ -83,8 +77,7 @@
83
77
  module.reset();
84
78
  $module
85
79
  .removeData(moduleNamespace)
86
- .off(eventNamespace)
87
- ;
80
+ .off(eventNamespace);
88
81
  },
89
82
 
90
83
  refresh: function () {
@@ -100,16 +93,13 @@
100
93
  module.debug('Adding placeholder events');
101
94
  $module
102
95
  .on('click' + eventNamespace, selector.placeholder, module.createAndShow)
103
- .on('click' + eventNamespace, selector.icon, module.createAndShow)
104
- ;
96
+ .on('click' + eventNamespace, selector.icon, module.createAndShow);
105
97
  }
106
98
  },
107
99
  },
108
100
 
109
101
  create: function () {
110
- var
111
- placeholder = module.get.placeholder()
112
- ;
102
+ const placeholder = module.get.placeholder();
113
103
  if (placeholder) {
114
104
  module.createPlaceholder();
115
105
  } else {
@@ -117,32 +107,26 @@
117
107
  }
118
108
  },
119
109
 
120
- createPlaceholder: function (placeholder) {
121
- var
122
- icon = module.get.icon(),
123
- alt = module.get.alt()
124
- ;
125
- placeholder = placeholder || module.get.placeholder();
110
+ createPlaceholder: function (placeholder = module.get.placeholder()) {
111
+ const icon = module.get.icon();
112
+ const alt = module.get.alt();
126
113
  $module.html(templates.placeholder(placeholder, icon, alt));
127
114
  module.debug('Creating placeholder for embed', placeholder, icon, alt);
128
115
  },
129
116
 
130
- createEmbed: function (url) {
117
+ createEmbed: function (url = module.get.url()) {
131
118
  module.refresh();
132
- url = url || module.get.url();
133
119
  $embed = $('<div/>')
134
120
  .addClass(className.embed)
135
121
  .html(module.generate.embed(url))
136
- .appendTo($module)
137
- ;
122
+ .appendTo($module);
138
123
  settings.onCreate.call(element, url);
139
124
  module.debug('Creating embed object', $embed);
140
125
  },
141
126
 
142
127
  changeEmbed: function (url) {
143
128
  $embed
144
- .html(module.generate.embed(url))
145
- ;
129
+ .html(module.generate.embed(url));
146
130
  },
147
131
 
148
132
  createAndShow: function () {
@@ -155,8 +139,7 @@
155
139
  module.debug('Changing video to ', source, id, url);
156
140
  $module
157
141
  .data(metadata.source, source)
158
- .data(metadata.id, id)
159
- ;
142
+ .data(metadata.id, id);
160
143
  if (url) {
161
144
  $module.data(metadata.url, url);
162
145
  } else {
@@ -218,14 +201,14 @@
218
201
  : module.determine.source());
219
202
  },
220
203
  type: function () {
221
- var source = module.get.source();
204
+ const source = module.get.source();
222
205
 
223
206
  return sources[source] !== undefined
224
207
  ? sources[source].type
225
208
  : false;
226
209
  },
227
- url: function () {
228
- return settings.url || ($module.data(metadata.url) !== undefined
210
+ url: function (url) {
211
+ return url || settings.url || ($module.data(metadata.url) !== undefined
229
212
  ? $module.data(metadata.url)
230
213
  : module.determine.url());
231
214
  },
@@ -237,11 +220,8 @@
237
220
  settings.autoplay = true;
238
221
  }
239
222
  },
240
- source: function (url) {
241
- var
242
- matchedSource = false
243
- ;
244
- url = url || module.get.url();
223
+ source: function (url = module.get.url()) {
224
+ let matchedSource = false;
245
225
  if (url) {
246
226
  $.each(sources, function (name, source) {
247
227
  if (url.search(source.domain) !== -1) {
@@ -255,21 +235,16 @@
255
235
  return matchedSource;
256
236
  },
257
237
  icon: function () {
258
- var
259
- source = module.get.source()
260
- ;
238
+ const source = module.get.source();
261
239
 
262
240
  return sources[source] !== undefined
263
241
  ? sources[source].icon
264
242
  : false;
265
243
  },
266
244
  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
245
+ const id = settings.id || $module.data(metadata.id);
246
+ const source = settings.source || $module.data(metadata.source);
247
+ const url = sources[source] !== undefined
273
248
  ? sources[source].url.replace('{id}', id)
274
249
  : false;
275
250
  if (url) {
@@ -294,8 +269,7 @@
294
269
  .removeData(metadata.placeholder)
295
270
  .removeData(metadata.alt)
296
271
  .removeData(metadata.source)
297
- .removeData(metadata.url)
298
- ;
272
+ .removeData(metadata.url);
299
273
  },
300
274
  active: function () {
301
275
  $module.removeClass(className.active);
@@ -307,12 +281,12 @@
307
281
 
308
282
  encode: {
309
283
  parameters: function (parameters) {
310
- var
311
- urlString = [],
312
- index
313
- ;
284
+ const urlString = [];
285
+ let index;
314
286
  for (index in parameters) {
315
- urlString.push(encodeURIComponent(index) + '=' + encodeURIComponent(parameters[index]));
287
+ if (Object.prototype.hasOwnProperty.call(parameters, index)) {
288
+ urlString.push(encodeURIComponent(index) + '=' + encodeURIComponent(parameters[index]));
289
+ }
316
290
  }
317
291
 
318
292
  return urlString.join('&amp;');
@@ -322,11 +296,9 @@
322
296
  generate: {
323
297
  embed: function (url) {
324
298
  module.debug('Generating embed html');
325
- var
326
- source = module.get.source(),
327
- html,
328
- parameters
329
- ;
299
+ const source = module.get.source();
300
+ let html;
301
+ let parameters;
330
302
  url = module.get.url(url);
331
303
  if (url) {
332
304
  parameters = module.generate.parameters(source);
@@ -337,13 +309,10 @@
337
309
 
338
310
  return html;
339
311
  },
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;
312
+ parameters: function (source, extraParameters = settings.parameters) {
313
+ let parameters = sources[source] && sources[source].parameters !== undefined
314
+ ? sources[source].parameters(settings)
315
+ : {};
347
316
  if (extraParameters) {
348
317
  parameters = $.extend({}, parameters, extraParameters);
349
318
  }
@@ -399,39 +368,37 @@
399
368
  return module[name];
400
369
  }
401
370
  },
402
- debug: function () {
371
+ debug: function (...args) {
403
372
  if (!settings.silent && settings.debug) {
404
373
  if (settings.performance) {
405
- module.performance.log(arguments);
374
+ module.performance.log(args);
406
375
  } else {
407
376
  module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
408
- module.debug.apply(console, arguments);
377
+ module.debug.apply(console, args);
409
378
  }
410
379
  }
411
380
  },
412
- verbose: function () {
381
+ verbose: function (...args) {
413
382
  if (!settings.silent && settings.verbose && settings.debug) {
414
383
  if (settings.performance) {
415
- module.performance.log(arguments);
384
+ module.performance.log(args);
416
385
  } else {
417
386
  module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
418
- module.verbose.apply(console, arguments);
387
+ module.verbose.apply(console, args);
419
388
  }
420
389
  }
421
390
  },
422
- error: function () {
391
+ error: function (...args) {
423
392
  if (!settings.silent) {
424
393
  module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
425
- module.error.apply(console, arguments);
394
+ module.error.apply(console, args);
426
395
  }
427
396
  },
428
397
  performance: {
429
398
  log: function (message) {
430
- var
431
- currentTime,
432
- executionTime,
433
- previousTime
434
- ;
399
+ let currentTime;
400
+ let executionTime;
401
+ let previousTime;
435
402
  if (settings.performance) {
436
403
  currentTime = Date.now();
437
404
  previousTime = time || currentTime;
@@ -439,7 +406,7 @@
439
406
  time = currentTime;
440
407
  performance.push({
441
408
  Name: message[0],
442
- Arguments: [].slice.call(message, 1) || '',
409
+ Arguments: message.slice(1),
443
410
  Element: element,
444
411
  'Execution Time': executionTime,
445
412
  });
@@ -450,10 +417,8 @@
450
417
  }, 500);
451
418
  },
452
419
  display: function () {
453
- var
454
- title = settings.name + ':',
455
- totalTime = 0
456
- ;
420
+ let title = settings.name + ':';
421
+ let totalTime = 0;
457
422
  time = false;
458
423
  clearTimeout(module.performance.timer);
459
424
  $.each(performance, function (index, data) {
@@ -465,35 +430,24 @@
465
430
  }
466
431
  if (performance.length > 0) {
467
432
  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
- }
433
+ console.table(performance);
475
434
  console.groupEnd();
476
435
  }
477
436
  performance = [];
478
437
  },
479
438
  },
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;
439
+ invoke: function (query, passedArguments = queryArguments, context = element) {
440
+ let object = instance;
441
+ let maxDepth;
442
+ let found;
443
+ let response;
489
444
  if (typeof query === 'string' && object !== undefined) {
490
445
  query = query.split(/[ .]/);
491
446
  maxDepth = query.length - 1;
492
447
  $.each(query, function (depth, value) {
493
- var camelCaseValue = depth !== maxDepth
448
+ const camelCaseValue = depth !== maxDepth
494
449
  ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
495
- : query
496
- ;
450
+ : query;
497
451
  if ($.isPlainObject(object[camelCaseValue]) && (depth !== maxDepth)) {
498
452
  object = object[camelCaseValue];
499
453
  } else if (object[camelCaseValue] !== undefined) {
@@ -534,7 +488,7 @@
534
488
  if (instance === undefined) {
535
489
  module.initialize();
536
490
  }
537
- module.invoke(query);
491
+ module.invoke(parameters);
538
492
  } else {
539
493
  if (instance !== undefined) {
540
494
  instance.invoke('destroy');
@@ -646,8 +600,7 @@
646
600
 
647
601
  templates: {
648
602
  escape: function (string) {
649
- const badChars = /["'<>]|&(?![\d#A-Za-z]{1,12};)/g;
650
- const escape = {
603
+ const escapeMap = {
651
604
  '"': '&quot;',
652
605
  '&': '&amp;',
653
606
  "'": '&apos;',
@@ -655,13 +608,11 @@
655
608
  '>': '&gt;',
656
609
  };
657
610
 
658
- return string.replace(badChars, (chr) => escape[chr]);
611
+ return String(string).replace(/["&'<>]/g, (chr) => escapeMap[chr]);
659
612
  },
660
613
  iframe: function (url, parameters) {
661
- var
662
- src = url,
663
- escape = $.fn.embed.settings.templates.escape
664
- ;
614
+ let src = url;
615
+ const escape = $.fn.embed.settings.templates.escape;
665
616
  if (parameters) {
666
617
  src += '?' + parameters;
667
618
  }
@@ -672,10 +623,8 @@
672
623
  + ' msallowFullScreen allowFullScreen></iframe>';
673
624
  },
674
625
  placeholder: function (image, icon, alt) {
675
- var
676
- html = '',
677
- escape = $.fn.embed.settings.templates.escape
678
- ;
626
+ let html = '';
627
+ const escape = $.fn.embed.settings.templates.escape;
679
628
  if (icon) {
680
629
  html += '<i class="' + escape(icon) + ' icon"></i>';
681
630
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * # Fomantic-UI 2.10.0-beta.7+13b1bae - Embed
2
+ * # Fomantic-UI 2.10.0-beta.70+88a499a - Embed
3
3
  * https://github.com/fomantic/Fomantic-UI/
4
4
  *
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * # Fomantic UI - 2.10.0-beta.7+13b1bae
2
+ * # Fomantic UI - 2.10.0-beta.70+88a499a
3
3
  * https://github.com/fomantic/Fomantic-UI
4
4
  * https://fomantic-ui.com/
5
5
  *
@@ -8,4 +8,4 @@
8
8
  * https://opensource.org/licenses/MIT
9
9
  *
10
10
  */
11
- !function(C,e){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,C.fn.embed=function(h){var b,v=C(this),g=Date.now(),y=[],w=h,D="string"==typeof w,P=[].slice.call(arguments,1);return v.each(function(){var t=C.isPlainObject(h)?C.extend(!0,{},C.fn.embed.settings,h):C.extend({},C.fn.embed.settings),e=t.selector,o=t.className,a=t.sources,l=t.error,r=t.metadata,n=t.namespace,i=t.templates,c="."+n,d="module-"+n,u=C(this),s=(u.find(e.placeholder),u.find(e.icon),u.find(e.embed)),m=this,p=u.data(d),f={initialize:function(){f.debug("Initializing embed"),f.determine.autoplay(),f.create(),f.bind.events(),f.instantiate()},instantiate:function(){f.verbose("Storing instance of module",f),p=f,u.data(d,f)},destroy:function(){f.verbose("Destroying previous instance of embed"),f.reset(),u.removeData(d).off(c)},refresh:function(){f.verbose("Refreshing selector cache"),u.find(e.placeholder),u.find(e.icon),s=u.find(e.embed)},bind:{events:function(){f.has.placeholder()&&(f.debug("Adding placeholder events"),u.on("click"+c,e.placeholder,f.createAndShow).on("click"+c,e.icon,f.createAndShow))}},create:function(){f.get.placeholder()?f.createPlaceholder():f.createAndShow()},createPlaceholder:function(e){var o=f.get.icon(),n=f.get.alt();e=e||f.get.placeholder(),u.html(i.placeholder(e,o,n)),f.debug("Creating placeholder for embed",e,o,n)},createEmbed:function(e){f.refresh(),e=e||f.get.url(),s=C("<div/>").addClass(o.embed).html(f.generate.embed(e)).appendTo(u),t.onCreate.call(m,e),f.debug("Creating embed object",s)},changeEmbed:function(e){s.html(f.generate.embed(e))},createAndShow:function(){f.createEmbed(),f.show()},change:function(e,o,n){f.debug("Changing video to ",e,o,n),u.data(r.source,e).data(r.id,o),n?u.data(r.url,n):u.removeData(r.url),f.has.embed()?f.changeEmbed():f.create()},reset:function(){f.debug("Clearing embed and showing placeholder"),f.remove.data(),f.remove.active(),f.remove.embed(),f.showPlaceholder(),t.onReset.call(m)},show:function(){f.debug("Showing embed"),f.set.active(),t.onDisplay.call(m)},hide:function(){f.debug("Hiding embed"),f.showPlaceholder()},showPlaceholder:function(){f.debug("Showing placeholder image"),f.remove.active(),t.onPlaceholderDisplay.call(m)},get:{id:function(){return t.id||u.data(r.id)},placeholder:function(){return t.placeholder||u.data(r.placeholder)},alt:function(){return t.alt||u.data(r.alt)},icon:function(){return t.icon||(void 0!==u.data(r.icon)?u.data(r.icon):f.determine.icon())},source:function(e){return t.source||(void 0!==u.data(r.source)?u.data(r.source):f.determine.source())},type:function(){var e=f.get.source();return void 0!==a[e]&&a[e].type},url:function(){return t.url||(void 0!==u.data(r.url)?u.data(r.url):f.determine.url())}},determine:{autoplay:function(){f.should.autoplay()&&(t.autoplay=!0)},source:function(n){var t=!1;return(n=n||f.get.url())&&C.each(a,function(e,o){if(-1!==n.search(o.domain))return t=e,!1}),t},icon:function(){var e=f.get.source();return void 0!==a[e]&&a[e].icon},url:function(){var e=t.id||u.data(r.id),o=t.source||u.data(r.source),o=void 0!==a[o]&&a[o].url.replace("{id}",e);return o&&u.data(r.url,o),o}},set:{active:function(){u.addClass(o.active)}},remove:{data:function(){u.removeData(r.id).removeData(r.icon).removeData(r.placeholder).removeData(r.alt).removeData(r.source).removeData(r.url)},active:function(){u.removeClass(o.active)},embed:function(){s.empty()}},encode:{parameters:function(e){var o,n=[];for(o in e)n.push(encodeURIComponent(o)+"="+encodeURIComponent(e[o]));return n.join("&amp;")}},generate:{embed:function(e){f.debug("Generating embed html");var o,n=f.get.source();return(e=f.get.url(e))?(n=f.generate.parameters(n),o=i.iframe(e,n)):f.error(l.noURL,u),o},parameters:function(e,o){e=a[e]&&void 0!==a[e].parameters?a[e].parameters(t):{};return(o=o||t.parameters)&&(e=C.extend({},e,o)),e=t.onEmbed(e),f.encode.parameters(e)}},has:{embed:function(){return 0<s.length},placeholder:function(){return t.placeholder||u.data(r.placeholder)}},should:{autoplay:function(){return"auto"===t.autoplay?t.placeholder||void 0!==u.data(r.placeholder):t.autoplay}},is:{video:function(){return"video"===f.get.type()}},setting:function(e,o){if(f.debug("Changing setting",e,o),C.isPlainObject(e))C.extend(!0,t,e);else{if(void 0===o)return t[e];C.isPlainObject(t[e])?C.extend(!0,t[e],o):t[e]=o}},internal:function(e,o){if(C.isPlainObject(e))C.extend(!0,f,e);else{if(void 0===o)return f[e];f[e]=o}},debug:function(){!t.silent&&t.debug&&(t.performance?f.performance.log(arguments):(f.debug=Function.prototype.bind.call(console.info,console,t.name+":"),f.debug.apply(console,arguments)))},verbose:function(){!t.silent&&t.verbose&&t.debug&&(t.performance?f.performance.log(arguments):(f.verbose=Function.prototype.bind.call(console.info,console,t.name+":"),f.verbose.apply(console,arguments)))},error:function(){t.silent||(f.error=Function.prototype.bind.call(console.error,console,t.name+":"),f.error.apply(console,arguments))},performance:{log:function(e){var o,n;t.performance&&(n=(o=Date.now())-(g||o),g=o,y.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:m,"Execution Time":n})),clearTimeout(f.performance.timer),f.performance.timer=setTimeout(function(){f.performance.display()},500)},display:function(){var e=t.name+":",n=0;g=!1,clearTimeout(f.performance.timer),C.each(y,function(e,o){n+=o["Execution Time"]}),e+=" "+n+"ms",1<v.length&&(e+=" ("+v.length+")"),0<y.length&&(console.groupCollapsed(e),console.table?console.table(y):C.each(y,function(e,o){console.log(o.Name+": "+o["Execution Time"]+"ms")}),console.groupEnd()),y=[]}},invoke:function(t,e,o){var a,r,n,i,c=p;return e=e||P,o=o||m,"string"==typeof t&&void 0!==c&&(t=t.split(/[ .]/),a=t.length-1,C.each(t,function(e,o){var n=e!==a?o+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(C.isPlainObject(c[n])&&e!==a)c=c[n];else{if(void 0!==c[n])return r=c[n],!1;{if(!C.isPlainObject(c[o])||e===a)return void 0!==c[o]?r=c[o]:f.error(l.method,t),!1;c=c[o]}}})),"function"==typeof(i=r)&&"number"!=typeof i.nodeType?n=r.apply(o,e):void 0!==r&&(n=r),Array.isArray(b)?b.push(n):void 0!==b?b=[b,n]:void 0!==n&&(b=n),r}};D?(void 0===p&&f.initialize(),f.invoke(w)):(void 0!==p&&p.invoke("destroy"),f.initialize())}),void 0!==b?b:this},C.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,placeholder:!1,alt:!1,autoplay:"auto",color:"#444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(e){},onEmbed:function(e){return e},metadata:{id:"id",icon:"icon",placeholder:"placeholder",alt:"alt",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{autohide:!e.brandedUI,autoplay:e.autoplay,color:e.color||void 0,hq:e.hd,jsapi:e.api,modestbranding:!e.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(e){return{api:e.api,autoplay:e.autoplay,byline:e.brandedUI,color:e.color||void 0,portrait:e.brandedUI,title:e.brandedUI}}}},templates:{escape:function(e){const o={'"':"&quot;","&":"&amp;","'":"&apos;","<":"&lt;",">":"&gt;"};return e.replace(/["'<>]|&(?![\d#A-Za-z]{1,12};)/g,e=>o[e])},iframe:function(e,o){return o&&(e+="?"+o),'<iframe src="'+(0,C.fn.embed.settings.templates.escape)(e)+'" width="100%" height="100%" msallowFullScreen allowFullScreen></iframe>'},placeholder:function(e,o,n){var t="",a=C.fn.embed.settings.templates.escape;return o&&(t+='<i class="'+a(o)+' icon"></i>'),e&&(t+='<img class="placeholder" src="'+a(e)+'"'+(n?' alt="'+a(n)+'"':"")+">"),t}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document);
11
+ !function(U,e){"use strict";e=void 0!==e&&e.Math===Math?e:globalThis,U.fn.embed=function(...e){const v=U(this);let g=Date.now(),y=[];const w=e[0],P="string"==typeof w,D=e.slice(1);let C;return v.each(function(){const t=U.isPlainObject(w)?U.extend(!0,{},U.fn.embed.settings,w):U.extend({},U.fn.embed.settings),e=t.selector,o=t.className,a=t.sources,l=t.error,r=t.metadata;var n=t.namespace;const i=t.templates,c="."+n,d="module-"+n,u=U(this);u.find(e.placeholder);let s,m=void u.find(e.icon),p=u.find(e.embed);const f=this;let h=u.data(d);const b={initialize:function(){b.debug("Initializing embed"),b.determine.autoplay(),b.create(),b.bind.events(),b.instantiate()},instantiate:function(){b.verbose("Storing instance of module",b),h=b,u.data(d,b)},destroy:function(){b.verbose("Destroying previous instance of embed"),b.reset(),u.removeData(d).off(c)},refresh:function(){b.verbose("Refreshing selector cache"),s=u.find(e.placeholder),m=u.find(e.icon),p=u.find(e.embed)},bind:{events:function(){b.has.placeholder()&&(b.debug("Adding placeholder events"),u.on("click"+c,e.placeholder,b.createAndShow).on("click"+c,e.icon,b.createAndShow))}},create:function(){b.get.placeholder()?b.createPlaceholder():b.createAndShow()},createPlaceholder:function(e=b.get.placeholder()){var o=b.get.icon(),n=b.get.alt();u.html(i.placeholder(e,o,n)),b.debug("Creating placeholder for embed",e,o,n)},createEmbed:function(e=b.get.url()){b.refresh(),p=U("<div/>").addClass(o.embed).html(b.generate.embed(e)).appendTo(u),t.onCreate.call(f,e),b.debug("Creating embed object",p)},changeEmbed:function(e){p.html(b.generate.embed(e))},createAndShow:function(){b.createEmbed(),b.show()},change:function(e,o,n){b.debug("Changing video to ",e,o,n),u.data(r.source,e).data(r.id,o),n?u.data(r.url,n):u.removeData(r.url),b.has.embed()?b.changeEmbed():b.create()},reset:function(){b.debug("Clearing embed and showing placeholder"),b.remove.data(),b.remove.active(),b.remove.embed(),b.showPlaceholder(),t.onReset.call(f)},show:function(){b.debug("Showing embed"),b.set.active(),t.onDisplay.call(f)},hide:function(){b.debug("Hiding embed"),b.showPlaceholder()},showPlaceholder:function(){b.debug("Showing placeholder image"),b.remove.active(),t.onPlaceholderDisplay.call(f)},get:{id:function(){return t.id||u.data(r.id)},placeholder:function(){return t.placeholder||u.data(r.placeholder)},alt:function(){return t.alt||u.data(r.alt)},icon:function(){return t.icon||(void 0!==u.data(r.icon)?u.data(r.icon):b.determine.icon())},source:function(e){return t.source||(void 0!==u.data(r.source)?u.data(r.source):b.determine.source())},type:function(){var e=b.get.source();return void 0!==a[e]&&a[e].type},url:function(e){return e||t.url||(void 0!==u.data(r.url)?u.data(r.url):b.determine.url())}},determine:{autoplay:function(){b.should.autoplay()&&(t.autoplay=!0)},source:function(n=b.get.url()){let t=!1;return n&&U.each(a,function(e,o){if(-1!==n.search(o.domain))return t=e,!1}),t},icon:function(){var e=b.get.source();return void 0!==a[e]&&a[e].icon},url:function(){var e=t.id||u.data(r.id),o=t.source||u.data(r.source),o=void 0!==a[o]&&a[o].url.replace("{id}",e);return o&&u.data(r.url,o),o}},set:{active:function(){u.addClass(o.active)}},remove:{data:function(){u.removeData(r.id).removeData(r.icon).removeData(r.placeholder).removeData(r.alt).removeData(r.source).removeData(r.url)},active:function(){u.removeClass(o.active)},embed:function(){p.empty()}},encode:{parameters:function(e){const o=[];let n;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return o.join("&amp;")}},generate:{embed:function(e){b.debug("Generating embed html");var o=b.get.source();let n;return(e=b.get.url(e))?(o=b.generate.parameters(o),n=i.iframe(e,o)):b.error(l.noURL,u),n},parameters:function(e,o=t.parameters){let n=a[e]&&void 0!==a[e].parameters?a[e].parameters(t):{};return o&&(n=U.extend({},n,o)),n=t.onEmbed(n),b.encode.parameters(n)}},has:{embed:function(){return 0<p.length},placeholder:function(){return t.placeholder||u.data(r.placeholder)}},should:{autoplay:function(){return"auto"===t.autoplay?t.placeholder||void 0!==u.data(r.placeholder):t.autoplay}},is:{video:function(){return"video"===b.get.type()}},setting:function(e,o){if(b.debug("Changing setting",e,o),U.isPlainObject(e))U.extend(!0,t,e);else{if(void 0===o)return t[e];U.isPlainObject(t[e])?U.extend(!0,t[e],o):t[e]=o}},internal:function(e,o){if(U.isPlainObject(e))U.extend(!0,b,e);else{if(void 0===o)return b[e];b[e]=o}},debug:function(...e){!t.silent&&t.debug&&(t.performance?b.performance.log(e):(b.debug=Function.prototype.bind.call(console.info,console,t.name+":"),b.debug.apply(console,e)))},verbose:function(...e){!t.silent&&t.verbose&&t.debug&&(t.performance?b.performance.log(e):(b.verbose=Function.prototype.bind.call(console.info,console,t.name+":"),b.verbose.apply(console,e)))},error:function(...e){t.silent||(b.error=Function.prototype.bind.call(console.error,console,t.name+":"),b.error.apply(console,e))},performance:{log:function(e){var o,n;t.performance&&(n=(o=Date.now())-(g||o),g=o,y.push({Name:e[0],Arguments:e.slice(1),Element:f,"Execution Time":n})),clearTimeout(b.performance.timer),b.performance.timer=setTimeout(function(){b.performance.display()},500)},display:function(){let e=t.name+":",n=0;g=!1,clearTimeout(b.performance.timer),U.each(y,function(e,o){n+=o["Execution Time"]}),e+=" "+n+"ms",1<v.length&&(e+=" ("+v.length+")"),0<y.length&&(console.groupCollapsed(e),console.table(y),console.groupEnd()),y=[]}},invoke:function(t,e=D,o=f){let a=h,r,i,n;var c;return"string"==typeof t&&void 0!==a&&(t=t.split(/[ .]/),r=t.length-1,U.each(t,function(e,o){var n=e!==r?o+t[e+1].charAt(0).toUpperCase()+t[e+1].slice(1):t;if(U.isPlainObject(a[n])&&e!==r)a=a[n];else{if(void 0!==a[n])return i=a[n],!1;{if(!U.isPlainObject(a[o])||e===r)return void 0!==a[o]?i=a[o]:b.error(l.method,t),!1;a=a[o]}}})),"function"==typeof(c=i)&&"number"!=typeof c.nodeType?n=i.apply(o,e):void 0!==i&&(n=i),Array.isArray(C)?C.push(n):void 0!==C?C=[C,n]:void 0!==n&&(C=n),i}};P?(void 0===h&&b.initialize(),b.invoke(w)):(void 0!==h&&h.invoke("destroy"),b.initialize())}),void 0!==C?C:this},U.fn.embed.settings={name:"Embed",namespace:"embed",silent:!1,debug:!1,verbose:!1,performance:!0,icon:!1,source:!1,url:!1,id:!1,placeholder:!1,alt:!1,autoplay:"auto",color:"#444",hd:!0,brandedUI:!1,parameters:!1,onDisplay:function(){},onPlaceholderDisplay:function(){},onReset:function(){},onCreate:function(e){},onEmbed:function(e){return e},metadata:{id:"id",icon:"icon",placeholder:"placeholder",alt:"alt",source:"source",url:"url"},error:{noURL:"No URL specified",method:"The method you called is not defined"},className:{active:"active",embed:"embed"},selector:{embed:".embed",placeholder:".placeholder",icon:".icon"},sources:{youtube:{name:"youtube",type:"video",icon:"video play",domain:"youtube.com",url:"//www.youtube.com/embed/{id}",parameters:function(e){return{autohide:!e.brandedUI,autoplay:e.autoplay,color:e.color||void 0,hq:e.hd,jsapi:e.api,modestbranding:!e.brandedUI}}},vimeo:{name:"vimeo",type:"video",icon:"video play",domain:"vimeo.com",url:"//player.vimeo.com/video/{id}",parameters:function(e){return{api:e.api,autoplay:e.autoplay,byline:e.brandedUI,color:e.color||void 0,portrait:e.brandedUI,title:e.brandedUI}}}},templates:{escape:function(e){const o={'"':"&quot;","&":"&amp;","'":"&apos;","<":"&lt;",">":"&gt;"};return String(e).replace(/["&'<>]/g,e=>o[e])},iframe:function(e,o){let n=e;const t=U.fn.embed.settings.templates.escape;return o&&(n+="?"+o),'<iframe src="'+t(n)+'" width="100%" height="100%" msallowFullScreen allowFullScreen></iframe>'},placeholder:function(e,o,n){let t="";const a=U.fn.embed.settings.templates.escape;return o&&(t+='<i class="'+a(o)+' icon"></i>'),e&&(t+='<img class="placeholder" src="'+a(e)+'"'+(n?' alt="'+a(n)+'"':"")+">"),t}},api:!1,onPause:function(){},onPlay:function(){},onStop:function(){}}}(jQuery,window,document);