Skip to content

Commit

Permalink
add images to dist/, use unpkg cdn
Browse files Browse the repository at this point in the history
  • Loading branch information
discapes committed Jul 13, 2022
1 parent 31d3d7a commit a2b84e7
Show file tree
Hide file tree
Showing 42 changed files with 32 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# git diff files
*.diff

dist/
dist/build
node_modules/

website/*.html
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Be sure to include the css:

```html
<link rel="stylesheet"
href="https://unpkg.com/@discape/chessboardjs/dist/chessboard.min.css"
href="https://unpkg.com/@discape/chessboardjs/dist/build/chessboard.min.css"
crossorigin="anonymous">
```

Expand Down
Binary file added dist/img/chesspieces/alpha/bB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/bK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/bN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/bP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/bQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/bR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/wB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/wK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/wN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/wP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/wQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/alpha/wR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/bB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/bK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/bN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/bP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/bQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/bR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/wB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/wK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/wN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/wP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/wQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/uscf/wR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/wikipedia/bB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/img/chesspieces/wikipedia/bK.png
12 changes: 12 additions & 0 deletions dist/img/chesspieces/wikipedia/bK.svg
Binary file added dist/img/chesspieces/wikipedia/bN.png
Binary file added dist/img/chesspieces/wikipedia/bP.png
Binary file added dist/img/chesspieces/wikipedia/bQ.png
Binary file added dist/img/chesspieces/wikipedia/bR.png
Binary file added dist/img/chesspieces/wikipedia/wB.png
Binary file added dist/img/chesspieces/wikipedia/wK.png
Binary file added dist/img/chesspieces/wikipedia/wN.png
Binary file added dist/img/chesspieces/wikipedia/wP.png
Binary file added dist/img/chesspieces/wikipedia/wQ.png
Binary file added dist/img/chesspieces/wikipedia/wR.png
3 changes: 1 addition & 2 deletions lib/chessboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,7 @@ function expandConfig(config) {
!config.hasOwnProperty('pieceTheme') ||
(!isString(config.pieceTheme) && !isFunction(config.pieceTheme))
) {
config.pieceTheme =
'https://chessboardjs.com/img/chesspieces/wikipedia/{piece}.png'
config.pieceTheme = 'https://unpkg.com/@discape/chessboardjs/dist/img/chesspieces/wikipedia/{piece}.png'
}

// animation speeds
Expand Down
27 changes: 14 additions & 13 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// -----------------------------------------------------------------------------
// This file creates a build in the dist/ folder
// This file creates a build in the dist/build/ folder
// -----------------------------------------------------------------------------

// libraries
Expand Down Expand Up @@ -64,21 +64,22 @@ console.assert(
'error minifying CSS!',
)

// create a fresh dist/ folder
fs.removeSync('dist')
fs.makeTreeSync('dist')
// create a fresh dist/build/ folder
fs.removeSync('dist/build')
fs.makeTreeSync('dist/build')

// copy lib files to dist/
fs.writeFileSync('dist/chessboard.css', cssSrc, encoding)
fs.writeFileSync('dist/chessboard.min.css', minifiedCSS, encoding)
// copy lib files to dist/build/
fs.writeFileSync('dist/build/chessboard.css', cssSrc, encoding)
fs.writeFileSync('dist/build/chessboard.min.css', minifiedCSS, encoding)

fs.writeFileSync('dist/chessboard.min.mjs', mjsmin, encoding)
fs.writeFileSync('dist/chessboard.min.cjs', cjsmin, encoding)
fs.writeFileSync('dist/chessboard.min.js', banner() + browserjsmin, encoding)
fs.writeFileSync('dist/build/chessboard.min.mjs', mjsmin, encoding)
fs.writeFileSync('dist/build/chessboard.min.cjs', cjsmin, encoding)
fs.writeFileSync('dist/build/chessboard.min.js', banner() + browserjsmin, encoding)

fs.writeFileSync('dist/build/chessboard.mjs', mjs, encoding)
fs.writeFileSync('dist/build/chessboard.cjs', cjs, encoding)
fs.writeFileSync('dist/build/chessboard.js', banner() + browserjs, encoding)

fs.writeFileSync('dist/chessboard.mjs', mjs, encoding)
fs.writeFileSync('dist/chessboard.cjs', cjs, encoding)
fs.writeFileSync('dist/chessboard.js', banner() + browserjs, encoding)

function banner() {
return (
Expand Down
6 changes: 3 additions & 3 deletions templates/download.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ import { Chessboard, objToFen, fenToObj } from "@discape/chessboardjs";
</pre>
<p>Remember to include the css:</p>
<pre class="prettyprint">&lt;link rel="stylesheet"
href="https://unpkg.com/@discape/chessboardjs/dist/chessboard.min.css"
href="https://unpkg.com/@discape/chessboardjs/dist/build/chessboard.min.css"
crossorigin="anonymous"&gt;</pre>
</section>

<section>
<h2>Content Delivery Network</h2>
<p>You can use chessboardjs via the <a href="https://unpkg.com/">unpkg CDN</a> with the following links:
<pre class="prettyprint">&lt;link rel="stylesheet"
href="https://unpkg.com/@discape/chessboardjs/dist/chessboard.min.css"
href="https://unpkg.com/@discape/chessboardjs/dist/build/chessboard.min.css"
integrity="sha384-q94+BZtLrkL1/ohfjR8c6L+A6qzNH9R2hBLwyoAfu3i/WCvQjzL2RQJ3uNHDISdU"
crossorigin="anonymous"&gt;</pre>
<pre class="prettyprint">&lt;script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2"
crossorigin="anonymous"&gt;&lt;/script&gt;

&lt;script src="https://unpkg.com/@discape/chessboardjs/dist/chessboard.min.js"
&lt;script src="https://unpkg.com/@discape/chessboardjs/dist/build/chessboard.min.js"
crossorigin="anonymous"&gt;&lt;/script&gt;</pre>
<p style="line-height: 1.6rem;">Please note that <a href="https://jquery.com/">jQuery</a> is a required dependency of chessboard.js and must be loaded on your webpage before the <code>chessboard.min.js</code> file.</p>
</section>
Expand Down

0 comments on commit a2b84e7

Please sign in to comment.