Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 5ae81de

Browse files
committed
Merge pull request #23 from Microsoft/eol
Add .gitattributes and normalize line-endings
2 parents e5af812 + 35cd404 commit 5ae81de

Some content is hidden

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

72 files changed

+25091
-25079
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Auto detect text files and perform EOL normalization
2+
* text=auto
3+
4+
# Custom
5+
*.ts text
6+
*.jade text
7+
*.md text
8+
*.js text
9+
*.cmd text eol=crlf
10+
*.sln text eol=crlf
11+
*.csproj text eol=crlf
12+
*.jsproj text eol=crlf

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## Contributing
2-
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you’ve submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
3-
4-
New samples will not be accepted at this time.
5-
6-
## Legal
7-
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project’s license, and that the work being submitted is under appropriate copyright.
8-
1+
## Contributing
2+
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you’ve submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
3+
4+
New samples will not be accepted at this time.
5+
6+
## Legal
7+
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project’s license, and that the work being submitted is under appropriate copyright.
8+
99
Please submit a Contributor License Agreement (CLA) before submitting a pull request. Download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we’ll review the request. Please note that we’re currently only accepting pull requests of bug fixes rather than new features.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# TypeScript Samples
2-
1+
# TypeScript Samples
2+
33
Samples for TypeScript

amd/app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import model = require("greeter")
2-
3-
var el = document.getElementById('content');
4-
var greeter = new model.Greeter(el);
5-
greeter.start();
1+
import model = require("greeter")
2+
3+
var el = document.getElementById('content');
4+
var greeter = new model.Greeter(el);
5+
greeter.start();

amd/greeter.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
export class Greeter
2-
{
3-
element: HTMLElement;
4-
span: HTMLElement;
5-
timerToken: number;
6-
7-
constructor (element: HTMLElement)
8-
{
9-
this.element = element;
10-
this.element.innerText += "The time is: ";
11-
this.span = document.createElement('span');
12-
this.element.appendChild(this.span);
13-
this.span.innerText = new Date().toUTCString();
14-
}
15-
16-
start()
17-
{
18-
this.timerToken = setInterval(() => this.span.innerText = new Date().toUTCString(), 500);
19-
}
20-
21-
stop()
22-
{
23-
clearTimeout(this.timerToken);
24-
}
25-
}
1+
export class Greeter
2+
{
3+
element: HTMLElement;
4+
span: HTMLElement;
5+
timerToken: number;
6+
7+
constructor (element: HTMLElement)
8+
{
9+
this.element = element;
10+
this.element.innerText += "The time is: ";
11+
this.span = document.createElement('span');
12+
this.element.appendChild(this.span);
13+
this.span.innerText = new Date().toUTCString();
14+
}
15+
16+
start()
17+
{
18+
this.timerToken = setInterval(() => this.span.innerText = new Date().toUTCString(), 500);
19+
}
20+
21+
stop()
22+
{
23+
clearTimeout(this.timerToken);
24+
}
25+
}

