Skip to content

Commit 9163d1c

Browse files
committed
first working version
1 parent f258dd5 commit 9163d1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3673
-2
lines changed

Chess/HistoryComponent.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div style="height:520px;overflow-y:auto;overflow-x:hidden;width:220px" class="row">
1+
<div style="height:430px;overflow-y:auto;overflow-x:hidden;width:220px" class="row">
22
<div *ng-for="#move of moveHistory();" class="col-md-6">
33
{{move}}
44
</div>

Chess/README.MD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# ExploringAngular / Chess
22

3-
This is going to be a chess game using AngularJS 2.0. Currently, it's only the nucleus of such a game.
3+
This is a chess game using AngularJS 2.0 with a slightly buggy chess engine.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<div class="container">
2+
<div class="row">
3+
<div class="col-md-12">
4+
<h1>AngularJS 2.0 plays Chess!</h1>
5+
</div>
6+
</div>
7+
<div class="row">
8+
<div class="col-md-8">
9+
<div class="panel panel-primary">
10+
<div class="panel-heading">
11+
<h3 class="panel-title">{{title}}</h3>
12+
</div>
13+
<div class="panel-body">
14+
<div class="row">
15+
<div class="col-md-9">
16+
<chessboard></chessboard>
17+
<br />
18+
<button type="button" class="btn btn-primary" (click)="suggestMove()">Suggest move</button>
19+
<button type="button" class="btn btn-primary" (click)="turnSides()">Turn sides</button>
20+
<button type="button" class="btn btn-danger" (click)="revertLastMove()">Revert last move</button>
21+
</div>
22+
23+
<div class="col-md-3">
24+
<captured-pieces />
25+
</div>
26+
</div>
27+
</div>
28+
</div>
29+
</div>
30+
31+
<div class="col-md-4">
32+
<div class="panel panel-primary">
33+
<div class="panel-heading">
34+
<h3 class="panel-title">Suggested move</h3>
35+
</div>
36+
<div class="panel-body">
37+
{{suggestedMoveText}}
38+
</div>
39+
</div>
40+
41+
<div class="panel panel-primary">
42+
<div class="panel-heading">
43+
<h3 class="panel-title">History</h3>
44+
</div>
45+
<div class="panel-body">
46+
<history></history>
47+
</div>
48+
</div>
49+
</div>
50+
</div>
51+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div style="height:520px;overflow-y:auto">
2+
<img *ng-for="#piece of capturedPiecesFilenames();" src="{{piece}}" style="height:60px; width:60px" />
3+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div *ng-for="#row of fields; var rowindex=index" style="width: 630px; height: 52px; overflow: hidden;" >
2+
<field *ng-for="#col of row; var colindex=index" [row]=rowindex [col]=colindex [piece]=col >
3+
</div>
4+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
3+
4+
<!-- index.html -->
5+
<html>
6+
<head>
7+
<title>AngularJS 2.0 learns to play chess!</title>
8+
<script src="https://github.jspm.io/jmcriffey/[email protected]/traceur-runtime.js"></script>
9+
<script src="https://jspm.io/[email protected]"></script>
10+
<script src="https://code.angularjs.org/2.0.0-alpha.36/angular2.dev.js"></script>
11+
<link rel="stylesheet" href="chess.css"/>
12+
</head>
13+
<body>
14+
<tabapplication>
15+
</tabapplication>
16+
<script>System.import('tab0');</script>
17+
</body>
18+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a pane.<br />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is an example of a tab strip.</br>

Step 05 First Working Version/DI-Example/tab0.js

+56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Step 05 First Working Version/DI-Example/tab0.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/// <reference path="typings/angular2/angular2.d.ts" />
2+
import {Component, View, bootstrap} from 'angular2/angular2';
3+
//import {Inject} from 'angular2/di';
4+
5+
@Component({selector: 'tab'})
6+
@View({templateUrl: 'tab.html'})
7+
class Tab {
8+
addPane(pane) { }
9+
constructor() {
10+
console.log("new tab")
11+
}
12+
}
13+
14+
@Component({selector: 'pane'})
15+
@View({templateUrl: 'pane.html'})
16+
class Pane {
17+
title: String;
18+
constructor(tab:Tab) {
19+
console.log("new pane" + this.title)
20+
console.log("Mit Tab" + tab)
21+
}
22+
}
23+
24+
25+
// Annotation section
26+
@Component({
27+
selector: 'tabapplication'
28+
29+
})
30+
@View({
31+
templateUrl: 'tabapplication.html',
32+
directives: [Tab, Pane]
33+
})
34+
// Component controller
35+
class TabApplicationComponent {
36+
}
37+
38+
39+
40+
41+
console.log("Vor Bootsstrap")
42+
bootstrap(TabApplicationComponent);
43+
console.log("nachBS")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
rrr<tab>
3+
<pane title="one"></pane>
4+
<pane title="two"></pane>
5+
<pane title="two"></pane>
6+
</tab>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<div style="position: relative; left: 0px; top: 0px; width: 54px; height: 54px;margin-right:-6px; margin-bottom:-6px; display: inline-block" >
2+
<div style="position: relative; top: 0px; left: 0px" >
3+
<img class="{{borderClass(row,col)}}" src="{{backgroundFileName(row,col)}}" />
4+
</div>
5+
<div style="position: absolute; top: 0px; left: 0px;">
6+
<img style="width:52px;height:52px" src="{{fileName(piece)}}"
7+
(dragstart)="ondragstart(row, col)"
8+
(dragover)="ondragover(row, col)"
9+
(drop)="ondragdrop(row, col)"
10+
(click)="onclick(row, col)"
11+
/>
12+
</div>
13+
<!--
14+
<div style="position: absolute; top: 0px; left: 0px" >
15+
{{ownThreats(row, col)}} / {{opponentThreats(row, col)}}
16+
</div>
17+
-->
18+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div style="height:430px;overflow-y:auto;overflow-x:hidden;width:220px" class="row">
2+
<div *ng-for="#move of moveHistory();" class="col-md-6">
3+
{{move}}
4+
</div>
5+
</div>

0 commit comments

Comments
 (0)