Skip to content

Commit

Permalink
Switch to ES6 syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miklos Juhasz committed Jan 17, 2016
1 parent 79e6ec8 commit b7a2859
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions client/components/tinymce/plugins/wpcom-view/wpvideo-view.jsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,37 @@
/**
* External dependencies
*/
import React from 'react';
import React, { Component } from 'react';

/**
* Internal dependencies
*/
import shortcodeUtils from 'lib/shortcode';

const WpVideoView = React.createClass( {

statics: {
match( content ) {
const match = shortcodeUtils.next( 'wpvideo', content );

if ( match ) {
return {
index: match.index,
content: match.content,
options: {
shortcode: match.shortcode
}
};
}
},

serialize( content ) {
return encodeURIComponent( content );
class WpVideoView extends Component {

static match( content ) {
const match = shortcodeUtils.next( 'wpvideo', content );

if ( match ) {
return {
index: match.index,
content: match.content,
options: {
shortcode: match.shortcode
}
};
}
},
}

static serialize( content ) {
return encodeURIComponent( content );
}

getEmbedUrl() {
var videopress_guid = shortcodeUtils.parse( this.props.content ).attrs.numeric[0];
return `https://videopress.com/embed/${ videopress_guid }`;
},
}

render() {
return (
Expand All @@ -44,6 +42,6 @@ const WpVideoView = React.createClass( {
);
}

} );
}

export default WpVideoView;

0 comments on commit b7a2859

Please sign in to comment.