2014-12-07 14:12:50 +01:00
|
|
|
define([
|
|
|
|
'react/addons',
|
|
|
|
'lodash',
|
2014-12-09 14:31:25 +01:00
|
|
|
'./CodeMirrorEditor'
|
2014-12-07 14:12:50 +01:00
|
|
|
], function (React, _, CodeEditor) {
|
|
|
|
'use strict';
|
2014-12-30 10:35:24 +01:00
|
|
|
function onChange1(e) {
|
|
|
|
this.setState({ templateHTML: e.target.value });
|
2014-12-07 14:12:50 +01:00
|
|
|
}
|
2014-12-30 10:35:24 +01:00
|
|
|
function onChange2(e) {
|
|
|
|
this.setState({ templateProps: e.target.value });
|
2014-12-07 14:12:50 +01:00
|
|
|
}
|
|
|
|
function onSubmit3(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
|
|
|
return function () {
|
2014-12-30 09:42:31 +01:00
|
|
|
return React.createElement('div', { 'className': 'playground' }, React.createElement('div', { 'className': 'fiddle-row' }, React.createElement('div', {
|
|
|
|
'className': 'code-area',
|
|
|
|
'id': 'area-rt'
|
2014-12-30 10:35:24 +01:00
|
|
|
}, React.createElement(CodeEditor, {
|
2014-12-10 13:14:22 +01:00
|
|
|
'ref': 'editorRT',
|
2014-12-08 11:45:32 +01:00
|
|
|
'id': 'editor-rt',
|
2014-12-07 14:12:50 +01:00
|
|
|
'className': 'large-text-area',
|
|
|
|
'value': this.state.templateHTML,
|
|
|
|
'mode': 'html',
|
|
|
|
'onChange': onChange1.bind(this)
|
2014-12-30 09:42:31 +01:00
|
|
|
})), React.createElement('div', {
|
|
|
|
'className': 'code-area',
|
|
|
|
'id': 'area-code'
|
2014-12-30 10:35:24 +01:00
|
|
|
}, React.createElement(CodeEditor, {
|
2014-12-10 13:14:22 +01:00
|
|
|
'ref': 'editorCode',
|
2014-12-08 11:45:32 +01:00
|
|
|
'id': 'editor-code',
|
2014-12-07 14:12:50 +01:00
|
|
|
'className': 'large-text-area',
|
|
|
|
'value': this.state.templateProps,
|
|
|
|
'mode': 'javascript',
|
|
|
|
'onChange': onChange2.bind(this)
|
2014-12-30 09:42:31 +01:00
|
|
|
}))), React.createElement('div', { 'className': 'fiddle-row' }, React.createElement('div', {
|
|
|
|
'className': 'code-area',
|
|
|
|
'id': 'area-generated'
|
2014-12-30 10:35:24 +01:00
|
|
|
}, React.createElement(CodeEditor, {
|
2014-12-08 11:45:32 +01:00
|
|
|
'id': 'editor-generated',
|
2014-12-07 14:12:50 +01:00
|
|
|
'className': 'large-text-area',
|
2014-12-30 09:42:31 +01:00
|
|
|
'ref': 'editorGenerated',
|
2014-12-07 14:12:50 +01:00
|
|
|
'value': this.templateSource,
|
|
|
|
'mode': 'javascript',
|
|
|
|
'readOnly': true
|
2014-12-09 14:31:25 +01:00
|
|
|
})), React.createElement('div', {
|
2014-12-30 09:42:31 +01:00
|
|
|
'className': 'code-area',
|
|
|
|
'id': 'area-result'
|
|
|
|
} /* <div id="result-container" class="result-area"> */, React.createElement('div', {
|
2014-12-08 11:45:32 +01:00
|
|
|
'id': 'result-area',
|
2014-12-07 14:12:50 +01:00
|
|
|
'key': 'result-area',
|
2014-12-30 09:42:31 +01:00
|
|
|
'className': 'sample-view'
|
2014-12-30 10:35:24 +01:00
|
|
|
}, React.createElement('form', {
|
2014-12-30 09:42:31 +01:00
|
|
|
'className': 'result-area-form',
|
|
|
|
'ref': 'mount',
|
2014-12-07 14:12:50 +01:00
|
|
|
'onSubmit': onSubmit3.bind(this)
|
2014-12-30 09:42:31 +01:00
|
|
|
} /* <this.sample key="sample"> */
|
|
|
|
/* </this.sample> */)))));
|
2014-12-07 14:12:50 +01:00
|
|
|
};
|
|
|
|
});
|