Commit 6d751ece authored by Quoc Huy Nguyen Dinh's avatar Quoc Huy Nguyen Dinh
Browse files

Move EmbeddedPlayers to better location and minor fixes

parent 2e99ec23
......@@ -7,7 +7,7 @@ import sanitizeConfig, { noImageText } from 'app/utils/SanitizeConfig';
import sanitize from 'sanitize-html';
import HtmlReady from 'shared/HtmlReady';
import tt from 'counterpart';
import { generateMd as EmbeddedPlayerGenerateMd } from 'app/components/modules/EmbeddedPlayers';
import { generateMd as EmbeddedPlayerGenerateMd } from 'app/components/elements/EmbeddedPlayers';
const remarkable = new Remarkable({
html: true, // remarkable renders first then sanitize runs...
......
import React from 'react';
import {
genIframeMd as genDtubeIframeMd,
validateIframeUrl as validateDtubeIframeUrl,
normalizeEmbedUrl as normalizeDtubeEmbedUrl,
embedNode as embedDtubeNode,
} from 'app/components/modules/EmbeddedPlayers/dtube';
} from 'app/components/elements/EmbeddedPlayers/dtube';
import {
genIframeMd as genTwitchIframeMd,
validateIframeUrl as validateTwitchIframeUrl,
normalizeEmbedUrl as normalizeTwitchEmbedUrl,
embedNode as embedTwitchNode,
} from 'app/components/modules/EmbeddedPlayers/twitch';
} from 'app/components/elements/EmbeddedPlayers/twitch';
import { validateIframeUrl as validateSoundcloudIframeUrl } from 'app/components/modules/EmbeddedPlayers/soundcloud';
import { validateIframeUrl as validateSoundcloudIframeUrl } from 'app/components/elements/EmbeddedPlayers/soundcloud';
import {
genIframeMd as genYoutubeIframeMd,
validateIframeUrl as validateYoutubeIframeUrl,
normalizeEmbedUrl as normalizeYoutubeEmbedUrl,
embedNode as embedYoutubeNode,
} from 'app/components/modules/EmbeddedPlayers/youtube';
} from 'app/components/elements/EmbeddedPlayers/youtube';
import {
genIframeMd as genVimeoIframeMd,
validateIframeUrl as validateVimeoIframeUrl,
normalizeEmbedUrl as normalizeVimeoEmbedUrl,
embedNode as embedVimeoNode,
} from 'app/components/modules/EmbeddedPlayers/vimeo';
} from 'app/components/elements/EmbeddedPlayers/vimeo';
const supportedProviders = [
{
......@@ -43,7 +41,7 @@ const supportedProviders = [
validateIframeUrlFn: validateTwitchIframeUrl,
normalizeEmbedUrlFn: normalizeTwitchEmbedUrl,
embedNodeFn: embedTwitchNode,
genIframeMdFn: embedTwitchNode,
genIframeMdFn: genTwitchIframeMd,
},
{
id: 'soundcloud',
......
import React from 'react';
const regex = {
sanitize: /^https:\/\/w.soundcloud.com\/player\/.*?url=(.+?)&.*/i,
};
......
......@@ -3,7 +3,7 @@ import {
getExternalLinkWarningMessage,
} from 'shared/HtmlReady'; // the only allowable title attributes for div and a tags
import { validateIframeUrl as validateEmbbeddedPlayerIframeUrl } from 'app/components/modules/EmbeddedPlayers';
import { validateIframeUrl as validateEmbbeddedPlayerIframeUrl } from 'app/components/elements/EmbeddedPlayers';
export const noImageText = '(Image not shown due to low ratings)';
export const allowedTags = `
......
import React from 'react';
import { normalizeEmbedUrl as normalizeEmbbeddedPlayerEmbedUrl } from 'app/components/modules/EmbeddedPlayers';
import { normalizeEmbedUrl as normalizeEmbbeddedPlayerEmbedUrl } from 'app/components/elements/EmbeddedPlayers';
export default class Iframe extends React.Component {
normalizeEmbedUrl = url => {
......
......@@ -4,7 +4,7 @@ import linksRe, { any as linksAny } from 'app/utils/Links';
import { validate_account_name } from 'app/utils/ChainValidation';
import proxifyImageUrl from 'app/utils/ProxifyUrl';
import * as Phishing from 'app/utils/Phishing';
import { embedNode as EmbeddedPlayerEmbedNode } from 'app/components/modules/EmbeddedPlayers';
import { embedNode as EmbeddedPlayerEmbedNode } from 'app/components/elements/EmbeddedPlayers';
export const getPhishingWarningMessage = () => tt('g.phishy_message');
export const getExternalLinkWarningMessage = () =>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment