Skip to content

Commit

Permalink
Merge pull request facebook#1576 from spicyj/ex-shim
Browse files Browse the repository at this point in the history
Add shims to examples
  • Loading branch information
zpao committed May 21, 2014
2 parents bf5dfc8 + 4cb4bd0 commit cccdc54
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/ballmer-peak/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react.js"></script>
<script src="../../build/JSXTransformer.js"></script>
<script type="text/jsx" src="example.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions examples/basic-commonjs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="bundle.js"></script>
</body>
</html>
3 changes: 3 additions & 0 deletions examples/basic-jsx-external/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react.js"></script>
<script src="../../build/JSXTransformer.js"></script>
<script type="text/jsx" src="example.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions examples/basic-jsx-precompile/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react.js"></script>
<script src="build/example.js"></script>
</body>
Expand Down
3 changes: 3 additions & 0 deletions examples/basic-jsx/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react.js"></script>
<script src="../../build/JSXTransformer.js"></script>
<script type="text/jsx">
Expand Down
3 changes: 3 additions & 0 deletions examples/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react.js"></script>
<script>
var ExampleApplication = React.createClass({
Expand Down
3 changes: 3 additions & 0 deletions examples/jquery-bootstrap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
</head>
<body>
<div id="jqueryexample"></div>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react.js"></script>
<script src="../../build/JSXTransformer.js"></script>
<script type="text/javascript" src="../shared/thirdparty/jquery.min.js" charset="utf-8"></script>
Expand Down
3 changes: 3 additions & 0 deletions examples/jquery-mobile/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
</head>
<body class="ui-mobile-viewport ui-overlay-a">
<div id="content"></div>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
<script src="../../build/react.js"></script>
Expand Down
15 changes: 15 additions & 0 deletions examples/shared/thirdparty/console-polyfill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Console-polyfill. MIT license.
// https://github.com/paulmillr/console-polyfill
// Make it safe to do console.log() always.
(function(con) {
'use strict';
var prop, method;
var empty = {};
var dummy = function() {};
var properties = 'memory'.split(',');
var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' +
'table,time,timeEnd,timeStamp,trace,warn').split(',');
while (prop = properties.pop()) con[prop] = con[prop] || empty;
while (method = methods.pop()) con[method] = con[method] || dummy;
})(this.console = this.console || {}); // Using `this` for web workers.
2 changes: 2 additions & 0 deletions examples/shared/thirdparty/es5-sham.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/shared/thirdparty/es5-shim.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/transitions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ <h4>Example Details</h4>
Learn more about React at
<a href="http://facebook.github.io/react" target="_blank">facebook.github.io/react</a>.
</p>
<script src="../shared/thirdparty/es5-shim.min.js"></script>
<script src="../shared/thirdparty/es5-sham.min.js"></script>
<script src="../shared/thirdparty/console-polyfill.js"></script>
<script src="../../build/react-with-addons.js"></script>
<script src="../../build/JSXTransformer.js"></script>
<script type="text/jsx">
Expand Down

0 comments on commit cccdc54

Please sign in to comment.