Browse Source

intergation SVG and N2O

Maxim Sokhatsky 11 years ago
parent
commit
19cbb0acd6

+ 1 - 1
apps/face/priv/static/doc/Kakaranet-7-Refined.svg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg width="1071px" height="660px" viewBox="0 0 1071 660" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+<svg width="1070px" height="660px" viewBox="0 0 1070 660" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
     <!-- Generator: Sketch 3.0 (7574) - http://www.bohemiancoding.com/sketch -->
     <title>Export Slicesvg</title>
     <description>Created with Sketch.</description>

+ 2 - 7
apps/face/priv/static/doc/js_proto.htm

@@ -141,13 +141,8 @@ will mirror from server as DATA BERT event also.</P>
 
 <h3><a name="p1.1">Take</a></h3>
 
-<code>ws.send(enc(tuple(
-    atom('client'),
-    tuple(
-        atom('game_action'),
-        1000001,
-        atom('okey_take'),
-        {'pile':0})))); </code>
+<code>ws.send(enc(tuple(atom('client'),tuple(atom('game_action'),1000001,
+    atom('okey_take'),{'pile':0})))); </code>
 
 <h3><a name="p1.1">Discard</a></h3>
 

+ 35 - 4
apps/face/priv/static/doc/svg.htm

@@ -3,7 +3,33 @@
 <head>
 <link href="synrc.css" type="text/css" rel="stylesheet">
 </head>
-<body border=0>
+<body>
+
+<script>var transition = {pid: '', port: '8000' };</script>
+<script>
+
+function handle_web_socket(body) {
+    switch (dec(body).value[0][2].value) {
+        case 'okey_game_started': {
+            var a = dec(body).value[0][3][0].value[0][1];
+            console.log("Cards  " + a.length);
+            console.log(a[0].value[0][1]);
+            console.log(a[2]);
+            for (var i=1;i<=a.length;i++) {
+                var c = a[i-1].value[0][1];
+                var v = a[i-1].value[0][2];
+                console.log("Card " + c + " " + v);
+                place_card(i,1,c,v);
+            }
+        }
+        default: console.log(String(dec(body)));
+    }
+}
+
+</script>
+
+<body>
+
 
 <script>
 
@@ -47,6 +73,8 @@ function loadFile(name, cont, element) {
 
 <p><font color=red style="font-weight:bold;">Please make sure your Vector Editor correctly opens this file!</font></p>
 
+<div id="history"></div><button id="pluslogin" type="button" data-gapiattached="true">Login</button><label id="nothing"> Google</label><br><br><label id="gosterge">Gosterge: 1 5</label><br><label id="player1"> Albert Einstein </label><select id="h1"></select><br><label id="player2"> Marie Curie </label><select id="h2"></select><br><label id="player3"> Ilya Prigogine </label><select id="h3"></select><br><label id="player4" style="font-weight: bold; color: red;"> Asena Simsek </label><select id="h4"></select><br><br><button id="attach" type="button">Attach</button><button id="join" type="button">Join</button><br><select id="take_src"><option label="Table" value="0">Table</option><option label="Left" value="1">Left</option></select><button id="take" type="button">Take</button><select id="istaka"><option label="1 2" value="1 2">1 2</option><option label="2 6" value="2 6">2 6</option><option label="3 7" value="3 7">3 7</option><option label="1 6" value="1 6">1 6</option><option label="1 8" value="1 8">1 8</option><option label="3 6" value="3 6">3 6</option><option label="2 5" value="2 5">2 5</option><option label="2 8" value="2 8">2 8</option><option label="1 13" value="1 13">1 13</option><option label="2 5" value="2 5">2 5</option><option label="4 3" value="4 3">4 3</option><option label="1 11" value="1 11">1 11</option><option label="1 13" value="1 13">1 13</option><option label="2 8" value="2 8">2 8</option><option label="2 1" value="2 1">2 1</option></select><button id="discard" type="button">Discard</button><button id="reveal" type="button">Reveal</button><br><button id="saw_okey" type="button">I Saw Okey</button><button id="have_8" type="button">8 Tashes</button><button id="pause" type="button">Pause</button><button id="info" type="button">PlayerInfo</button>
+
 <h1>Refined Object Names</h1>
 
 <code>
@@ -191,13 +219,13 @@ function empty_card(x,y) { var slot = document.getElementById("Slot-"+y+","+x);
 
 function svg(html) { return new DOMParser().parseFromString(html, "text/xml").firstChild; }
 function rand(lo,hi) { return Math.floor((Math.random()*hi)+lo); }
-function drawCards() { for (var i=1;i<14;i++) { place_card(i,rand(1,2),rand(1,4),rand(1,13)); } }
+function drawCards() { for (var i=1;i<15;i++) { place_card(i,rand(1,2),rand(1,4),rand(1,13)); } }
 function reload(file, name) { var slot = document.getElementById(name);
          slot.parentNode.replaceChild(svg(localStorage.getItem(file)),slot);}
 function scaleScene() {
     reload("Kakaranet-7-Refined.svg", "Refined");
-    for (var i=1;i<14;i++) { empty_card(i,2); empty_card(i,1);}
-    loadFile('templates/Card.svg', drawCards);
+    for (var i=1;i<15;i++) { empty_card(i,2); empty_card(i,1);}
+//    loadFile('templates/Card.svg', drawCards);
     }
 
 loadFile('Kakaranet-7-Refined.svg', scaleScene);
@@ -313,6 +341,9 @@ XML елементами, як це є в WPF наприклад. Тут спр
 
 </div>
 
+<script src='../nitrogen/bullet.js' type='text/javascript' charset='utf-8'></script>
+<script src='../nitrogen/n2o.js' type='text/javascript' charset='utf-8'></script>
+<script src='../nitrogen/bert.js' type='text/javascript' charset='utf-8'></script>
 
 </body>
 </html>

+ 2 - 2
apps/face/priv/static/doc/synrc.css

@@ -24,8 +24,8 @@
 .threecol { float:left; }
 .left { float:left; }
 .hints { width:59px;float:left;margin-right:6px; }
-.main { width:743px;float:left;margin-right:26px; margin-left: 50px; }
-.contents { font-size: 19pt; width:270px;float:left; }
+.main { width:843px;float:left;margin-right:26px; margin-left: 50px; }
+.contents { font-size: 19pt; width:170px;float:left; }
 
 code { background-color: lightblue; margin: 15px 0px 20px 20px;
        padding: 15px 30px 20px 20px; display: inline-block;