Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Feb 7, 2012
0 parents commit 0f61f35
Show file tree
Hide file tree
Showing 126 changed files with 6,860 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Demo/Default.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="utf-8" />
<title>Testing out my orange bits extension</title>
<link rel="stylesheet" type="text/css" href="lessTest.css" />
<link rel="stylesheet" type="text/css" href="sassTest.css" />
<link rel="stylesheet" type="text/css" href="scssTest.css" />
</head>
<body>
<div class="lessBox">Here is a box styled using less</div>
<div class="sassBox">Here is a box styled using sass</div>
<div class="scssBox">Here is a box styled using scss</div>
<div class="coffeeBox">You can't explain this</div>
<script type="text/javascript" src="coffeeScriptTest.js"></script>
</body>
</html>
Binary file added Demo/bin/Microsoft.Web.Infrastructure.dll
Binary file not shown.
Binary file added Demo/bin/NuGet.Core.dll
Binary file not shown.
Binary file added Demo/bin/System.Web.Helpers.dll
Binary file not shown.
Binary file added Demo/bin/System.Web.Razor.dll
Binary file not shown.
Binary file added Demo/bin/System.Web.WebPages.Administration.dll
Binary file not shown.
Binary file added Demo/bin/System.Web.WebPages.Deployment.dll
Binary file not shown.
Binary file added Demo/bin/System.Web.WebPages.Razor.dll
Binary file not shown.
Binary file added Demo/bin/System.Web.WebPages.dll
Binary file not shown.
Binary file added Demo/bin/WebMatrix.Data.dll
Binary file not shown.
Binary file added Demo/bin/WebMatrix.Security.dll
Binary file not shown.
Binary file added Demo/bin/WebMatrix.WebData.dll
Binary file not shown.
36 changes: 36 additions & 0 deletions Demo/coffeeScriptTest.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Assignment:
number = 42
opposite = true

# Conditions:
number = -42 if opposite

# Functions:
square = (x) -> x * x

# Arrays:
list = [1, 2, 3, 4, 5]

# Objects:
math =
root: Math.sqrt
square: square
cube: (x) -> x * square x

# Splats:
race = (winner, runners...) ->
print winner, runners

# Existence:
alert "I knew it!" if elvis?

# Array comprehensions:
cubes = (math.cube num for num in list)


# show off some coffee in the browser test
setTimeout(() ->
document.getElementsByClassName('coffeeBox')[0].innerHTML = 'hello from the world of coffeeScript!!!'
, 1500);


20 changes: 20 additions & 0 deletions Demo/lessTest.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@green: #00FF00;
@margin: 16px;

@purple: #7D26CD;

.lessBox {
background-color: lighten(@green, 45%);
border-color: @green;
color: darken(@green, 9%);
padding: @margin / 2;
margin: @margin / 2;
}

.coffeeBox {
background-color: lighten(@purple, 35%);
border-color: @purple;
color: darken(@purple, 12%);
padding: @margin / 2;
margin: @margin / 2;
}
Binary file added Demo/orderedListThree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Demo/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# This file can be used to affect how search engines and other web site crawlers see your site.
# For more information, please see http://www.w3.org/TR/html4/appendix/notes.html#h-B.4.1.1
# WebMatrix 2.0

6 changes: 6 additions & 0 deletions Demo/sassTest.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.sassBox {
background-color: #caeef2;
border-color: #3bbfce;
color: #2ca2af;
padding: 8px;
margin: 8px; }
11 changes: 11 additions & 0 deletions Demo/sassTest.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$blue: #3bbfce
$margin: 16px

.sassBox
background-color: lighten($blue, 35%)
border-color: $blue
color: darken($blue, 9%)
padding: $margin / 2
margin: $margin / 2


10 changes: 10 additions & 0 deletions Demo/scssTest.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
$red: #FF0000;
$margin: 16px;

