Browse Source

discarder

Maxim Sokhatsky 11 years ago
parent
commit
f33e0845cf

+ 10 - 78
apps/web/priv/static/dart/Kakaranet-Scene.svg

@@ -94,12 +94,12 @@
             <rect id="Back-5" fill="#D6E8EA" sketch:type="MSShapeGroup" x="0" y="453" width="1070" height="206.792"></rect>
             <path d="M1071,660 L1,660 L1,600.976 L850.979,600.976 L1071,600.976 L1071,660 L1071,660 Z" id="Back-4" fill="#A8CACC" sketch:type="MSShapeGroup"></path>
             <g id="Deck-Root" transform="translate(215.000000, 457.000000)" sketch:type="MSShapeGroup">
-                <path d="M640,68.0096 L279.226,68.0096 L0,68 L0,73.9916 L275.816,73.9916 L640,74 L640,68.0096 Z" id="Shape" fill="#BC8864"></path>
                 <g id="Deck">
+                    <path d="M640,4 L0,4 L2.614,0 L637.177,0 L640,4 L640,4 Z" id="Shape" fill="#BC8864"></path>
                     <rect id="Rectangle-path" fill="#AF7B58" x="0" y="3" width="640" height="65"></rect>
                     <rect id="Rectangle-path" fill="#AF7B58" x="0" y="75" width="640" height="72"></rect>
-                    <path d="M640,4 L0,4 L2.614,0 L637.177,0 L640,4 L640,4 Z" id="Shape" fill="#BC8864"></path>
                 </g>
+                <path d="M640,68.0096 L279.226,68.0096 L0,68 L0,73.9916 L275.816,73.9916 L640,74 L640,68.0096 Z" id="Shape" fill="#BC8864"></path>
             </g>
             <g id="Table" transform="translate(218.000000, 310.000000)" sketch:type="MSShapeGroup">
                 <path d="M634.171,146.66 L-0.36,146.66 L115.967,0.23 L524.45,0.23 L634.171,146.66 L634.171,146.66 Z" id="Shape" fill="#48AF5E"></path>
@@ -364,85 +364,17 @@
                     <path d="M39.941,28.652 L2.774,28.652 C1.229,28.652 -0.022,27.4 -0.022,25.855 C-0.022,24.31 1.229,23.059 2.774,23.059 L39.941,23.059 C41.485,23.059 42.738,24.31 42.738,25.855 C42.738,27.4 41.485,28.652 39.941,28.652" id="Shape"></path>
                 </g>
             </g>
-            <g id="Gabrielo-Discard" transform="translate(232.000000, 379.000000)">
-                <g id="Player-Left-Hand">
-                    <g id="roll-up" transform="translate(4.000000, 0.000000)" sketch:type="MSShapeGroup">
-                        <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                        <path d="M19.24225,12.07775 C18.82425,12.07775 18.40525,11.91775 18.08525,11.59875 L15.43925,8.95175 L12.79325,11.59875 C12.15325,12.23475 11.11925,12.23475 10.47925,11.59875 C9.84025,10.95675 9.84025,9.92375 10.47925,9.28375 L14.28425,5.47775 C14.92625,4.84075 15.96025,4.84075 16.59725,5.47775 L20.40425,9.28375 C21.04425,9.92575 21.04425,10.95875 20.40425,11.59875 C20.08125,11.91775 19.66025,12.07775 19.24225,12.07775 L19.24225,12.07775 L19.24225,12.07775 Z" id="Shape" fill="#FFFFFF"></path>
-                    </g>
-                    <g id="history" transform="translate(2.000000, 1.000000)">
-                        <g id="container" transform="translate(0.000000, 36.000000)" sketch:type="MSShapeGroup">
-                            <g id="roll-down">
-                                <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                                <path d="M12.053,5.132 C12.471,5.132 12.891,5.292 13.211,5.611 L15.857,8.258 L18.503,5.611 C19.142,4.975 20.177,4.975 20.817,5.611 C21.456,6.253 21.456,7.286 20.817,7.926 L17.012,11.732 C16.369,12.369 15.336,12.369 14.698,11.732 L10.891,7.926 C10.252,7.284 10.252,6.251 10.891,5.611 C11.215,5.292 11.635,5.132 12.053,5.132 L12.053,5.132 L12.053,5.132 Z" id="Shape" fill="#FFFFFF"></path>
-                            </g>
-                        </g>
-                        <g id="cards"></g>
-                    </g>
-                    <g id="top-card" transform="translate(0.000000, 14.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
-                        <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
-                    </g>
-                </g>
+            <g id="Gabrielo-Discard" transform="translate(232.000000, 391.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
+                <rect id="Shape" x="0" y="-0.0465116279" width="40" height="59.8006645" rx="8"></rect>
             </g>
