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

Commit

Permalink
Add .gitattributes and normalize line-endings
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul van Brenk committed Jun 22, 2015
1 parent e5af812 commit 4dfe0a0
Show file tree
Hide file tree
Showing 72 changed files with 25,090 additions and 25,079 deletions.
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Auto detect text files and perform EOL normalization
* text=auto

# Custom
*.ts text
*.jade text
*.md text
*.js text
*.sln text eol=crlf
*.csproj text eol=crlf
*.jsproj text eol=crlf
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Contributing
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.

New samples will not be accepted at this time.

## Legal
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.

## Contributing
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.

New samples will not be accepted at this time.

## Legal
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.

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.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# TypeScript Samples

# TypeScript Samples

Samples for TypeScript
10 changes: 5 additions & 5 deletions amd/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import model = require("greeter")

var el = document.getElementById('content');
var greeter = new model.Greeter(el);
greeter.start();
import model = require("greeter")

var el = document.getElementById('content');
var greeter = new model.Greeter(el);
greeter.start();
50 changes: 25 additions & 25 deletions amd/greeter.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
export class Greeter
{
element: HTMLElement;
span: HTMLElement;
timerToken: number;

constructor (element: HTMLElement)
{
this.element = element;
this.element.innerText += "The time is: ";
this.span = document.createElement('span');
this.element.appendChild(this.span);
this.span.innerText = new Date().toUTCString();
}

start()
{
this.timerToken = setInterval(() => this.span.innerText = new Date().toUTCString(), 500);
}

stop()
{
clearTimeout(this.timerToken);
}
}
export class Greeter
{
element: HTMLElement;
span: HTMLElement;
timerToken: number;

constructor (element: HTMLElement)
{
this.element = element;
this.element.innerText += "The time is: ";
this.span = document.createElement('span');
this.element.appendChild(this.span);
this.span.innerText = new Date().toUTCString();
}

start()
{
this.timerToken = setInterval(() => this.span.innerText = new Date().toUTCString(), 500);
}

stop()
{
clearTimeout(this.timerToken);
}
}
140 changes: 70 additions & 70 deletions buildall.cmd
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
@echo off & setlocal EnableDelayedExpansion

if "%1"=="" (
goto :Help
)

goto :Start


:Help
Echo **********************************************************
Echo Usage:
Echo buildall.cmd tscPath
Echo Example:
Echo buildall c:\typescript\built\local\tsc.js
Echo **********************************************************
goto :Done


:Start
set tscPath=%1
set CURRENTDIR=%~dp0

call :buildProject "amd" "--sourcemap --module amd %CURRENTDIR%amd\app.ts"
call :buildProject "d3" "--sourcemap %CURRENTDIR%d3\data.ts"
call :buildProject "greeter" "--sourcemap %CURRENTDIR%greeter\greeter.ts"
call :buildProject "imageboard" "--sourcemap --module commonjs %CURRENTDIR%imageboard\app.ts"
call :buildProject "interfaces" "--sourcemap %CURRENTDIR%interfaces\interfaces.ts"
call :buildProject "jquery" "--sourcemap --target ES5 %CURRENTDIR%jquery\parallax.ts"
call :buildProject "mankala" "Driver.ts --sourcemap -out %CURRENTDIR%mankalagame.js"
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\HttpServer.ts"
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\TcpServer.ts"
call :buildProject "raytracer" "--sourcemap %CURRENTDIR%raytracer\raytracer.ts"
call :buildProject "simple" "--sourcemap %CURRENTDIR%simple\animals.ts"
call :buildProject "todomvc" "--sourcemap %CURRENTDIR%todomvc\js\todos.ts"
call :buildProject "warship" "--sourcemap --target ES5 %CURRENTDIR%warship\warship.ts"

goto :Done

:buildProject
pushd %CURRENTDIR%%~1
echo Running %~1 using node...

echo on
call node "%tscPath%" %~2
echo off

if not %errorlevel%==0 (
echo Failed!
) else (
echo Done.
)

echo Running %~1 using cscript...

echo on
call cscript /nologo "%tscPath%" %~2
echo off

if not %errorlevel%==0 (
echo Failed!
) else (
echo Done.
)

popd
goto :eof


:Done
@echo off & setlocal EnableDelayedExpansion

if "%1"=="" (
goto :Help
)

goto :Start


:Help
Echo **********************************************************
Echo Usage:
Echo buildall.cmd tscPath
Echo Example:
Echo buildall c:\typescript\built\local\tsc.js
Echo **********************************************************
goto :Done


:Start
set tscPath=%1
set CURRENTDIR=%~dp0

call :buildProject "amd" "--sourcemap --module amd %CURRENTDIR%amd\app.ts"
call :buildProject "d3" "--sourcemap %CURRENTDIR%d3\data.ts"
call :buildProject "greeter" "--sourcemap %CURRENTDIR%greeter\greeter.ts"
call :buildProject "imageboard" "--sourcemap --module commonjs %CURRENTDIR%imageboard\app.ts"
call :buildProject "interfaces" "--sourcemap %CURRENTDIR%interfaces\interfaces.ts"
call :buildProject "jquery" "--sourcemap --target ES5 %CURRENTDIR%jquery\parallax.ts"
call :buildProject "mankala" "Driver.ts --sourcemap -out %CURRENTDIR%mankalagame.js"
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\HttpServer.ts"
call :buildProject "node" "--sourcemap --module commonjs %CURRENTDIR%node\TcpServer.ts"
call :buildProject "raytracer" "--sourcemap %CURRENTDIR%raytracer\raytracer.ts"
call :buildProject "simple" "--sourcemap %CURRENTDIR%simple\animals.ts"
call :buildProject "todomvc" "--sourcemap %CURRENTDIR%todomvc\js\todos.ts"
call :buildProject "warship" "--sourcemap --target ES5 %CURRENTDIR%warship\warship.ts"

goto :Done

:buildProject
pushd %CURRENTDIR%%~1
echo Running %~1 using node...

echo on
call node "%tscPath%" %~2
echo off

if not %errorlevel%==0 (
echo Failed!
) else (
echo Done.
)

echo Running %~1 using cscript...

echo on
call cscript /nologo "%tscPath%" %~2
echo off

if not %errorlevel%==0 (
echo Failed!
) else (
echo Done.
)

popd
goto :eof


:Done
ENDLOCAL
Loading

0 comments on commit 4dfe0a0

Please sign in to comment.