.scssBox {
background-color: lighten($red, 45%);
border-color: $red;
color: darken($red, 9%);
padding: $margin / 2;
margin: $margin / 2;
}
10 changes: 10 additions & 0 deletions Local.testsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="Local" id="8a8bbe6e-a5e9-4f47-8ba5-02fa60cdc921" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>These are default test settings for a local test run.</Description>
<Deployment enabled="false" />
<Execution>
<TestTypeSpecific />
<AgentRule name="Execution Agents">
</AgentRule>
</Execution>
</TestSettings>
36 changes: 36 additions & 0 deletions OrangeBits.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrangeBits", "OrangeBits\OrangeBits.csproj", "{A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{119BE45C-0AB9-444C-939C-AF68E22E1895}"
ProjectSection(SolutionItems) = preProject
Local.testsettings = Local.testsettings
OrangeBits.vsmdi = OrangeBits.vsmdi
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
EndProjectSection
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = OrangeBits.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A93FE0DC-E26F-4145-B3E3-283DF9B2FE77}.Release|Any CPU.Build.0 = Release|Any CPU
{4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C102372-8D0A-47B4-BDB8-AC9E1EC9550A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added OrangeBits.suo
Binary file not shown.
6 changes: 6 additions & 0 deletions OrangeBits.vsmdi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="8a8bbe6e-a5e9-4f47-8ba5-02fa60cdc921" name="Local" storage="local.testsettings" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
</TestLists>
12 changes: 12 additions & 0 deletions OrangeBits/Compilers/BaseCompiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrangeBits.Compilers
{
public class BaseCompiler
{

}
}
29 changes: 29 additions & 0 deletions OrangeBits/Compilers/CoffeeCompiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using SassAndCoffee.Core;
using SassAndCoffee.Core.CoffeeScript;
using SassAndCoffee.Core.Pipeline;
using SassAndCoffee.Core.Pooling;

namespace OrangeBits.Compilers
{
public class CoffeeCompiler : ICompiler
{
public void Compile(string inPath, string outPath)
{
SassAndCoffee.Core.CoffeeScript.CoffeeScriptCompiler compiler = new CoffeeScriptCompiler(new InstanceProvider<IJavaScriptRuntime>(() => new IEJavaScriptRuntime()));
using (StreamReader sr = new StreamReader(inPath))
{
string content = sr.ReadToEnd();
string output = compiler.Compile(content);
using (StreamWriter sw = new StreamWriter(outPath))
{
sw.Write(output);
}
}
}
}
}
33 changes: 33 additions & 0 deletions OrangeBits/Compilers/CompileResults.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrangeBits.Compilers
{
/// <summary>
/// basic structure to store results of a compilation
/// </summary>
public class CompileResults
{
/// <summary>
/// notes the compilation was successful
/// </summary>
public bool Success { get; set; }

/// <summary>
/// notes if the new file was created for the first time
/// </summary>
public bool IsNewFile { get; set; }

/// <summary>
/// original source input file path
/// </summary>
public string InputPath { get; set; }

/// <summary>
/// new compiled output file path
/// </summary>
public string OutputPath { get; set; }
}
}
12 changes: 12 additions & 0 deletions OrangeBits/Compilers/ICompiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OrangeBits.Compilers
{
interface ICompiler
{
void Compile(string inPath, string outPath);
}
}
37 changes: 37 additions & 0 deletions OrangeBits/Compilers/LessCompiler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.ComponentModel;
using System.Collections.Specialized;
using System.IO;

using dotless.Core;

namespace OrangeBits.Compilers
{
/// <summary>
///
/// </summary>
public class LessCompiler : ICompiler
{
/// <summary>
///
/// </summary>
/// <param name="inPath"></param>
/// <param name="outPath"></param>
public void Compile(string inPath, string outPath)
{
using (StreamReader sr = new StreamReader(inPath))
{
string content = sr.ReadToEnd();
string output = Less.Parse(content);
using (StreamWriter sw = new StreamWriter(outPath))
{
sw.Write(output);
}
}
}
}
}
Loading

0 comments on commit 0f61f35

Please sign in to comment.