-            <g id="You-Discard" transform="translate(799.000000, 379.000000)">
-                <g id="Player-Me-Hand">
-                    <g id="roll-up" transform="translate(4.000000, 0.000000)" sketch:type="MSShapeGroup">
-                        <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                        <path d="M19.24225,12.07775 C18.82425,12.07775 18.40525,11.91775 18.08525,11.59875 L15.43925,8.95175 L12.79325,11.59875 C12.15325,12.23475 11.11925,12.23475 10.47925,11.59875 C9.84025,10.95675 9.84025,9.92375 10.47925,9.28375 L14.28425,5.47775 C14.92625,4.84075 15.96025,4.84075 16.59725,5.47775 L20.40425,9.28375 C21.04425,9.92575 21.04425,10.95875 20.40425,11.59875 C20.08125,11.91775 19.66025,12.07775 19.24225,12.07775 L19.24225,12.07775 L19.24225,12.07775 Z" id="Shape" fill="#FFFFFF"></path>
-                    </g>
-                    <g id="history" transform="translate(2.000000, 1.000000)">
-                        <g id="container" transform="translate(0.000000, 36.000000)" sketch:type="MSShapeGroup">
-                            <g id="roll-down">
-                                <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                                <path d="M12.053,5.132 C12.471,5.132 12.891,5.292 13.211,5.611 L15.857,8.258 L18.503,5.611 C19.142,4.975 20.177,4.975 20.817,5.611 C21.456,6.253 21.456,7.286 20.817,7.926 L17.012,11.732 C16.369,12.369 15.336,12.369 14.698,11.732 L10.891,7.926 C10.252,7.284 10.252,6.251 10.891,5.611 C11.215,5.292 11.635,5.132 12.053,5.132 L12.053,5.132 L12.053,5.132 Z" id="Shape" fill="#FFFFFF"></path>
-                            </g>
-                        </g>
-                        <g id="cards"></g>
-                    </g>
-                    <g id="top-card" transform="translate(0.000000, 14.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
-                        <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
-                    </g>
-                </g>
+            <g id="You-Discard" transform="translate(799.000000, 393.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
+                <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
             </g>
