react-templates/playground/main.js

37 lines
941 B
JavaScript
Raw Normal View History

2014-11-18 15:06:25 +01:00
'use strict';
/*eslint-env browser*/
2014-11-16 16:20:04 +01:00
var reactTemplates = require('../src/reactTemplates');
2014-11-17 12:27:57 +01:00
2014-11-16 16:20:04 +01:00
var React = require('react/addons');
2014-11-17 12:27:57 +01:00
2014-11-16 16:20:04 +01:00
var _ = require('lodash');
2014-11-18 15:06:25 +01:00
var html = '<div>hello</div>';
2014-11-16 16:20:04 +01:00
var res = reactTemplates.convertTemplateToReact(html.trim());
2014-11-30 12:59:44 +01:00
//console.log(res);
2014-11-16 16:20:04 +01:00
2014-12-02 15:57:18 +01:00
var Playground = require('./playground.js');
window.playground = React.render(Playground({"direction":'vertical'}), document.getElementById('playground'));
2014-11-16 17:20:43 +01:00
2014-11-30 16:34:43 +01:00
/*
function generateRandomId() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx'.replace(/[xy]/g, function(c) {
var r = _.random(0,15);
return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
return uuid;
};
if (window.location.hash) {
var firebase = new Firebase('https://co5qowu8b6k.firebaseio-demo.com/'+window.location.hash);
firebase.on('value',function (snapshot) {
window.playground.setState(snapshot.val());
firebase.goOffline();
});
}*/