1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00

remove redundant code

This commit is contained in:
ido 2015-01-01 10:33:57 +02:00
parent 2f9824be85
commit cc7cb8ea44
4 changed files with 0 additions and 74 deletions

View File

@ -1,37 +0,0 @@
/**
* Created by avim on 12/2/2014.
*/
'use strict';
var React = require('react/addons');
var _ = require('lodash');
var introTemplate = require('./intro.rt.js');
//var path = require('path');
var fs = require('fs');
/*eslint no-path-concat:0*/
var helloCode = fs.readFileSync(__dirname + '/samples/hello.code').toString();
var helloRT = fs.readFileSync(__dirname + '/samples/hello.rt').toString();
var todoCode = fs.readFileSync(__dirname + '/samples/todo.code').toString();
var todoRT = fs.readFileSync(__dirname + '/samples/todo.rt').toString();
var samples = [
[helloCode, helloRT],
[todoCode, todoRT]
];
samples = _.map(samples, function (tuple) {
return {templateProps: tuple[0], templateHTML: tuple[1]};
});
var intro = React.createClass({
displayName: 'Intro',
getInitialState: function () {
return {
samples: samples
};
},
render: function () {
return introTemplate.apply(this);
}
});
module.exports = intro;

View File

@ -1,6 +0,0 @@
<rt-require dependency="./PlayGround.js" as="playGround"/>
<div>
<h1>React Templates</h1>
<playGround ref="playground" direction="horizontal" rt-props="this.state.samples[0]"/>
<playGround ref="playground" direction="horizontal" rt-props="this.state.samples[1]"/>
</div>

View File

@ -1,16 +0,0 @@
define([
'react/addons',
'lodash',
'./PlayGround.js'
], function (React, _, playGround) {
'use strict';
return function () {
return React.createElement('div', {}, React.createElement('h1', {}, 'React Templates'), React.createElement(playGround, _.merge({}, {
'ref': 'playground',
'direction': 'horizontal'
}, this.state.samples[0])), React.createElement(playGround, _.merge({}, {
'ref': 'playground',
'direction': 'horizontal'
}, this.state.samples[1])));
};
});

View File

@ -1,15 +0,0 @@
/**
* Created by avim on 12/2/2014.
*/
'use strict';
var React = require('react/addons');
var fiddle = require('./fiddle.js');
var intro = require('./intro.js');
window.initFiddle = function () {
window.fiddle = React.render(fiddle(), document.getElementById('container'));
};
window.initIntro = function () {
window.intro = React.render(intro(), document.getElementById('container'));
};