@samitouri / QOS-React-2 / commits / 4a45ad38b3

[docs] Add jsfiddle integration for Babel

Paul O’Shannessy committed Sep 11, 2015 at 11:19 UTC 4a45ad38b341da7f68c5b11e04fcd8177be9ebb1
1 file changed +10
docs/js/jsfiddle-integration-babel.js new
+10
@@ -0,0 +1,10 @@
1 +(function() {
2 + var tag = document.querySelector(
3 + 'script[type="application/javascript;version=1.7"]'
4 + );
5 + if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) {
6 + alert('Bad JSFiddle configuration, please fork the original React JSFiddle');
7 + }
8 + tag.setAttribute('type', 'text/babel');
9 + tag.textContent = tag.textContent.replace(/^\/\/<!\[CDATA\[/, '');
10 +})();