Permalink
Browse files

major updates: new look, editing modes, started pattern search & game…

… archive, experimental wii support

git-svn-id: https://eidogo.googlecode.com/svn/trunk@17 3a017fa3-8d26-0410-b3dd-4f2ae428da9e
  • Loading branch information...
jkkramer
jkkramer committed Jul 13, 2007
1 parent b78f544 commit 71d13bd536e1b9086084aa7baf18347ddfe3f601
View
@@ -2,4 +2,4 @@ Options -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1 [L]
RewriteRule ^(.*)$ index.php?$1
View
@@ -1,10 +1,11 @@
planned
- fix variations overflow css thing
X fix variations overflow css thing
- player time
- uploading
- coordinate labels
X coordinate labels
X slider navigation
- edit mode
X edit mode
- add letter/number labels
- complete FF[4] SGF support
maybe
View
@@ -0,0 +1,12 @@
<?php
require("php/db.php");
mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db("go_games");
$id = (int)$_GET['id'];
$query = mysql_query("select sgf from games where id='$id'");
$row = mysql_fetch_row($query);
echo trim($row[0]);
?>
View
114 index.php
@@ -1,44 +1,55 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>EidoGo - SGF Replayer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="site-style.css" />
<link rel="stylesheet" href="player/player.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="/eidogo/site-style.css">
<link rel="stylesheet" href="/eidogo/player/player.css">
<!--[if IE 6]>
<style type="text/css">
.eidogo-player .board .point.stone.black {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="player/images/b.png");
}
.eidogo-player .board .point.stone.white {
background: none;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="player/images/w.png");
}
</style>
<![endif]-->
<!--
For international support, uncomment the following line and put in the
appropriate language code (see the 'player/i18n' folder).
-->
<!-- <script type="text/javascript" src="player/i18n/pt_br.js"></script> -->
<script type="text/javascript" src="player/player.compressed.js"></script>
<!-- <script type="text/javascript" src="player/player.compressed.js"></script> -->
<!--
Uncomment the following to work with the original source.
-->
<!--
<script type="text/javascript" src="js/yui-util.js"></script>
<script type="text/javascript" src="js/yui-slider.js"></script>
<script type="text/javascript" src="js/yui-ext-domhelper.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/eidogo.js"></script>
<script type="text/javascript" src="js/i18n.js"></script>
<script type="text/javascript" src="js/gametree.js"></script>
<script type="text/javascript" src="js/sgf.js"></script>
<script type="text/javascript" src="js/board.js"></script>
<script type="text/javascript" src="js/rules.js"></script>
<script type="text/javascript" src="js/player.js"></script>
-->
<script type="text/javascript" src="/eidogo/js/yui-util.js"></script>
<script type="text/javascript" src="/eidogo/js/yui-slider.js"></script>
<script type="text/javascript" src="/eidogo/js/yui-ext-domhelper.js"></script>
<script type="text/javascript" src="/eidogo/js/util.js"></script>
<script type="text/javascript" src="/eidogo/js/eidogo.js"></script>
<script type="text/javascript" src="/eidogo/js/i18n.js"></script>
<script type="text/javascript" src="/eidogo/js/gametree.js"></script>
<script type="text/javascript" src="/eidogo/js/sgf.js"></script>
<script type="text/javascript" src="/eidogo/js/board.js"></script>
<script type="text/javascript" src="/eidogo/js/rules.js"></script>
<script type="text/javascript" src="/eidogo/js/player.js"></script>
<?php
include("php/json.php");
$json = new Services_JSON();
$in = $_SERVER['QUERY_STRING'];
if (!$in || $in == "kjd") {
$cfg = array(
"domId" => "player-container",
"mode" => "play",
"sgfUrl" => "php/kjd_progressive.php",
"sgfUrl" => "/eidogo/php/kjd_progressive.php",
"progressiveLoad" => true,
"markCurrent" => true,
"markVariations" => true,
@@ -58,45 +69,62 @@
"showPlayerInfo" => true,
);
if (strpos($in, "gnugo") === 0) {
$cfg['opponentUrl'] = "php/gnugo.php";
$cfg['opponentUrl'] = "/eidogo/php/gnugo.php";
$cfg['opponentColor'] = "B";
list(, $size) = split(";", $in);
if ($size) {
$cfg['boardSize'] = (string)(int)$size;
}
} elseif (strpos($in, "games/") === 0) {
$cfg['sgfUrl'] = "/eidogo/games.php?id=" . str_replace("games/", "", $in);
} elseif ($in != "blank") {
$cfg['sgfUrl'] = "sgf/$in.sgf";
$cfg['sgfUrl'] = "/eidogo/sgf/$in.sgf";
}
}
?>
<script type="text/javascript">
//<![CDATA[
var player;
YAHOO.util.Event.on(window, "load", function() {
var cfg = <?php echo $json->encode($cfg); ?>;
var cfg = <?php echo json_encode($cfg); ?>;
cfg.loadPath = location.hash.replace(/^#/, "").split(/,/);
player = new eidogo.Player(cfg);
});
//]]>
</script>
</head>
<body>
<h1>EidoGo</h1>
<ul id="links">
<li><a href="http://senseis.xmp.net/?EidoGo">Info</a> | </li>
<li><a href="kjd">Joseki Tutor</a> | </li>
<!-- <li><a href="archive">Game Archive</a> | </li> -->
<li><a href="gnugo">GNU Go</a> (<a href="gnugo;9">9&times;9</a>, <a href="gnugo;13">13&times;13</a>)</a> | </li>
<li><a href="blank">Blank Board</a> | </li>
<!-- <li><a href="upload">Upload</a> | </li> -->
<!-- <li><a href="player.downloadSgf()">Download SGF</a> | </li> -->
<li><a href="source.html">Source Code</a>
</ul>
<div id="player-container"></div>
<div id="container">
<div id="header">
<h1>Eido<span>Go</span></h1>
<p id="ownership">EidoGo is <a href="source.html">Open Source</a>.
&nbsp;Maintained by <a href="http://tin.nu/">Justin Kramer</a>.</p>
<ul id="links">
<li><a href="/eidogo/kjd">Joseki Tutor</a></li>
<li><a href="/eidogo/gnugo">GNU Go</a>
<li><a href="/eidogo/blank">Blank Board</a></li>
<li><a href="/eidogo/upload">Upload</a></li>
<li><a href="/eidogo/games">Game Archive</a></li>
<li><a href="/eidogo/search">Pattern Search</a></li>
<li><a href="http://senseis.xmp.net/?EidoGo">Info</a></li>
</ul>
</div>
<div id="content">
<div id="player-container"></div>
</div>
</div>
</body>
</html>
View
@@ -41,6 +41,17 @@ eidogo.GameNode.prototype = {
this[property] = value;
}
},
pushProperty: function(property, value) {
if (this.reserved.contains(property)) return;
if (this[property]) {
if (!(this[property] instanceof Array)) {
this[property] = [this[property]];
}
this[property].push(value);
} else {
this[property] = value;
}
},
loadJson: function(jsonNode) {
for (var propName in jsonNode) {
this.setProperty(propName, jsonNode[propName]);
@@ -111,6 +122,35 @@ eidogo.GameTree.prototype = {
tree.parent = this;
this.trees.push(tree);
},
// creates a variation tree at the given node position
createVariationTree: function(nodePos) {
var posNode = this.nodes[nodePos];
var preNodes = [];
var len = posNode.parent.nodes.length;
var i;
for (i = 0; i < len; i++) {
var n = posNode.parent.nodes[i];
preNodes.push(n);
if (n.id == posNode.id) {
n.nextSibling = null;
break;
}
}
var mainlineTree = new eidogo.GameTree();
i++;
posNode.parent.nodes[i].previousSibling = null;
var postNodes = [];
for (; i < len; i++) {
var n = posNode.parent.nodes[i];
n.parent = mainlineTree;
postNodes.push(n);
}
mainlineTree.nodes = postNodes;
mainlineTree.trees = posNode.parent.trees;
posNode.parent.nodes = preNodes;
posNode.parent.trees = [];
posNode.parent.appendTree(mainlineTree);
},
loadJson: function(jsonTree) {
for (var i = 0; i < jsonTree.nodes.length; i++) {
this.appendNode(new eidogo.GameNode(jsonTree.nodes[i]));
View
@@ -13,8 +13,23 @@ if (typeof eidogo.i18n == "undefined") {
eidogo.i18n = {
'move': 'Move',
'loading': 'Loading',
'variations': 'Variations',
'no variations': 'none',
'tool': 'Tool',
'play': 'Play',
'region': 'Select Region',
'add_b': 'Black Stone',
'add_w': 'White Stone',
'triangle': 'Triangle',
'square': 'Square',
'circle': 'Circle',
'x': 'X',
'letter': 'Letter',
'number': 'Number',
'search': 'Search for Pattern',
'captures': 'captures',
'game': 'Game',
Oops, something went wrong.

0 comments on commit 71d13bd

Please sign in to comment.