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 000000000..35a0f8c6c Binary files /dev/null and b/src/Linkification/icons/dailymotion.png differ