-            <g id="Alina-Discard" transform="translate(666.000000, 247.000000)">
-                <g id="Player-Right-Hand">
-                    <g id="roll-up" transform="translate(4.000000, 0.000000)" sketch:type="MSShapeGroup">
-                        <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                        <path d="M19.24225,12.07775 C18.82425,12.07775 18.40525,11.91775 18.08525,11.59875 L15.43925,8.95175 L12.79325,11.59875 C12.15325,12.23475 11.11925,12.23475 10.47925,11.59875 C9.84025,10.95675 9.84025,9.92375 10.47925,9.28375 L14.28425,5.47775 C14.92625,4.84075 15.96025,4.84075 16.59725,5.47775 L20.40425,9.28375 C21.04425,9.92575 21.04425,10.95875 20.40425,11.59875 C20.08125,11.91775 19.66025,12.07775 19.24225,12.07775 L19.24225,12.07775 L19.24225,12.07775 Z" id="Shape" fill="#FFFFFF"></path>
-                    </g>
-                    <g id="history" transform="translate(2.000000, 1.000000)">
-                        <g id="container" transform="translate(0.000000, 36.000000)" sketch:type="MSShapeGroup">
-                            <g id="roll-down">
-                                <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                                <path d="M12.053,5.132 C12.471,5.132 12.891,5.292 13.211,5.611 L15.857,8.258 L18.503,5.611 C19.142,4.975 20.177,4.975 20.817,5.611 C21.456,6.253 21.456,7.286 20.817,7.926 L17.012,11.732 C16.369,12.369 15.336,12.369 14.698,11.732 L10.891,7.926 C10.252,7.284 10.252,6.251 10.891,5.611 C11.215,5.292 11.635,5.132 12.053,5.132 L12.053,5.132 L12.053,5.132 Z" id="Shape" fill="#FFFFFF"></path>
-                            </g>
-                        </g>
-                        <g id="cards"></g>
-                    </g>
-                    <g id="top-card" transform="translate(0.000000, 14.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
-                        <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
-                    </g>
-                </g>
+            <g id="Alina-Discard" transform="translate(666.000000, 261.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
+                <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
             </g>
-            <g id="Mustafa-Discard" transform="translate(372.000000, 247.000000)">
-                <g id="Player-Center-Hand">
-                    <g id="roll-up" transform="translate(4.000000, 0.000000)" sketch:type="MSShapeGroup">
-                        <path d="M4.399,15.107 L27.399,15.107 C29.016,15.107 30.519,15.589 31.778,16.416 C31.784,16.244 31.803,16.076 31.803,15.902 C31.803,7.12 24.683,0 15.903,0 C7.12,0 1.13686838e-13,7.12 1.13686838e-13,15.902 C1.13686838e-13,16.075 0.021,16.243 0.024,16.414 C1.283,15.59 2.785,15.107 4.399,15.107 L4.399,15.107 L4.399,15.107 Z" id="Shape" fill="#B5C6D8"></path>
-                        <path d="M19.24225,12.07775 C18.82425,12.07775 18.40525,11.91775 18.08525,11.59875 L15.43925,8.95175 L12.79325,11.59875 C12.15325,12.23475 11.11925,12.23475 10.47925,11.59875 C9.84025,10.95675 9.84025,9.92375 10.47925,9.28375 L14.28425,5.47775 C14.92625,4.84075 15.96025,4.84075 16.59725,5.47775 L20.40425,9.28375 C21.04425,9.92575 21.04425,10.95875 20.40425,11.59875 C20.08125,11.91775 19.66025,12.07775 19.24225,12.07775 L19.24225,12.07775 L19.24225,12.07775 Z" id="Shape" fill="#FFFFFF"></path>
-                    </g>
-                    <g id="history" transform="translate(2.000000, 1.000000)">
-                        <g id="container" transform="translate(1.000000, 19.000000)" sketch:type="MSShapeGroup">
-                            <g id="roll-down">
-                                <path d="M4.399,16.995375 L27.399,16.995375 C29.016,16.995375 30.519,17.537625 31.778,18.468 C31.784,18.2745 31.803,18.0855 31.803,17.88975 C31.803,8.01 24.683,0 15.903,0 C7.12,0 1.13686838e-13,8.01 1.13686838e-13,17.88975 C1.13686838e-13,18.084375 0.021,18.273375 0.024,18.46575 C1.283,17.53875 2.785,16.995375 4.399,16.995375 L4.399,16.995375 L4.399,16.995375 Z" id="Shape" fill="#B5C6D8"></path>
-                                <path d="M12.053,5.7735 C12.471,5.7735 12.891,5.9535 13.211,6.312375 L15.857,9.29025 L18.503,6.312375 C19.142,5.596875 20.177,5.596875 20.817,6.312375 C21.456,7.034625 21.456,8.19675 20.817,8.91675 L17.012,13.1985 C16.369,13.915125 15.336,13.915125 14.698,13.1985 L10.891,8.91675 C10.252,8.1945 10.252,7.032375 10.891,6.312375 C11.215,5.9535 11.635,5.7735 12.053,5.7735 L12.053,5.7735 L12.053,5.7735 Z" id="Shape" fill="#FFFFFF"></path>
-                            </g>
-                        </g>
-                        <g id="cards"></g>
-                    </g>
-                    <g id="top-card" transform="translate(0.000000, 14.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
-                        <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
-                    </g>
-                </g>
+            <g id="Mustafa-Discard" transform="translate(372.000000, 261.000000)" fill="#B5C6D8" sketch:type="MSShapeGroup">
+                <rect id="Shape" x="0" y="0" width="40" height="60" rx="8"></rect>
             </g>
             <rect id="Left-Bar" opacity="0.64" fill="#FFFFFF" sketch:type="MSShapeGroup" x="2" y="90.6810161" width="213" height="455.318984" rx="5"></rect>
             <g id="Have-8-Tashes" transform="translate(665.000000, 612.000000)">

