react-templates/playground/fiddle-main.js

55 lines
1.8 KiB
JavaScript
Raw Normal View History

requirejs.config({
// baseUrl: '/',
paths: {
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min',
2015-07-07 10:54:59 +02:00
jquery: '//code.jquery.com/jquery-2.1.4.min',
firebase: 'https://cdn.firebase.com/js/client/2.0.5/firebase',
react: '//fb.me/react-with-addons-0.13.3.min',
//ace: '../ace-builds-1.1.8/src-min/ace',
2014-12-08 13:48:12 +01:00
fiddle: './fiddle',
text: 'libs/requirejs-plugins/text',
2014-12-30 10:05:27 +01:00
json: 'libs/requirejs-plugins/json',
2014-12-30 16:53:42 +01:00
bootstrap: 'libs/bootstrap/bootstrap.min'
2014-12-09 14:31:25 +01:00
//codeMirror: 'libs/codemirror-4.8/lib/codemirror',
//htmlmixed: 'libs/codemirror-4.8/mode/htmlmixed/htmlmixed',
//javascript: 'libs/codemirror-4.8/mode/javascript/javascript'
//'react/addons': '//fb.me/react-with-addons-0.12.1'
},
shim: {
2014-12-08 11:45:32 +01:00
lodash: {exports: '_'},
firebase: {exports: 'Firebase'},
//ace: { exports: 'ace' },
2014-12-08 11:45:32 +01:00
jquery: {exports: '$'},
react: {exports: 'React'}
},
map: {
'*': {
'react/addons': 'react'
}
}
});
2014-12-30 10:05:27 +01:00
requirejs(['jquery', 'react', 'fiddle', 'bootstrap'], function ($, React, fiddle) {
'use strict';
2015-01-05 11:07:20 +01:00
var elem = React.createElement(fiddle);
window.fiddle = React.render(elem, document.getElementById('container'));
2014-12-31 15:41:11 +01:00
//$(function () {
// //$(window).resize(calcSize);
// //calcSize();
//});
//
//function calcSize() {
// var contentHeight = $(window).height() - $('#header').height();
// var height = contentHeight / 2 - 10;
// console.log(contentHeight, height);
// $('.code-area').each(function (/*i, k*/) {
// $(this).height(height);
// console.log($(this).height());
// });
// window.editorCode.refresh();
// window.editorRT.refresh();
// window.editorGenerated.refresh();
//}
});