diff --git a/func.js b/func.js
index a847a36..8a47ff0 100644
--- a/func.js
+++ b/func.js
@@ -1,13 +1,20 @@
$(function () {
- var sortables = []
+
// Build pins
for (var i = 1; i < 25; i++) {
- var div = $("
").addClass("pin").attr('id', 'pin-'+i);
+
+ if (i < 13) {
+ var pos = 'bottom';
+ } else {
+ var pos = 'top';
+ }
+ var div = $("").addClass("pin").addClass("pin-"+pos).attr('id', 'pin-'+i);
+
var checkers_div = $("").addClass("checkers").attr('id', 'checkers-'+i);
var checkers_list = $("").addClass("checkers_list").attr('id', 'checkers_list-'+i);
- sortables.push("#checkers_list-"+i);
+
checkers_div.append(checkers_list);
div.append(checkers_div);
@@ -17,8 +24,8 @@ $(function () {
convertBoard();
convertToBoard();
- console.log(sortables.join());
- $( sortables.join() ).sortable({
+
+ $( ".checkers_list" ).sortable({
connectWith: ".checkers_list"
});
@@ -64,7 +71,7 @@ function onReceived(data) {
function get_request() {
$.ajax({
- url: 'http://127.0.0.1:5000/',
+ url: 'http://127.0.0.1:5000/get_board',
dataType: 'JSONP',
data: {
format: 'json'
@@ -86,7 +93,7 @@ function post_request() {
var data = {'board' : board.toString()}
$.ajax({
type : "POST",
- url : "http://127.0.0.1:5000/post_request",
+ url : "http://127.0.0.1:5000/post_board",
data: JSON.stringify(data),
success: onPost
});
diff --git a/index.html b/index.html
index 7de1783..c2b0f68 100644
--- a/index.html
+++ b/index.html
@@ -24,11 +24,12 @@
-
-
-
-
-
+
+
+
+
+
+