+ 2 - 4
apps/web/priv/static/dart/index.htm

@@ -15,13 +15,11 @@
     <script src="js/bert.js"></script>
     <script src="js/selector.js"></script>
     <script src="js/controller.js"></script>
-
-    <script src="js/okey/apiprovider.js"></script>
-    <script src="js/okey/dragndrop.js"></script>
-
     <script src="js/timer.js"></script>
     <script src="js/player.js"></script>
 
+    <script src="js/okey/apiprovider.js"></script>
+    <script src="js/okey/dragndrop.js"></script>
     <script src="js/okey/hand.js"></script>
     <script src="js/okey/card.js"></script>
     <script src="js/okey/deck.js"></script>

+ 21 - 26
apps/web/priv/static/dart/js/app.js

@@ -14,7 +14,7 @@ function PostLoad()
     deck = window.deck;
     scope.user = document.user;
 
-//    var centralCard,
+    centralCard = null,
     apiProvider = new scope.ApiProvider({
             url: scope.apiUrl,
             gameId: scope.gameId,
@@ -30,13 +30,13 @@ function PostLoad()
         apiProvider.actionTake(e.detail.card);
     });
 
-    var $gosterme = $("#Gosterme"),
+    $gosterme = $("#Gosterme"),
         ended = !0;
 
     apiProvider.on("okey_game_started", initOkeyScene);
     apiProvider.on("okey_game_player_state", initOkeyScene);
 
-    var playersPositions = 
+    playersPositions = 
         [
           [ "Me", "Right", "Center", "Left" ],
           [ "Left", "Me", "Right", "Center" ],
@@ -85,7 +85,7 @@ function PostLoad()
     window.playersRightHandsMap = playersRightHandsMap;
     window.playersLeftHandsMap = playersLeftHandsMap;
 
-    var playerTurn = !1;
+    playerTurn = !1;
 
     apiProvider.on("online_number", function (e) {
         console.log("Online Number");
@@ -115,15 +115,15 @@ function PostLoad()
     });
 
     apiProvider.on("okey_tile_discarded", function(e) {
-            if ("object" == typeof e.detail.tile) {
-                var c = new scope.Card({
-                    color: scope.CARD_COLORS[e.detail.tile[1] - 1],
-                    value: e.detail.tile[2]
-                });
-                c.log();
-            }
-            e.detail.player == scope.user && deck.remove(e.detail.tile), playersRightHandsMap[e.detail.player].discard(e.detail.tile);
-        });
+        if ("object" == typeof e.detail.tile) {
+            var c = new scope.Card({
+                color: scope.CARD_COLORS[e.detail.tile[1] - 1],
+                value: e.detail.tile[2]
+            });
+            c.log();
+        }
+        e.detail.player == scope.user && deck.remove(e.detail.tile), playersRightHandsMap[e.detail.player].discard(e.detail.tile);
+    });
 
     var $pile = $("#Center-Cards"),
         $fullPile = $pile.find("g").clone(),
