Browse Source

bump version

Maxim Sokhatsky 11 years ago
parent
commit
d488a14fd4

+ 42 - 1
apps/web/priv/static/app/js/bootloader.js

@@ -6,6 +6,17 @@ function isSafari() {
 var svgNS = "http://www.w3.org/2000/svg";
 var color = ['#DE3F26','#606060','#48AF5E','#FFC800'];
 
+function statsRow(start_name,i,games) {
+    var start_score = 200;
+    var name = template_engine(
+        '<tspan xmlns="http://www.w3.org/2000/svg" x="{this.x}" y="{this.y}">{this.body}</tspan>',{
+            x: start_name,
+            y: 180+25*i,
+            body: games[i].value[0][0] + " — " + games[i].value[0][1]});
+    var element1 = svg(name);
+    document.getElementById('Stat-Right').appendChild(element1);
+}
+
 function parseTransformAttribute(aa) {
     var a = aa.split(' ').join('');
     var b={};
@@ -50,7 +61,14 @@ function initDiscards() {
 function PatchSVG()
 {
 
-    $('Player-Statistics').hide();
+//    $('Player-Statistics').hide();
+
+    var playerInifoOnClick = [
+        "Point-Table" ];
+
+       playerInifoOnClick.map(function(x) { 
+            document.getElementById(x).style.cursor = "pointer";
+            document.getElementById(x).onclick = showPlayerInfo; });
 
     var onlineListOnClick = [
         "Online-Users",
@@ -143,6 +161,29 @@ function showRules()
     });
 }
 
+function showPlayerInfo()
+{
+    ws.send(enc(tuple(atom('client'),
+        tuple(atom('stats_action'),bin(document.user),atom('game_okey')))));
+
+    $.load("svg/Player-Statistics.svg", function(h) {
+        var rules = document.getElementById("Player-Statistics");
+        if (null == rules) {
+            var rulesElement = svg(h);
+            document.getElementById("Kakaranet-12-maxim").appendChild(rulesElement);
+            rules = document.getElementById("Player-Statistics");
+            rules.setAttribute('transform', 'translate(210,86)');
+            rules.setAttribute('onclick', 'onPlayerInfoClose(evt)');
+        }
+        rules.style.display = 'block';
+
+    });
+}
+
+function onPlayerInfoClose(evt) {
+    document.getElementById('Player-Statistics').style.display = 'none';
+}
+
 function onRulesClose(evt) {
     document.getElementById('Okey-Rules').style.display = 'none';
 }

+ 1 - 0
apps/web/priv/static/app/js/okey/okey_protocol.js

@@ -105,6 +105,7 @@ function OkeyApiProviderScope(scope) {
             return msg;
         },
         emitEvent: function(raw,msg) {
+            console.log(String(dec(raw)));
             for (var event, i = eventMap.length, obj; i--; ) {
                 event = eventMap[i];
                 found = (event == msg[0] || msg[event] != null);

+ 13 - 0
apps/web/priv/static/app/js/roster.js

@@ -72,6 +72,19 @@ function RosterHandlers(scope) {
         }
     });
 
+    scope.apiProvider.on("stats_event", function (x) {
+        var e = {detail: x.detail.json, raw: x.detail.bert};
+        document.getElementById('Player-Statistics').style.display = '';
+        var games    = dec(e.raw).value[0][2],
+            reveals  = dec(e.raw).value[0][3],
+            protocol = dec(e.raw).value[0][4];
+        removeChilds(document.getElementById('Stat-Left'));
+        removeChilds(document.getElementById('Stat-Right'));
+//            for (var i=0;i<games.length;i++) { statsRow(24, i,games); }
+        for (var i=0;i<protocol.length;i++) { statsRow(24,i,protocol); }
+        for (var i=0;i<reveals.length;i++) { statsRow(340,i,reveals); }
+    });
+
     scope.apiProvider.on("roster_group", function (x) {
         var e = {detail: x.detail.json, raw: x.detail.bert};
         var list = dec(e.raw).value[0][1];

+ 1 - 1
apps/web/priv/static/app/js/selector.js

@@ -10,7 +10,7 @@ var scope = {
     CARD_COLORS: [ "#CE290F", "#3B5998", "#48AF5E", "#F8E81C" ],
     SKIN_NAMES: [ "Alina", "Gabrielo", "Mustafa" ],
     paused: false,
-    version: 1406201401
+    version: 1406201402
 };
 
 var $ = function(_undefind)

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


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

@@ -16,7 +16,7 @@
 		<string>ZapfDingbatsITC</string>
 	</array>
 	<key>length</key>
-	<integer>2881780</integer>
+	<integer>2882562</integer>
 	<key>version</key>
 	<integer>37</integer>
 </dict>