Skip to content

Commit

Permalink
site: Remove now-redundant fake require() in index.html (#67)
Browse files Browse the repository at this point in the history
As of v1.3.0, the distribution supports being included in a
browser environment, in which case it will export the interface
to the 'cssjanus' variable.
  • Loading branch information
Krinkle authored and jdforrester committed Jul 5, 2018
1 parent 99f0d7c commit 569d68a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions site/index.html
Expand Up @@ -39,22 +39,23 @@ <h1>CSSJanus</h1>
<a href="https://github.com/cssjanus/cssjanus"><img class="demo-fork-me" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>
<!-- es5-shim for old IE -->
<script src="./lib/es5-shim.js"></script>
<!-- Fake require() since CSSJanus isn't officially meant for the browser -->
<script>exports = {}; function require() { return exports; }</script>
<script src="../src/cssjanus.js"></script>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
( function () {
/*jshint jquery:true */
var cssjanus = require(),
$input = $( '#demo-input' ),
/* eslint-env jquery, browser */
/* global cssjanus */
var $input = $( '#demo-input' ),
$output = $( '#demo-output' ),
$swapLtr = $( '#demo-swap-ltr' ),
$swapLeft = $( '#demo-swap-left' ),
hashPrefix = '#input/';

function submit( input ) {
$output.val( cssjanus.transform( input, $swapLtr[0].checked, $swapLeft[0].checked ) );
$output.val( cssjanus.transform( input, {
transformDirInUrl: $swapLtr[ 0 ].checked,
transformEdgeInUrl: $swapLeft[ 0 ].checked
} ) );
if ( history.replaceState ) {
history.replaceState( null, document.title, hashPrefix + encodeURIComponent( input ) );
}
Expand Down Expand Up @@ -85,7 +86,7 @@ <h1>CSSJanus</h1>
focus: function () {
this.select();
},
mouseup: function (e) {
mouseup: function ( e ) {
e.preventDefault();
}
} );
Expand Down

0 comments on commit 569d68a

Please sign in to comment.