cm-chessboard 7.3.2 → 7.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ and `slice` is the `id` in `sprite.svg`. See also [Create your own custom marker
|
|
|
154
154
|
below.
|
|
155
155
|
|
|
156
156
|
[Example for **addMarker**, **getMarkers** and
|
|
157
|
-
**removeMarkers**](https://shaack.com/projekte/cm-chessboard/examples/
|
|
157
|
+
**removeMarkers**](https://shaack.com/projekte/cm-chessboard/examples/extensions/markers-extension.html)
|
|
158
158
|
|
|
159
159
|
### getMarkers(type = undefined, square = undefined)
|
|
160
160
|
|
|
@@ -249,7 +249,7 @@ board.enableSquareSelect((event) => {
|
|
|
249
249
|
})
|
|
250
250
|
```
|
|
251
251
|
|
|
252
|
-
[Example for **enableSquareSelect**](https://shaack.com/projekte/cm-chessboard/examples/
|
|
252
|
+
[Example for **enableSquareSelect**](https://shaack.com/projekte/cm-chessboard/examples/extensions/markers-extension.html)
|
|
253
253
|
|
|
254
254
|
**`event.square`** contains the coordinates of the user input.
|
|
255
255
|
|
|
@@ -290,7 +290,7 @@ Important is the id "markerCircle". You can set the marker
|
|
|
290
290
|
with `board.addMarker({class: "markerSquare", slice: "markerSquare"}, "e4")`
|
|
291
291
|
"emphasize" is the css class, which defines the color and opacity of the marker. "slice" is the id of the marker in the
|
|
292
292
|
SVG. This is
|
|
293
|
-
also demonstrated in the [mark squares example](https://shaack.com/projekte/cm-chessboard/examples/
|
|
293
|
+
also demonstrated in the [mark squares example](https://shaack.com/projekte/cm-chessboard/examples/extensions/markers-extension.html)
|
|
294
294
|
.
|
|
295
295
|
|
|
296
296
|
The color and stroke-width of the marker is defined in the css (or scss). You could also define your marker completely
|
|
@@ -356,8 +356,9 @@ export const EXTENSION_POINT = {
|
|
|
356
356
|
positionChanged: "positionChanged", // the positions of the pieces was changed
|
|
357
357
|
boardChanged: "boardChanged", // the board (orientation) was changed
|
|
358
358
|
moveInputToggled: "moveInputToggled", // move input was enabled or disabled
|
|
359
|
-
moveInput: "moveInput", //
|
|
359
|
+
moveInput: "moveInput", // move started, moving over a square, validating or canceled
|
|
360
360
|
redrawBoard: "redrawBoard", // called after redrawing the board
|
|
361
|
+
animation: "animation", // called on animation start, end and on every animation frame
|
|
361
362
|
destroy: "destroy" // called, before the board is destroyed
|
|
362
363
|
}
|
|
363
364
|
```
|
|
@@ -381,7 +382,7 @@ const chessboard = new Chessboard(document.getElementById("board"), {
|
|
|
381
382
|
|
|
382
383
|
Add methods to the main chessboard from your extension with `this.registerMethod("name", callback)`
|
|
383
384
|
like `addArrow(type, from, to)` in the
|
|
384
|
-
[Arrows extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/
|
|
385
|
+
[Arrows extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/arrows-extension.html).
|
|
385
386
|
|
|
386
387
|
```js
|
|
387
388
|
this.registerMethod("addArrow", this.addArrow)
|
|
@@ -398,7 +399,7 @@ of the current position in the alt tag of the board image and enables a form to
|
|
|
398
399
|
can also display the board as HTML table and the pieces as list.
|
|
399
400
|
|
|
400
401
|
See
|
|
401
|
-
example [Accessibility extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/
|
|
402
|
+
example [Accessibility extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/accessibility-extension.html)
|
|
402
403
|
|
|
403
404
|
##### Usage
|
|
404
405
|
|
|
@@ -429,7 +430,7 @@ const chessboard = new Chessboard(document.getElementById("board"), {
|
|
|
429
430
|
|
|
430
431
|
Draw arrows on the board.
|
|
431
432
|
|
|
432
|
-
Example: [Arrows extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/
|
|
433
|
+
Example: [Arrows extension](https://shaack.com/projekte/cm-chessboard/examples/extensions/arrows-extension.html)
|
|
433
434
|
|
|
434
435
|
##### Methods
|
|
435
436
|
|