Skip to content

Commit 69551ba

Browse files
author
Admiral Adama
committed
added text about drag n drop, added perft button
1 parent 0263e9d commit 69551ba

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

assets/scripts.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $(document).ready(function(){
1313
event.preventDefault();
1414

1515
if (event.type === 'drop') {
16-
var oldsquare = event.originalEvent.dataTransfer.getData('Text',$(this).attr('id'));
16+
var oldsquare = event.originalEvent.dataTransfer.getData('Text', $(this).attr('id'));
1717

1818
var newsquare = $(this).attr('id');
1919

@@ -28,4 +28,8 @@ $(document).ready(function(){
2828
}
2929
};
3030
});
31-
})
31+
32+
$('#perft').click(function(){
33+
window.location.href = 'perft.php?fen=' + $('#fen').val();
34+
});
35+
});

views/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ <h1>
2020
AdmiralAdama Chess
2121
</h1>
2222

23+
<p>
24+
Drag and drop a piece to make a move. No AI support yet, but coming soon!
25+
</p>
26+
2327
<div class="two_columns">
2428
<div>
2529
<div class="status_box">
@@ -102,8 +106,9 @@ <h1>
102106
<form id="import_fen">
103107
<p>
104108
FEN:<br />
105-
<input type="text" name="fen" value="<?php echo $fen; ?>" /><br />
109+
<input id="fen" type="text" name="fen" value="<?php echo $fen; ?>" /><br />
106110
<input type="submit" value="Import FEN" />
111+
<input type="button" id="perft" value="Perft" />
107112
</p>
108113
</form>
109114
</body>

0 commit comments

Comments
 (0)