Browse Source

fix location.origin in IE; add comment to chess pieces dict

romanmatiasko 9 years ago
parent
commit
df63252caa
3 changed files with 6 additions and 1 deletions
  1. 0 0
      dist/js/index.js
  2. 5 1
      src/js/components/Index.js
  3. 1 0
      src/js/constants/ChessPieces.js

File diff suppressed because it is too large
+ 0 - 0
dist/js/index.js


+ 5 - 1
src/js/components/Index.js

@@ -23,9 +23,13 @@ const Index = React.createClass({
 
     io.on('created', data => {
       const {time, inc} = this.state;
+      const loc = window.location;
+
+      const origin = loc.origin || `${loc.protocol}//${loc.hostname}` +
+        (loc.port ? ':' + loc.port : '');
 
       this.setState({
-        link: `${document.location.origin}/play/${data.token}/${time}/${inc}`,
+        link: `${origin}/play/${data.token}/${time}/${inc}`,
         hasExpired: false
       });
     });

+ 1 - 0
src/js/constants/ChessPieces.js

@@ -1,4 +1,5 @@
 const ChessPieces = {
+  // key: piece from FEN, value: piece from Smart Regular chess font
   // white pieces
   'K': 'F',
   'Q': 'E',

Some files were not shown because too many files changed in this diff