@@ -181,10 +181,10 @@ function PostLoad()
 
     $("#Pause").on("click", function() { apiProvider.pause(); });
 
-    var whoPausedGame,
-        $overlay = $("#overlay");
-        $overlay.on("click", function() { whoPausedGame == scope.user && apiProvider.pause(!0); });
-
+    whoPausedGame=false,
+    //$overlay = $("#overlay");
+//    $overlay.on("click", function() { whoPausedGame == scope.user && apiProvider.pause(!0); });
+/*
     apiProvider.on("game_paused", function(e) {
         if (whoPausedGame = e.detail[3], "pause" == e.detail[2]) {
             $overlay.show();
@@ -196,7 +196,7 @@ function PostLoad()
             for (var player in playersMap) playersMap[player].timer.resume();
         }
     });
-
+*/
     $("#Table-Oval").droppable({
         accept: function(target) {
             return 1 === apiProvider.socket.readyState && deck.length() > 14 && 
@@ -211,7 +211,7 @@ function PostLoad()
 
 function createCentralCard() {
     centralCard = new scope.Card();
-    centralCard.$el.attr({opacity: 0, transform: "translate(298 -115)" })
+    centralCard.$el.attr({opacity: 0, transform: "translate(298,-115)" })
         .on(document.createTouch ? "touchstart" : "mousedown", fadeIn)
         .on(document.createTouch ? "touchend" : "mouseup", fadeOut);
 
@@ -226,12 +226,6 @@ function createCentralCard() {
 
 function initOkeyScene(e)
 {
-    console.log("INIT BOARD");
-    console.log(e.detail.tiles);
-    console.log(deck);
-        deck.fill(e.detail.tiles),
-        deck.render();
-
     if (ended = !1, 
         deck.fill(e.detail.tiles),
         deck.render(),
@@ -258,7 +252,7 @@ function initOkeyScene(e)
                      hand = playersLeftHandsMap[name],
                      j = playerPile.length; j--; ) hand.discard(playerPile[j]);
     }
-    
+
     e.detail.whos_move && "null" != e.detail.whos_move && 
         (e.detail.next_turn_in && "null" != e.detail.next_turn_in && playersMap[e.detail.whos_move].timer.from(e.detail.next_turn_in), 
          e.detail.paused && (playersMap[e.detail.whos_move].timer.pause(), $overlay.show()), 
@@ -289,3 +283,4 @@ function SetupRightMenu()
                         rightFlag = !0 );
     });
 }
+

+ 16 - 2
apps/web/priv/static/dart/js/bootloader.js

@@ -9,7 +9,7 @@ function slotNameDef(x,y) { return "Slot-"+y+","+x; }
 function loadAnimationForButton(a, b) { return loadAppend('svg/ButtonAnimation.svg', a, b); }
 
 function setPlayerName(e, playerName) {
-    var dx = 15; //(document.getElementById(e+"-Name").attributes['fill'].value == "#FFFFFF") ? 65 : 20;
+    var dx = 15;
     document.getElementById(e+"-Name").setAttribute("y",27);
     document.getElementById(e+"-Name").setAttribute("x",dx);
     document.getElementById(e+"-Name").textContent = playerName;
@@ -34,6 +34,8 @@ function loadAppend(file, animation, name) {
         var r = template_engine(localStorage.getItem(file),{'name': animation});
         document.getElementById(name).appendChild(svg(r)); }); }
 
+function discarder(name) { return template_engine(localStorage.getItem("svg/Discarder.svg"), { name: name }); }
+
 function card(line,pos,col,v) {
     return template_engine(
         localStorage.getItem("svg/Card.svg"),
@@ -93,6 +95,13 @@ function PatchSVG()
     
     document.getElementById("Player-Left").style.display = 'block';
 
+    [ {name:"Gabrielo-Discard", hand:"Player-Left-Hand"},
+      {name:"Alina-Discard",    hand:"Player-Right-Hand"},
+      {name:"Mustafa-Discard",  hand:"Player-Center-Hand"},
+      {name:"You-Discard",      hand:"Player-Me-Hand"}                 ].map(function(e) {
+        document.getElementById(e.name).firstElementChild.remove();
+        document.getElementById(e.name).appendChild(svg(discarder(e.hand))); });
+
     // HTML editors
 
 /*
@@ -127,4 +136,9 @@ function onPlayerInfoClose(evt) { document.getElementById('Player-Statistics').s
 
 // Run
 
-loadFile('Kakaranet-Scene.svg', function() { PatchSVG(), StartApp();}, "Refined");
+loadFile('Kakaranet-Scene.svg', function() { 
+    loadFile("svg/Discarder.svg", function() {
+        PatchSVG(),
+        StartApp(); 
+    });
+}, "Refined");

+ 11 - 4
apps/web/priv/static/dart/js/okey/card.js

@@ -1,14 +1,21 @@
 Core(function(scope) {
 
     function Card(options) {
-        options = options || {}, this.value = options.value, this.color = options.color, 
-        this.selected = !1, this.pos = {}, this.elements = {
+        options = options || {},
+        this.value = options.value,
+        this.color = options.color, 
+        this.selected = !1,
+        this.pos = {},
+        this.elements = {
             $circle: "circle",
             $text: "text",
             $overlay: ".overlay"
         }, this.proxies = [ "toggle", "selectGroup", "dragGroup", "clearGroup", "revertGroup" ], 
-        this.template(scope.CARD_SOURCE), this.$el.on("mousedown", this.toggle), this.$el.on("revert", this.revertGroup), 
-        this.$el.on("dragstop", this.clearGroup), this.$overlay.on("mousedown", this.selectGroup);
+        this.template(scope.CARD_SOURCE),
+        this.$el.on("mousedown", this.toggle),
+        this.$el.on("revert", this.revertGroup), 
+        this.$el.on("dragstop", this.clearGroup),
+        this.$overlay.on("mousedown", this.selectGroup);
     }
 
     var selStart = !1;

+ 2 - 0
apps/web/priv/static/dart/js/okey/deck.js

@@ -48,6 +48,8 @@ Core(function(scope) {
         },
 
         render: function() {
+            console.log("Render");
+            console.log(this);
             this.each(function(card, i, j) {
                 null != card && (card.$el.attr("transform", "translate(" + this.trfs[j][i].x + " " + this.trfs[j][i].y + ")"), 
                 card.drag(), this.$el.append(card.$el[0]));

+ 1 - 1
apps/web/priv/static/dart/js/okey/hand.js

@@ -23,7 +23,7 @@ Core(function(scope) {
                     { backHeight: 124, containerTrf: "0 -94",  cardTrf: "0 -89"  },
                     { backHeight: 174, containerTrf: "0 -144", cardTrf: "0 -139" } ];
 
-    defCardTrf = "0 20";
+    var defCardTrf = "0 20";
 
     $.inherit(Hand, scope.Controller);
 

+ 1 - 1
apps/web/priv/static/dart/js/timer.js

@@ -46,7 +46,7 @@ Core(function(scope) {
                 height: defHeight
             }),
             this.$value.text(this.curTime = this.duration),
-            
+
             clearTimeout(this.timerId);
         },
         pause: function() {

BIN
apps/web/priv/static/doc/Kakaranet-Scene.sketch/Data


+ 1 - 1
apps/web/priv/static/doc/Kakaranet-Scene.sketch/metadata

@@ -15,7 +15,7 @@
 		<string>LucidaGrande-Bold</string>
 	</array>
 	<key>length</key>
-	<integer>2679279</integer>
+	<integer>2557250</integer>
 	<key>version</key>
 	<integer>37</integer>
 </dict>