mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
Merge branch 'gh-pages' of github.com:wix/react-templates into gh-pages
This commit is contained in:
commit
2f2a97d20a
File diff suppressed because one or more lines are too long
@ -118,5 +118,25 @@ var Playground = React.createClass({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var elem = React.createElement(Playground, {direction: 'horizontal'}); //vertical
|
window.playground = React.render(Playground({"direction":'vertical'}), document.getElementById('playground'));
|
||||||
React.render(elem, document.getElementById('playground'));
|
/*
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,12 +16,28 @@ body {
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-area {
|
.code-area.horizontal {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
/*height: 620px;*/
|
/*height: 620px;*/
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.code-area.vertical {
|
||||||
|
width: 100%;
|
||||||
|
/*height: 620px;*/
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-area.horizontal {
|
||||||
|
width: 50%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.result-area.vertical {
|
||||||
|
width: 100%;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
.result-area {
|
.result-area {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
/*height: 620px;*/
|
/*height: 620px;*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE rt CodeEditor="./aceEditor">
|
<!DOCTYPE rt CodeEditor="./aceEditor">
|
||||||
<div>
|
<div>
|
||||||
<div id="myTab" role="tabpanel" class="code-area" style="float: {this.props.direction === 'horizontal' ? 'left' : 'none'}">
|
<div id="myTab" role="tabpanel" class="code-area {(this.props.direction === 'horizontal' && 'horizontal') ||'vertical'}">
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
<ul class="nav nav-pills" role="tablist">
|
<ul class="nav nav-pills" role="tablist">
|
||||||
<li role="presentation" class="active"><a href="#template" aria-controls="template" role="tab" data-toggle="tab">Template</a></li>
|
<li role="presentation" class="active"><a href="#template" aria-controls="template" role="tab" data-toggle="tab">Template</a></li>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div key="result-area" class="result-area well" style="float: {this.props.direction === 'horizontal' ? 'left' : 'none'}; margin-top: 48px;">
|
<div key="result-area" class="result-area well {(this.props.direction === 'horizontal' && 'horizontal') ||'vertical'}" style="margin-top: 48px;">
|
||||||
<h2>Preview:</h2>
|
<h2>Preview:</h2>
|
||||||
<form class="sample-view" onSubmit="(e) => e.preventDefault();">
|
<form class="sample-view" onSubmit="(e) => e.preventDefault();">
|
||||||
<this.sample key="sample">
|
<this.sample key="sample">
|
||||||
|
@ -15,8 +15,7 @@ module.exports = function () {
|
|||||||
return React.DOM.div({}, React.DOM.div({
|
return React.DOM.div({}, React.DOM.div({
|
||||||
'id': 'myTab',
|
'id': 'myTab',
|
||||||
'role': 'tabpanel',
|
'role': 'tabpanel',
|
||||||
'className': 'code-area',
|
'className': 'code-area ' + (this.props.direction || 'vertical')
|
||||||
'style': { float: this.props.direction === 'horizontal' ? 'left' : 'none' }
|
|
||||||
} /* Nav tabs */, React.DOM.ul({
|
} /* Nav tabs */, React.DOM.ul({
|
||||||
'className': 'nav nav-pills',
|
'className': 'nav nav-pills',
|
||||||
'role': 'tablist'
|
'role': 'tablist'
|
||||||
@ -70,11 +69,8 @@ module.exports = function () {
|
|||||||
'readOnly': true
|
'readOnly': true
|
||||||
})))), React.DOM.div({
|
})))), React.DOM.div({
|
||||||
'key': 'result-area',
|
'key': 'result-area',
|
||||||
'className': 'result-area well',
|
'className': 'result-area well ' + (this.props.direction || 'vertical'),
|
||||||
'style': {
|
'style': { marginTop: '48px' }
|
||||||
float: this.props.direction === 'horizontal' ? 'left' : 'none',
|
|
||||||
marginTop: '48px'
|
|
||||||
}
|
|
||||||
}, React.DOM.h2({}, 'Preview:'), React.DOM.form({
|
}, React.DOM.h2({}, 'Preview:'), React.DOM.form({
|
||||||
'className': 'sample-view',
|
'className': 'sample-view',
|
||||||
'onSubmit': onSubmit3.bind(this)
|
'onSubmit': onSubmit3.bind(this)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user