From 32f1b60a5f758c3a84d9b3f6eec70ad2d03f1820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Fri, 11 Sep 2015 11:19:23 -0700 Subject: [PATCH] [docs] Add jsfiddle integration for Babel --- js/jsfiddle-integration-babel.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 js/jsfiddle-integration-babel.js diff --git a/js/jsfiddle-integration-babel.js b/js/jsfiddle-integration-babel.js new file mode 100644 index 00000000..b99bbdd4 --- /dev/null +++ b/js/jsfiddle-integration-babel.js @@ -0,0 +1,10 @@ +(function() { + var tag = document.querySelector( + 'script[type="application/javascript;version=1.7"]' + ); + if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) { + alert('Bad JSFiddle configuration, please fork the original React JSFiddle'); + } + tag.setAttribute('type', 'text/babel'); + tag.textContent = tag.textContent.replace(/^\/\/