Changeset 5024 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/index.jsx
- Timestamp:
- 03/01/2017 06:08:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/index.jsx
r4409 r5024 1 /** 2 * External dependencies. 3 */ 1 4 import React from 'react'; 2 5 import { render } from 'react-dom'; 6 import { Provider } from 'react-redux'; 7 import { setLocale } from 'i18n-calypso'; 3 8 4 import Screenshots from 'components/plugin/sections/screenshots'; 9 /** 10 * Internal dependencies. 11 */ 12 import Router from 'modules/router'; 13 import getStore from 'modules/store'; 5 14 6 // Temporary hack to use the srceenshot viewer without the full React client 7 var elements = document.querySelectorAll( '#screenshots figure' ); 8 var images = []; 9 for ( var i=0; i < elements.length; i++ ) { 10 var caption = elements[i].querySelector('figcaption'); 11 var item = { 12 src: elements[i].querySelector('img.screenshot').src, 13 caption: caption ? caption.textContent : '', 14 } 15 images.push( item ); 16 } 15 //setLocale( localeData ); 17 16 18 if ( images.length > 0 ) { 19 render( 20 <Screenshots screenshots={images}> 21 </Screenshots>, 22 document.getElementById( 'screenshots' ) 23 ); 24 } 17 render( 18 <Provider store={ getStore() }> 19 { Router } 20 </Provider>, 21 document.getElementById( 'content' ) 22 );
Note: See TracChangeset
for help on using the changeset viewer.