Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions website/core/RemarkablePlugins.js
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
'use strict';

const hljs = require('highlight.js');
const {utils} = require('remarkable');
const {escapeHtml} = utils;

// Remove leading "SnackPlayer", "ReactNativeWebPlayer"
function cleanParams(params) {
Expand DownExpand Up@@ -58,13 +56,7 @@ function htmlForCodeBlock(code) {
* ```
*/
function SnackPlayer(md) {
md.renderer.rules.fence_custom.SnackPlayer = function(
tokens,
idx,
options,
env,
self
) {
md.renderer.rules.fence_custom.SnackPlayer = function(tokens, idx) {
let params = parseParams(cleanParams(tokens[idx].params));

const name = params.name ? decodeURIComponent(params.name) : 'Example';
Expand All@@ -77,7 +69,6 @@ function SnackPlayer(md) {
const supportedPlatforms = params.supportedPlatforms
? params.supportedPlatforms
: 'ios,android,web';
const rnVersion = params.version ? params.version : 'next';

return (
'<div class="snack-player">' +
Expand DownExpand Up@@ -126,13 +117,7 @@ function SnackPlayer(md) {
* ```
*/
function ReactNativeWebPlayer(md) {
md.renderer.rules.fence_custom.ReactNativeWebPlayer = function(
tokens,
idx,
options,
env,
self
) {
md.renderer.rules.fence_custom.ReactNativeWebPlayer = function(tokens, idx) {
const WEB_PLAYER_VERSION = '2.0.0-alpha.8';

let sampleCode = tokens[idx].content;
Expand All@@ -148,7 +133,7 @@ function ReactNativeWebPlayer(md) {
'<div class="web-player">' +
htmlForCodeBlock(sampleCode) +
`<iframe style="margin-top: 4" width="100%" height="${
parseParams(paramsString).platform === 'android' ? '425' : '420'
params.platform === 'android' ? '425' : '420'
}" data-src="//cdn.rawgit.com/dabbott/react-native-web-player/gh-v${WEB_PLAYER_VERSION}/index.html${hash}" frame-border="0"></iframe>` +
`</div>` +
'\n\n'
Expand Down
2 changes: 0 additions & 2 deletions website/pages/en/help.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,8 +10,6 @@ const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');
const Container = CompLibrary.Container;

const siteConfig = require(process.cwd() + '/siteConfig.js');

class Help extends React.Component {
render() {
return (
Expand Down
4 changes: 2 additions & 2 deletions website/static/js/codeblocks.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -77,7 +77,7 @@
}
}

function showModal(e) {
function showModal() {
var backdrop = document.querySelector('.modal-backdrop');
if (!backdrop) {
return;
Expand All@@ -89,7 +89,7 @@
modal.classList.add('modal-open');
}

function hideModal(e) {
function hideModal() {
var backdrop = document.querySelector('.modal-backdrop');
if (!backdrop) {
return;
Expand Down