buildall.cmd

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
@echo off & setlocal EnableDelayedExpansion
2-
3-
if "%1"=="" (
4-
goto :Help
5-
)
6-
7-
goto :Start
8-
9-
10-
:Help
11-
Echo **********************************************************
12-
Echo Usage:
13-
Echo buildall.cmd tscPath
14-
Echo Example:
15-
Echo buildall c:\typescript\built\local\tsc.js
16-
Echo **********************************************************
17-
goto :Done
18-
19-
20-
:Start
21-
set tscPath=%1
22-
set CURRENTDIR=%~dp0
23-
24-
call :buildProject "amd" "--sourcemap --module amd %CURRENTDIR%amd\app.ts"
25-
call :buildProject "d3" "--sourcemap %CURRENTDIR%d3\data.ts"
26-
call :buildProject "greeter" "--sourcemap %CURRENTDIR%greeter\greeter.ts"
27-
call :buildProject "imageboard" "--sourcemap --module commonjs %CURRENTDIR%imageboard\app.ts"
28-
call :buildProject "interfaces" "--sourcemap %CURRENTDIR%interfaces\interfaces.ts"
29-
call :buildProject "jquery" "--sourcemap --target ES5 %CURRENTDIR%jquery\parallax.ts"
30-
call :buildProject "mankala" "Driver.ts --sourcemap -out %CURRENTDIR%mankalagame.js"
31-
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\HttpServer.ts"
32-
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\TcpServer.ts"
33-
call :buildProject "raytracer" "--sourcemap %CURRENTDIR%raytracer\raytracer.ts"
34-
call :buildProject "simple" "--sourcemap %CURRENTDIR%simple\animals.ts"
35-
call :buildProject "todomvc" "--sourcemap %CURRENTDIR%todomvc\js\todos.ts"
36-
call :buildProject "warship" "--sourcemap --target ES5 %CURRENTDIR%warship\warship.ts"
37-
38-
goto :Done
39-
40-
:buildProject
41-
pushd %CURRENTDIR%%~1
42-
echo Running %~1 using node...
43-
44-
echo on
45-
call node "%tscPath%" %~2
46-
echo off
47-
48-
if not %errorlevel%==0 (
49-
echo Failed!
50-
) else (
51-
echo Done.
52-
)
53-
54-
echo Running %~1 using cscript...
55-
56-
echo on
57-
call cscript /nologo "%tscPath%" %~2
58-
echo off
59-
60-
if not %errorlevel%==0 (
61-
echo Failed!
62-
) else (
63-
echo Done.
64-
)
65-
66-
popd
67-
goto :eof
68-
69-
70-
:Done
1+
@echo off & setlocal EnableDelayedExpansion
2+
3+
if "%1"=="" (
4+
goto :Help
5+
)
6+
7+
goto :Start
8+
9+
10+
:Help
11+
Echo **********************************************************
12+
Echo Usage:
13+
Echo buildall.cmd tscPath
14+
Echo Example:
15+
Echo buildall c:\typescript\built\local\tsc.js
16+
Echo **********************************************************
17+
goto :Done
18+
19+
20+
:Start
21+
set tscPath=%1
22+
set CURRENTDIR=%~dp0
23+
24+
call :buildProject "amd" "--sourcemap --module amd %CURRENTDIR%amd\app.ts"
25+
call :buildProject "d3" "--sourcemap %CURRENTDIR%d3\data.ts"
26+
call :buildProject "greeter" "--sourcemap %CURRENTDIR%greeter\greeter.ts"
27+
call :buildProject "imageboard" "--sourcemap --module commonjs %CURRENTDIR%imageboard\app.ts"
28+
call :buildProject "interfaces" "--sourcemap %CURRENTDIR%interfaces\interfaces.ts"
29+
call :buildProject "jquery" "--sourcemap --target ES5 %CURRENTDIR%jquery\parallax.ts"
30+
call :buildProject "mankala" "Driver.ts --sourcemap -out %CURRENTDIR%mankalagame.js"
31+
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\HttpServer.ts"
32+
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\TcpServer.ts"
33+
call :buildProject "raytracer" "--sourcemap %CURRENTDIR%raytracer\raytracer.ts"
34+
call :buildProject "simple" "--sourcemap %CURRENTDIR%simple\animals.ts"
35+
call :buildProject "todomvc" "--sourcemap %CURRENTDIR%todomvc\js\todos.ts"
36+
call :buildProject "warship" "--sourcemap --target ES5 %CURRENTDIR%warship\warship.ts"
37+
38+
goto :Done
39+
40+
:buildProject
41+
pushd %CURRENTDIR%%~1
42+
echo Running %~1 using node...
43+
44+
echo on
45+
call node "%tscPath%" %~2
46+
echo off
47+
48+
if not %errorlevel%==0 (
49+
echo Failed!
50+
) else (
51+
echo Done.
52+
)
53+
54+
echo Running %~1 using cscript...
55+
56+
echo on
57+
call cscript /nologo "%tscPath%" %~2
58+
echo off
59+
60+
if not %errorlevel%==0 (
61+
echo Failed!
62+
) else (
63+
echo Done.
64+
)
65+
66+
popd
67+
goto :eof
68+
69+
70+
:Done
7171
ENDLOCAL

0 commit comments

Comments
 (0)