From 60711a54e179ec857a1e2c6fb0c91eb7fa300728 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 12 Feb 2016 21:19:02 -0800 Subject: [PATCH] Add Dailymotion embedding. --- src/General/Config.coffee | 2 +- src/Linkification/Embedding.coffee | 11 +++++++++++ src/Linkification/icons/dailymotion.png | Bin 0 -> 226 bytes 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/Linkification/icons/dailymotion.png diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 0f1329c5f..b93580f0a 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -133,7 +133,7 @@ Config = ] 'Link Title': [ true - 'Replace the link of a supported site with its actual title. Currently supported: YouTube, Vimeo, SoundCloud, and Github gists.' + 'Replace the link of a supported site with its actual title. Currently supported: YouTube, Vimeo, Dailymotion, SoundCloud, and Github gists.' 1 ] 'Embedding': [ diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index c7281cd01..bc66209fb 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -173,6 +173,17 @@ Embedding = controls: true preload: 'auto' src: a.dataset.href + , + key: 'Dailymotion' + regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+).*((?:\?.*)?)/ + style: 'border: none; width: 640px; height: 360px;' + el: (a) -> + options = if (start = a.dataset.options.match /[?&](start=\d+)/) then "?#{start[1]}" else '' + $.el 'iframe', + src: "//www.dailymotion.com/embed/video/#{a.dataset.uid}#{options}" + title: + api: (uid) -> "https://api.dailymotion.com/video/#{uid}" + text: (_) -> _.title , key: 'Gist' regExp: /^\w+:\/\/gist\.github\.com\/(?:[\w\-]+\/)?(\w+)/ diff --git a/src/Linkification/icons/dailymotion.png b/src/Linkification/icons/dailymotion.png new file mode 100644 index 0000000000000000000000000000000000000000..35a0f8c6c666ccf648add8887018f719e9c423d1 GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFY;1lA?kaG9?uYb2*{&MPj&X#*$rt;Cc^IzV4{?oGcy>Z*qq=m2N9{F_a z&i9YAb58-aM0&b7hHzX@PH