Browse files

WinLess 1.6.0:

Changed WinLess to do the compiling via less.js via Node
  • Loading branch information...
1 parent 1227b4f commit ed5d99b71914d8a9bbd5edfdf3ace9375c10f03e @marklagendijk committed Nov 27, 2012
Showing with 12,684 additions and 651 deletions.
  1. +4 −4 Installer/WinLess.warsetup
  2. +1 −30 WinLess/Forms/aboutForm.cs
  3. +1 −1 WinLess/Forms/mainForm.Designer.cs
  4. +16 −13 WinLess/Forms/mainForm.cs
  5. +0 −92 WinLess/Less/Compiler.cs
  6. +0 −9 WinLess/Less/less.js
  7. +0 −2 WinLess/Less/lessc.cmd
  8. +0 −206 WinLess/Less/lessc.wsf
  9. +109 −0 WinLess/LessCompiler.cs
  10. +2 −2 WinLess/Models/{CommandLineArguments.cs → CommandArguments.cs}
  11. +8 −7 WinLess/Models/{CompileResult.cs → CommandResult.cs}
  12. +26 −0 WinLess/Models/CompileCommandResult.cs
  13. +1 −2 WinLess/Models/File.cs
  14. +1 −1 WinLess/Program.cs
  15. +2 −2 WinLess/Properties/AssemblyInfo.cs
  16. +0 −10 WinLess/Properties/DataSources/winless.Models.CompileResult.datasource
  17. +0 −10 WinLess/Properties/DataSources/winless.Models.Directory.datasource
  18. +0 −10 WinLess/Properties/DataSources/winless.Models.File.datasource
  19. +0 −63 WinLess/Properties/Resources.Designer.cs
  20. +0 −117 WinLess/Properties/Resources.resx
  21. +0 −26 WinLess/Properties/Settings.Designer.cs
  22. +0 −7 WinLess/Properties/Settings.settings
  23. +1 −1 WinLess/SingleInstanceController.cs
  24. +179 −36 WinLess/WinLess.csproj
  25. +15 −0 WinLess/node_modules/.bin/lessc
  26. +6 −0 WinLess/node_modules/.bin/lessc.cmd
  27. BIN WinLess/node_modules/.bin/node.exe
  28. +5 −0 WinLess/node_modules/less/.npmignore
  29. +49 −0 WinLess/node_modules/less/CHANGELOG.md
  30. +179 −0 WinLess/node_modules/less/LICENSE
  31. +76 −0 WinLess/node_modules/less/Makefile
  32. +20 −0 WinLess/node_modules/less/README.md
  33. +3,979 −0 WinLess/node_modules/less/benchmark/benchmark.less
  34. +47 −0 WinLess/node_modules/less/benchmark/less-benchmark.js
  35. +394 −0 WinLess/node_modules/less/lib/less/browser.js
  36. +152 −0 WinLess/node_modules/less/lib/less/colors.js
  37. +355 −0 WinLess/node_modules/less/lib/less/cssmin.js
  38. +337 −0 WinLess/node_modules/less/lib/less/functions.js
  39. +140 −0 WinLess/node_modules/less/lib/less/index.js
  40. +59 −0 WinLess/node_modules/less/lib/less/lessc_helper.js
  41. +1,445 −0 WinLess/node_modules/less/lib/less/parser.js
  42. +123 −0 WinLess/node_modules/less/lib/less/rhino.js
  43. +43 −0 WinLess/node_modules/less/lib/less/tree.js
  44. +17 −0 WinLess/node_modules/less/lib/less/tree/alpha.js
  45. +27 −0 WinLess/node_modules/less/lib/less/tree/anonymous.js
  46. +19 −0 WinLess/node_modules/less/lib/less/tree/assignment.js
  47. +48 −0 WinLess/node_modules/less/lib/less/tree/call.js
  48. +111 −0 WinLess/node_modules/less/lib/less/tree/color.js
  49. +14 −0 WinLess/node_modules/less/lib/less/tree/comment.js
  50. +42 −0 WinLess/node_modules/less/lib/less/tree/condition.js
  51. +49 −0 WinLess/node_modules/less/lib/less/tree/dimension.js
  52. +39 −0 WinLess/node_modules/less/lib/less/tree/directive.js
  53. +48 −0 WinLess/node_modules/less/lib/less/tree/element.js
  54. +23 −0 WinLess/node_modules/less/lib/less/tree/expression.js
  55. +83 −0 WinLess/node_modules/less/lib/less/tree/import.js
  56. +51 −0 WinLess/node_modules/less/lib/less/tree/javascript.js
  57. +19 −0 WinLess/node_modules/less/lib/less/tree/keyword.js
  58. +123 −0 WinLess/node_modules/less/lib/less/tree/media.js
  59. +146 −0 WinLess/node_modules/less/lib/less/tree/mixin.js
  60. +32 −0 WinLess/node_modules/less/lib/less/tree/operation.js
  61. +16 −0 WinLess/node_modules/less/lib/less/tree/paren.js
  62. +43 −0 WinLess/node_modules/less/lib/less/tree/quoted.js
  63. +13 −0 WinLess/node_modules/less/lib/less/tree/ratio.js
  64. +42 −0 WinLess/node_modules/less/lib/less/tree/rule.js
  65. +374 −0 WinLess/node_modules/less/lib/less/tree/ruleset.js
  66. +47 −0 WinLess/node_modules/less/lib/less/tree/selector.js
  67. +23 −0 WinLess/node_modules/less/lib/less/tree/url.js
  68. +24 −0 WinLess/node_modules/less/lib/less/tree/value.js
  69. +26 −0 WinLess/node_modules/less/lib/less/tree/variable.js
  70. +37 −0 WinLess/node_modules/less/package.json
  71. +77 −0 WinLess/node_modules/less/test/css/colors.css
  72. +56 −0 WinLess/node_modules/less/test/css/comments.css
  73. +98 −0 WinLess/node_modules/less/test/css/css-3.css
  74. +24 −0 WinLess/node_modules/less/test/css/css-escapes.css
  75. +100 −0 WinLess/node_modules/less/test/css/css.css
  76. +92 −0 WinLess/node_modules/less/test/css/functions.css
  77. +9 −0 WinLess/node_modules/less/test/css/ie-filters.css
  78. +6 −0 WinLess/node_modules/less/test/css/import-once.css
  79. +23 −0 WinLess/node_modules/less/test/css/import.css
  80. +23 −0 WinLess/node_modules/less/test/css/javascript.css
  81. +3 −0 WinLess/node_modules/less/test/css/lazy-eval.css
  82. +176 −0 WinLess/node_modules/less/test/css/media.css
  83. +74 −0 WinLess/node_modules/less/test/css/mixins-args.css
  84. +9 −0 WinLess/node_modules/less/test/css/mixins-closure.css
  85. +68 −0 WinLess/node_modules/less/test/css/mixins-guards.css
  86. +17 −0 WinLess/node_modules/less/test/css/mixins-important.css
  87. +20 −0 WinLess/node_modules/less/test/css/mixins-named-args.css
  88. +14 −0 WinLess/node_modules/less/test/css/mixins-nested.css
  89. +47 −0 WinLess/node_modules/less/test/css/mixins-pattern.css
  90. +108 −0 WinLess/node_modules/less/test/css/mixins.css
  91. +49 −0 WinLess/node_modules/less/test/css/operations.css
  92. +20 −0 WinLess/node_modules/less/test/css/parens.css
  93. +33 −0 WinLess/node_modules/less/test/css/rulesets.css
  94. +15 −0 WinLess/node_modules/less/test/css/scope.css
  95. +130 −0 WinLess/node_modules/less/test/css/selectors.css
  96. +40 −0 WinLess/node_modules/less/test/css/strings.css
  97. +27 −0 WinLess/node_modules/less/test/css/variables.css
  98. +42 −0 WinLess/node_modules/less/test/css/whitespace.css
  99. +174 −0 WinLess/node_modules/less/test/less-test.js
  100. +88 −0 WinLess/node_modules/less/test/less/colors.less
  101. +65 −0 WinLess/node_modules/less/test/less/comments.less
  102. +108 −0 WinLess/node_modules/less/test/less/css-3.less
  103. +33 −0 WinLess/node_modules/less/test/less/css-escapes.less
  104. +115 −0 WinLess/node_modules/less/test/less/css.less
  105. +1 −0 WinLess/node_modules/less/test/less/errors/comment-in-selector.less
  106. +2 −0 WinLess/node_modules/less/test/less/errors/comment-in-selector.txt
  107. +1 −0 WinLess/node_modules/less/test/less/errors/import-missing.less
  108. +3 −0 WinLess/node_modules/less/test/less/errors/import-missing.txt
  109. +1 −0 WinLess/node_modules/less/test/less/errors/import-no-semi.less
  110. +2 −0 WinLess/node_modules/less/test/less/errors/import-no-semi.txt
  111. +1 −0 WinLess/node_modules/less/test/less/errors/import-subfolder1.less
  112. +3 −0 WinLess/node_modules/less/test/less/errors/import-subfolder1.txt
  113. +1 −0 WinLess/node_modules/less/test/less/errors/import-subfolder2.less
  114. +2 −0 WinLess/node_modules/less/test/less/errors/import-subfolder2.txt
  115. +1 −0 WinLess/node_modules/less/test/less/errors/imports/import-subfolder1.less
  116. +1 −0 WinLess/node_modules/less/test/less/errors/imports/import-subfolder2.less
  117. +1 −0 WinLess/node_modules/less/test/less/errors/imports/subfolder/mixin-not-defined.less
  118. +1 −0 WinLess/node_modules/less/test/less/errors/imports/subfolder/parse-error-curly-bracket.less
  119. +3 −0 WinLess/node_modules/less/test/less/errors/javascript-error.less
  120. +4 −0 WinLess/node_modules/less/test/less/errors/javascript-error.txt
  121. +11 −0 WinLess/node_modules/less/test/less/errors/mixin-not-defined.less
  122. +3 −0 WinLess/node_modules/less/test/less/errors/mixin-not-defined.txt
  123. +1 −0 WinLess/node_modules/less/test/less/errors/parse-error-curly-bracket.less
  124. +2 −0 WinLess/node_modules/less/test/less/errors/parse-error-curly-bracket.txt
  125. +2 −0 WinLess/node_modules/less/test/less/errors/parse-error-missing-bracket.less
  126. +2 −0 WinLess/node_modules/less/test/less/errors/parse-error-missing-bracket.txt
  127. +3 −0 WinLess/node_modules/less/test/less/errors/property-ie5-hack.less
  128. +4 −0 WinLess/node_modules/less/test/less/errors/property-ie5-hack.txt
  129. +101 −0 WinLess/node_modules/less/test/less/functions.less
  130. +15 −0 WinLess/node_modules/less/test/less/ie-filters.less
  131. +3 −0 WinLess/node_modules/less/test/less/import-once.less
  132. +11 −0 WinLess/node_modules/less/test/less/import.less
  133. +1 −0 WinLess/node_modules/less/test/less/import/deeper/import-once-test-a.less
  134. +7 −0 WinLess/node_modules/less/test/less/import/import-once-test-c.less
  135. +2 −0 WinLess/node_modules/less/test/less/import/import-test-a.less
  136. +8 −0 WinLess/node_modules/less/test/less/import/import-test-b.less
  137. +7 −0 WinLess/node_modules/less/test/less/import/import-test-c.less
  138. +1 −0 WinLess/node_modules/less/test/less/import/import-test-d.css
  139. +2 −0 WinLess/node_modules/less/test/less/import/import-test-e.less
  140. +29 −0 WinLess/node_modules/less/test/less/javascript.less
  141. +6 −0 WinLess/node_modules/less/test/less/lazy-eval.less
  142. +179 −0 WinLess/node_modules/less/test/less/media.less
  143. +130 −0 WinLess/node_modules/less/test/less/mixins-args.less
  144. +26 −0 WinLess/node_modules/less/test/less/mixins-closure.less
  145. +113 −0 WinLess/node_modules/less/test/less/mixins-guards.less
  146. +18 −0 WinLess/node_modules/less/test/less/mixins-important.less
  147. +31 −0 WinLess/node_modules/less/test/less/mixins-named-args.less
  148. +22 −0 WinLess/node_modules/less/test/less/mixins-nested.less
  149. +99 −0 WinLess/node_modules/less/test/less/mixins-pattern.less
  150. +93 −0 WinLess/node_modules/less/test/less/mixins.less
  151. +62 −0 WinLess/node_modules/less/test/less/operations.less
  152. +26 −0 WinLess/node_modules/less/test/less/parens.less
  153. +30 −0 WinLess/node_modules/less/test/less/rulesets.less
  154. +32 −0 WinLess/node_modules/less/test/less/scope.less
  155. +131 −0 WinLess/node_modules/less/test/less/selectors.less
  156. +51 −0 WinLess/node_modules/less/test/less/strings.less
  157. +54 −0 WinLess/node_modules/less/test/less/variables.less
  158. +44 −0 WinLess/node_modules/less/test/less/whitespace.less
View
8 Installer/WinLess.warsetup
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
-<WarSetup-Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" projectRunAfterInstall="true" mainTargetApp="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" nextUniqueId="1479" projectName="WinLess" projectUuid="aca1172c-5ac1-45cc-94f9-fb1f3f0eb2be" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.5.4" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.5.4" projectType="0" projectUserInterface="WixUI_Minimal">
+<WarSetup-Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" projectRunAfterInstall="true" mainTargetApp="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" nextUniqueId="1502" projectName="WinLess" projectUuid="eb24e9df-ad8c-4522-977d-776c254f3ab2" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.6.0" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.6.0" projectType="0" projectUserInterface="WixUI_Minimal">
<LicencePaths>
<string>C:\Program Files (x86)\Jgaa's Internet\War Setup\Licenses</string>
</LicencePaths>
<Virgin>false</Virgin>
<projectFeatures featureId="ID4B71809E576219FB04EFDAC6A25F9E27" featureName="WinLess" featureDescription="The complete package" configurableDirectory="APPLICATIONFOLDER" configurableDirectoryDefaultPath="[ProjectName]" enableInDefaultInstall="true" enableInMinimalInstall="true" excludeFromBuild="false">
<childFeatures featureId="PROGRAM" featureName="WinLess" featureDescription="WinLess" enableInDefaultInstall="true" enableInMinimalInstall="true" excludeFromBuild="false">
<components componentId="ID1003" componentGuid="7c4a8889-88bd-4c03-a37e-425202af09a9">
- <componentFiles fileId="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" srcName="winless.exe" srcDirectory="C:\projects\WinLess\WinLess\bin\Release" dstName="WinLess.exe" dstPath="" isTrueTypeFont="false" isComModule="false" typelibGuid="" menuName="WinLess" shortcutInProgramFilesMenu="true" shortcutOnDesktop="false" shortcutInQuickLaunch="false" shortcutInStartupFolder="false" shortcutWorkingDirectory="" shortcutCommandArguments="" shortcutDescription="">
+ <componentFiles fileId="ID_bcbdd185_a875_4976_b079_d9cf83e2ad0e" srcName="winless.exe" srcDirectory="..\WinLess\bin\Release" dstName="WinLess.exe" dstPath="" isTrueTypeFont="false" isComModule="false" typelibGuid="" menuName="WinLess" shortcutInProgramFilesMenu="true" shortcutOnDesktop="false" shortcutInQuickLaunch="false" shortcutInStartupFolder="false" shortcutWorkingDirectory="" shortcutCommandArguments="" shortcutDescription="">
<service StartWhenInstalled="true" Remove="both" id="ID1002" isService="false" userAccount="" userPassword="" cmdLineArguments="" errorControl="normal" interactive="false" loadOrderGroup="" serviceName="" startMode="auto" vital="true" />
</componentFiles>
<addToCreateFolder>false</addToCreateFolder>
@@ -19,8 +19,8 @@
<addToCreateFolder>false</addToCreateFolder>
</components>
<defaultInstallMode>3</defaultInstallMode>
- <directories dirId="ID1356" srcPath="..\WinLess\bin\Release\Less" dstPath="Less" patterns=".*" excludePatterns="" recurse="false" preventEmptyDirectories="false" addToPath="false" ideHeaderFiles="false" ideExecutables="false" ideLibrary="false" ideMicrosoftVisualStudio2003="false" ideMicrosoftVisualStudio2005="false">
- <pathComponent componentId="ID1355" componentGuid="ddc50de7-d493-47a5-b451-07d7ff8476b9">
+ <directories dirId="ID1480" srcPath="..\WinLess\bin\Release\node_modules" dstPath="node_modules" patterns=".*" excludePatterns="" recurse="true" preventEmptyDirectories="false" addToPath="false" ideHeaderFiles="false" ideExecutables="false" ideLibrary="false" ideMicrosoftVisualStudio2003="false" ideMicrosoftVisualStudio2005="false">
+ <pathComponent componentId="ID1479" componentGuid="63432b1f-70e0-444c-86a8-8b4220f89730">
<addToCreateFolder>false</addToCreateFolder>
</pathComponent>
</directories>
View
31 WinLess/Forms/aboutForm.cs
@@ -17,7 +17,7 @@ public aboutForm()
{
InitializeComponent();
winlessVersionLabel.Text = GetApplicationVersion();
- lessjsVersionLabel.Text = GetLessJsVersion();
+ lessjsVersionLabel.Text = LessCompiler.GetVersion();
}
private string GetApplicationVersion()
@@ -27,34 +27,5 @@ private string GetApplicationVersion()
// return the ProductVersion without the last '.0'
return version.Substring(0, version.Length - 2);
}
-
- private string GetLessJsVersion()
- {
- string lessFileName = string.Format("{0}\\Less\\less.js", Application.StartupPath);
-
- // read the less.js file
- string lessFileText = null;
- try
- {
- StreamReader streamReader = new StreamReader(lessFileName);
- lessFileText = streamReader.ReadToEnd();
- streamReader.Close();
- }
- catch (Exception e)
- {
- ExceptionHandler.LogException(e);
- }
-
- // retreive the version number from the text of less.js
- if (!string.IsNullOrEmpty(lessFileText))
- {
- Match versionMatch = Regex.Match(lessFileText, "// LESS - Leaner CSS v(.+)");
- if(versionMatch.Groups.Count > 1){
- return versionMatch.Groups[1].Value;
- }
- }
-
- return "Error while reading version number.";
- }
}
}
View
2 WinLess/Forms/mainForm.Designer.cs
@@ -450,7 +450,7 @@ private void InitializeComponent()
//
// compileResultBindingSource
//
- this.compileResultBindingSource.DataSource = typeof(WinLess.Models.CompileResult);
+ this.compileResultBindingSource.DataSource = typeof(WinLess.Models.CompileCommandResult);
//
// notifyIcon
//
View
29 WinLess/Forms/mainForm.cs
@@ -9,7 +9,6 @@
using System.Diagnostics;
using WinLess.Models;
using WinLess.Helpers;
-using WinLess.Less;
namespace WinLess
{
@@ -24,7 +23,7 @@ public static mainForm ActiveOrInActiveMainForm
}
}
- private delegate void AddCompileResultDelegate(Models.CompileResult result);
+ private delegate void AddCompileResultDelegate(Models.CompileCommandResult result);
private bool finishedLoading;
#region mainForm init and shutdown
@@ -42,15 +41,15 @@ public mainForm()
InitializeComponent();
initFilesDataGridViewCheckAllCheckBox();
foldersListBox.DataSource = Program.Settings.DirectoryList.Directories;
- compileResultsDataGridView.DataSource = new List<Models.CompileResult>();
+ compileResultsDataGridView.DataSource = new List<Models.CompileCommandResult>();
}
catch (Exception e)
{
ExceptionHandler.LogException(e);
}
}
- public void LoadDirectories(CommandLineArguments args)
+ public void LoadDirectories(CommandArguments args)
{
if (args.ClearDirectories)
{
@@ -95,7 +94,7 @@ private void mainForm_Activated(object sender, EventArgs e)
private void mainForm_Load(object sender, EventArgs e)
{
string[] args = Environment.GetCommandLineArgs();
- CommandLineArguments commandLineArgs = new CommandLineArguments(args);
+ CommandArguments commandLineArgs = new CommandArguments(args);
if (commandLineArgs.HasArguments)
{
LoadDirectories(commandLineArgs);
@@ -357,25 +356,29 @@ private void compileToolStripMenuItem_Click(object sender, EventArgs e)
#region compileResultsDataGridView
- public void AddCompileResult(Models.CompileResult result)
+ public void AddCompileResult(Models.CompileCommandResult result)
{
if (InvokeRequired)
{
this.Invoke(new AddCompileResultDelegate(AddCompileResult), new object[] { result });
return;
}
- List<Models.CompileResult> compileResults = (List<Models.CompileResult>)compileResultsDataGridView.DataSource;
+ if (result.IsSuccess){
+ result.ResultText = "success";
+ }
+
+ List<Models.CompileCommandResult> compileResults = (List<Models.CompileCommandResult>)compileResultsDataGridView.DataSource;
compileResults.Insert(0, result);
compileResultsDataGridView_DataChanged();
- if (string.Compare(result.ResultText, "success", StringComparison.InvariantCultureIgnoreCase) != 0)
+ if (result.IsSuccess && Program.Settings.ShowSuccessMessages)
{
- ShowErrorNotification("Compile error", result.ResultText);
+ ShowSuccessNotification("Successful compile", result.ResultText);
}
- else if (Program.Settings.ShowSuccessMessages)
+ else if(!result.IsSuccess)
{
- ShowSuccessNotification("Successful compile", result.FullPath);
+ ShowErrorNotification("Compile error", result.ResultText);
}
}
@@ -390,7 +393,7 @@ private void compileResultsDataGridView_DataChanged()
private void clearCompileResultsButton_Click(object sender, EventArgs e)
{
- compileResultsDataGridView.DataSource = new List<Models.CompileResult>();
+ compileResultsDataGridView.DataSource = new List<Models.CompileCommandResult>();
compileResultsDataGridView_DataChanged();
}
@@ -492,7 +495,7 @@ private void CompileSelectedFiles()
{
if (file.Enabled)
{
- Compiler.CompileLessFile(file.FullPath, file.OutputPath, file.Minify);
+ LessCompiler.CompileLessFile(file.FullPath, file.OutputPath, file.Minify);
}
}
}
View
92 WinLess/Less/Compiler.cs
@@ -1,92 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Windows.Forms;
-using System.IO;
-using WinLess.Models;
-using WinLess.Helpers;
-
-namespace WinLess.Less
-{
- static class Compiler
- {
- public static void CompileLessFile(string lessPath, string cssPath, bool minify)
- {
- try
- {
- CompileResult compileResult = ExecuteCompileCommand(lessPath, cssPath, minify);
- mainForm.ActiveOrInActiveMainForm.AddCompileResult(compileResult);
- }
- catch (Exception e)
- {
- ExceptionHandler.LogException(e);
- }
- }
-
- private static CompileResult ExecuteCompileCommand(string lessPath, string cssPath, bool minify)
- {
- string fileName = string.Format("{0}\\Less\\lessc.cmd", Application.StartupPath);
- string arguments = CreateCompileArguments(lessPath, cssPath, minify);
-
- CompileResult result = new CompileResult(){
- FullPath = lessPath,
- Time = DateTime.Now
- };
-
- string error = ExecuteCommand(fileName, arguments);
- if(error.Length > 0){
- if (error.Contains("Microsoft JScript runtime error: Input past end of file")) {
- result.ResultText = "Error: empty file";
- }
- else{
- result.ResultText = error.Replace("ERR", "Error");
- }
- }
- else{
- result.ResultText = "success";
- }
-
- return result;
- }
-
- private static string CreateCompileArguments(string lessPath, string cssPath, bool minify)
- {
- string arguments = string.Format("\"{0}\" \"{1}\"", lessPath, cssPath);
- if (minify)
- {
- arguments = string.Format("{0} -compress", arguments);
- }
-
- return arguments;
- }
-
- private static string ExecuteCommand(string fileName, string arguments)
- {
- try
- {
- System.Diagnostics.Process process = new System.Diagnostics.Process();
-
- process.StartInfo = new System.Diagnostics.ProcessStartInfo()
- {
- FileName = fileName,
- Arguments = arguments,
- WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
- CreateNoWindow = true,
- UseShellExecute = false,
- RedirectStandardError = true
- };
-
- process.Start();
-
- string error = process.StandardError.ReadToEnd();
- process.WaitForExit();
-
- return error;
- }
- catch (Exception e)
- {
- return e.Message;
- }
- }
- }
-}
View
9 WinLess/Less/less.js
@@ -1,9 +0,0 @@
-//
-// LESS - Leaner CSS v1.3.1
-// http://lesscss.org
-//
-// Copyright (c) 2009-2011, Alexis Sellier
-// Licensed under the Apache 2.0 License.
-//
-(function(e,t){function n(t){return e.less[t.split("/")[1]]}function h(){var e=document.getElementsByTagName("style");for(var t=0;t<e.length;t++)e[t].type.match(l)&&(new r.Parser({filename:document.location.href.replace(/#.*$/,""),dumpLineNumbers:r.dumpLineNumbers})).parse(e[t].innerHTML||"",function(n,r){var i=r.toCSS(),s=e[t];s.type="text/css",s.styleSheet?s.styleSheet.cssText=i:s.innerHTML=i})}function p(e,t){for(var n=0;n<r.sheets.length;n++)d(r.sheets[n],e,t,r.sheets.length-(n+1))}function d(t,n,i,s){var o=t.contents||{},a=e.location.href.replace(/[#?].*$/,""),f=t.href.replace(/\?.*$/,""),l=u&&u.getItem(f),c=u&&u.getItem(f+":timestamp"),h={css:l,timestamp:c};/^[a-z-]+:/.test(f)||(f.charAt(0)=="/"?f=e.location.protocol+"//"+e.location.host+f:f=a.slice(0,a.lastIndexOf("/")+1)+f),g(t.href,t.type,function(e,u){if(!i&&h&&u&&(new Date(u)).valueOf()===(new Date(h.timestamp)).valueOf())m(h.css,t),n(null,null,e,t,{local:!0,remaining:s});else try{o[f]=e,(new r.Parser({optimization:r.optimization,paths:[f.replace(/[\w\.-]+$/,"")],mime:t.type,filename:f,contents:o,dumpLineNumbers:r.dumpLineNumbers})).parse(e,function(r,i){if(r)return E(r,f);try{n(r,i,e,t,{local:!1,lastModified:u,remaining:s}),b(document.getElementById("less-error-message:"+v(f)))}catch(r){E(r,f)}})}catch(a){E(a,f)}},function(e,t){throw new Error("Couldn't load "+t+" ("+e+")")})}function v(e){return e.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function m(e,t,n){var r,i=t.href?t.href.replace(/\?.*$/,""):"",s="less:"+(t.title||v(i));if((r=document.getElementById(s))===null){r=document.createElement("style"),r.type="text/css",t.media&&(r.media=t.media),r.id=s;var o=t&&t.nextSibling||null;document.getElementsByTagName("head")[0].insertBefore(r,o)}if(r.styleSheet)try{r.styleSheet.cssText=e}catch(a){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(e){r.childNodes.length>0?r.firstChild.nodeValue!==e.nodeValue&&r.replaceChild(e,r.firstChild):r.appendChild(e)})(document.createTextNode(e));if(n&&u){w("saving "+i+" to cache.");try{u.setItem(i,e),u.setItem(i+":timestamp",n)}catch(a){w("failed to save")}}}function g(e,t,n,i){function a(t,n,r){t.status>=200&&t.status<300?n(t.responseText,t.getResponseHeader("Last-Modified")):typeof r=="function"&&r(t.status,e)}var o=y(),u=s?r.fileAsync:r.async;typeof o.overrideMimeType=="function"&&o.overrideMimeType("text/css"),o.open("GET",e,u),o.setRequestHeader("Accept",t||"text/x-less, text/css; q=0.9, */*; q=0.5"),o.send(null),s&&!r.fileAsync?o.status===0||o.status>=200&&o.status<300?n(o.responseText):i(o.status,e):u?o.onreadystatechange=function(){o.readyState==4&&a(o,n,i)}:a(o,n,i)}function y(){if(e.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(t){return w("browser doesn't support AJAX."),null}}function b(e){return e&&e.parentNode.removeChild(e)}function w(e){r.env=="development"&&typeof console!="undefined"&&console.log("less: "+e)}function E(e,t){var n="less-error-message:"+v(t),i='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',s=document.createElement("div"),o,u,a=[],f=e.filename||t,l=f.match(/([^\/]+)$/)[1];s.id=n,s.className="less-error-message",u="<h3>"+(e.message||"There is an error in your .less file")+"</h3>"+'<p>in <a href="'+f+'">'+l+"</a> ";var c=function(e,t,n){e.extract[t]&&a.push(i.replace(/\{line\}/,parseInt(e.line)+(t-1)).replace(/\{class\}/,n).replace(/\{content\}/,e.extract[t]))};e.stack?u+="<br/>"+e.stack.split("\n").slice(1).join("<br/>"):e.extract&&(c(e,0,""),c(e,1,"line"),c(e,2,""),u+="on line "+e.line+", column "+(e.column+1)+":</p>"+"<ul>"+a.join("")+"</ul>"),s.innerHTML=u,m([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),s.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),r.env=="development"&&(o=setInterval(function(){document.body&&(document.getElementById(n)?document.body.replaceChild(s,document.getElementById(n)):document.body.insertBefore(s,document.body.firstChild),clearInterval(o))},10))}Array.isArray||(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"||e instanceof Array}),Array.prototype.forEach||(Array.prototype.forEach=function(e,t){var n=this.length>>>0;for(var r=0;r<n;r++)r in this&&e.call(t,this[r],r,this)}),Array.prototype.map||(Array.prototype.map=function(e){var t=this.length>>>0,n=new Array(t),r=arguments[1];for(var i=0;i<t;i++)i in this&&(n[i]=e.call(r,this[i],i,this));return n}),Array.prototype.filter||(Array.prototype.filter=function(e){var t=[],n=arguments[1];for(var r=0;r<this.length;r++)e.call(n,this[r])&&t.push(this[r]);return t}),Array.prototype.reduce||(Array.prototype.reduce=function(e){var t=this.length>>>0,n=0;if(t===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var r=arguments[1];else do{if(n in this){r=this[n++];break}if(++n>=t)throw new TypeError}while(!0);for(;n<t;n++)n in this&&(r=e.call(null,r,this[n],n,this));return r}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length,n=arguments[1]||0;if(!t)return-1;if(n>=t)return-1;n<0&&(n+=t);for(;n<t;n++){if(!Object.prototype.hasOwnProperty.call(this,n))continue;if(e===this[n])return n}return-1}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),String.prototype.trim||(String.prototype.trim=function(){return String(this).replace(/^\s\s*/,"").replace(/\s\s*$/,"")});var r,i;typeof environment=="object"&&{}.toString.call(environment)==="[object Environment]"?(typeof e=="undefined"?r={}:r=e.less={},i=r.tree={},r.mode="rhino"):typeof e=="undefined"?(r=exports,i=n("./tree"),r.mode="node"):(typeof e.less=="undefined"&&(e.less={}),r=e.less,i=e.less.tree={},r.mode="browser"),r.Parser=function(t){function g(){a=c[u],f=o,h=o}function y(){c[u]=a,o=f,h=o}function b(){o>h&&(c[u]=c[u].slice(o-h),h=o)}function w(e){var t=e.charCodeAt(0);return t===32||t===10||t===9}function E(e){var t,n,r,i,a;if(e instanceof Function)return e.call(p.parsers);if(typeof e=="string")t=s.charAt(o)===e?e:null,r=1,b();else{b();if(!(t=e.exec(c[u])))return null;r=t[0].length}if(t)return S(r),typeof t=="string"?t:t.length===1?t[0]:t}function S(e){var t=o,n=u,r=o+c[u].length,i=o+=e;while(o<r){if(!w(s.charAt(o)))break;o++}return c[u]=c[u].slice(e+(o-i)),h=o,c[u].length===0&&u<c.length-1&&u++,t!==o||n!==u}function x(e,t){var n=E(e);if(!!n)return n;T(t||(typeof e=="string"?"expected '"+e+"' got '"+s.charAt(o)+"'":"unexpected token"))}function T(e,t){throw{index:o,type:t||"Syntax",message:e}}function N(e){return typeof e=="string"?s.charAt(o)===e:e.test(c[u])?!0:!1}function C(e,t){return e.filename&&t.filename&&e.filename!==t.filename?p.imports.contents[e.filename]:s}function k(e,t){for(var n=e,r=-1;n>=0&&t.charAt(n)!=="\n";n--)r++;return{line:typeof e=="number"?(t.slice(0,e).match(/\n/g)||"").length:null,column:r}}function L(e){return r.mode==="browser"||r.mode==="rhino"?e.filename:n("path").resolve(e.filename)}function A(e,t,n){return{lineNumber:k(e,t).line+1,fileName:L(n)}}function O(e,t){var n=C(e,t),r=k(e.index,n),i=r.line,s=r.column,o=n.split("\n");this.type=e.type||"Syntax",this.message=e.message,this.filename=e.filename||t.filename,this.index=e.index,this.line=typeof i=="number"?i+1:null,this.callLine=e.call&&k(e.call,n).line+1,this.callExtract=o[k(e.call,n).line],this.stack=e.stack,this.column=s,this.extract=[o[i-1],o[i],o[i+1]]}var s,o,u,a,f,l,c,h,p,d=this,t=t||{};t.contents||(t.contents={});var v=function(){},m=this.imports={paths:t&&t.paths||[],queue:[],files:{},contents:t.contents,mime:t&&t.mime,error:null,push:function(e,n){var i=this;this.queue.push(e),r.Parser.importer(e,this.paths,function(t,r){i.queue.splice(i.queue.indexOf(e),1);var s=e in i.files;i.files[e]=r,t&&!i.error&&(i.error=t),n(t,r,s),i.queue.length===0&&v(t)},t)}};return this.env=t=t||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null,p={imports:m,parse:function(e,a){var f,d,m,g,y,b,w=[],S,x=null;o=u=h=l=0,s=e.replace(/\r\n/g,"\n"),s=s.replace(/^\uFEFF/,""),c=function(e){var n=0,r=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,i=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,o=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,u=0,a,f=e[0],l;for(var c=0,h,p;c<s.length;c++){r.lastIndex=c,(a=r.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0])),h=s.charAt(c),i.lastIndex=o.lastIndex=c,(a=o.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0]),h=s.charAt(c)),!l&&h==="/"&&(p=s.charAt(c+1),(p==="/"||p==="*")&&(a=i.exec(s))&&a.index===c&&(c+=a[0].length,f.push(a[0]),h=s.charAt(c)));switch(h){case"{":if(!l){u++,f.push(h);break};case"}":if(!l){u--,f.push(h),e[++n]=f=[];break};case"(":if(!l){l=!0,f.push(h);break};case")":if(l){l=!1,f.push(h);break};default:f.push(h)}}return u>0&&(x=new O({index:c,type:"Parse",message:"missing closing `}`",filename:t.filename},t)),e.map(function(e){return e.join("")})}([[]]);if(x)return a(x);try{f=new i.Ruleset([],E(this.parsers.primary)),f.root=!0}catch(T){return a(new O(T,t))}f.toCSS=function(e){var s,o,u;return function(s,o){var u=[],a;s=s||{},typeof o=="object"&&!Array.isArray(o)&&(o=Object.keys(o).map(function(e){var t=o[e];return t instanceof i.Value||(t instanceof i.Expression||(t=new i.Expression([t])),t=new i.Value([t])),new i.Rule("@"+e,t,!1,0)}),u=[new i.Ruleset(null,o)]);try{var f=e.call(this,{frames:u}).toCSS([],{compress:s.compress||!1,dumpLineNumbers:t.dumpLineNumbers})}catch(l){throw new O(l,t)}if(a=p.imports.error)throw a instanceof O?a:new O(a,t);return s.yuicompress&&r.mode==="node"?n("./cssmin").compressor.cssmin(f):s.compress?f.replace(/(\s)+/g,"$1"):f}}(f.eval);if(o<s.length-1){o=l,b=s.split("\n"),y=(s.slice(0,o).match(/\n/g)||"").length+1;for(var N=o,C=-1;N>=0&&s.charAt(N)!=="\n";N--)C++;x={type:"Parse",message:"Syntax Error on line "+y,index:o,filename:t.filename,line:y,column:C,extract:[b[y-2],b[y-1],b[y]]}}this.imports.queue.length>0?v=function(e){e?a(e):a(null,f)}:a(x,f)},parsers:{primary:function(){var e,t=[];while((e=E(this.mixin.definition)||E(this.rule)||E(this.ruleset)||E(this.mixin.call)||E(this.comment)||E(this.directive))||E(/^[\s\n]+/))e&&t.push(e);return t},comment:function(){var e;if(s.charAt(o)!=="/")return;if(s.charAt(o+1)==="/")return new i.Comment(E(/^\/\/.*/),!0);if(e=E(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new i.Comment(e)},entities:{quoted:function(){var e,t=o,n;s.charAt(t)==="~"&&(t++,n=!0);if(s.charAt(t)!=='"'&&s.charAt(t)!=="'")return;n&&E("~");if(e=E(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new i.Quoted(e[0],e[1]||e[2],n)},keyword:function(){var e;if(e=E(/^[_A-Za-z-][_A-Za-z0-9-]*/))return i.colors.hasOwnProperty(e)?new i.Color(i.colors[e].slice(1)):new i.Keyword(e)},call:function(){var e,n,r,s,a=o;if(!(e=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(c[u])))return;e=e[1],n=e.toLowerCase();if(n==="url")return null;o+=e.length;if(n==="alpha"){s=E(this.alpha);if(typeof s!="undefined")return s}E("("),r=E(this.entities.arguments);if(!E(")"))return;if(e)return new i.Call(e,r,a,t.filename)},arguments:function(){var e=[],t;while(t=E(this.entities.assignment)||E(this.expression)){e.push(t);if(!E(","))break}return e},literal:function(){return E(this.entities.ratio)||E(this.entities.dimension)||E(this.entities.color)||E(this.entities.quoted)},assignment:function(){var e,t;if((e=E(/^\w+(?=\s?=)/i))&&E("=")&&(t=E(this.entity)))return new i.Assignment(e,t)},url:function(){var e;if(s.charAt(o)!=="u"||!E(/^url\(/))return;return e=E(this.entities.quoted)||E(this.entities.variable)||E(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",x(")"),new i.URL(e.value!=null||e instanceof i.Variable?e:new i.Anonymous(e),m.paths)},variable:function(){var e,n=o;if(s.charAt(o)==="@"&&(e=E(/^@@?[\w-]+/)))return new i.Variable(e,n,t.filename)},variableCurly:function(){var e,n,r=o;if(s.charAt(o)==="@"&&(n=E(/^@\{([\w-]+)\}/)))return new i.Variable("@"+n[1],r,t.filename)},color:function(){var e;if(s.charAt(o)==="#"&&(e=E(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/)))return new i.Color(e[1])},dimension:function(){var e,t=s.charCodeAt(o);if(t>57||t<45||t===47)return;if(e=E(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn|dpi|dpcm|dppx|rem|vw|vh|vmin|vm|ch)?/))return new i.Dimension(e[1],e[2])},ratio:function(){var e,t=s.charCodeAt(o);if(t>57||t<48)return;if(e=E(/^(\d+\/\d+)/))return new i.Ratio(e[1])},javascript:function(){var e,t=o,n;s.charAt(t)==="~"&&(t++,n=!0);if(s.charAt(t)!=="`")return;n&&E("~");if(e=E(/^`([^`]*)`/))return new i.JavaScript(e[1],o,n)}},variable:function(){var e;if(s.charAt(o)==="@"&&(e=E(/^(@[\w-]+)\s*:/)))return e[1]},shorthand:function(){var e,t;if(!N(/^[@\w.%-]+\/[@\w.-]+/))return;g();if((e=E(this.entity))&&E("/")&&(t=E(this.entity)))return new i.Shorthand(e,t);y()},mixin:{call:function(){var e=[],n,r,u=[],a,f=o,l=s.charAt(o),c,h,p=!1;if(l!=="."&&l!=="#")return;g();while(n=E(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/))e.push(new i.Element(r,n,o)),r=E(">");if(E("(")){while(a=E(this.expression)){h=a,c=null;if(a.value.length==1){var d=a.value[0];if(d instanceof i.Variable&&E(":")){if(!(h=E(this.expression)))throw new Error("Expected value");c=d.name}}u.push({name:c,value:h});if(!E(","))break}if(!E(")"))throw new Error("Expected )")}E(this.important)&&(p=!0);if(e.length>0&&(E(";")||N("}")))return new i.mixin.Call(e,u,f,t.filename,p);y()},definition:function(){var e,t=[],n,r,u,a,f,c=!1;if(s.charAt(o)!=="."&&s.charAt(o)!=="#"||N(/^[^{]*(;|})/))return;g();if(n=E(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){e=n[1];do{if(s.charAt(o)==="."&&E(/^\.{3}/)){c=!0;break}if(!(u=E(this.entities.variable)||E(this.entities.literal)||E(this.entities.keyword)))break;if(u instanceof i.Variable)if(E(":"))a=x(this.expression,"expected expression"),t.push({name:u.name,value:a});else{if(E(/^\.{3}/)){t.push({name:u.name,variadic:!0}),c=!0;break}t.push({name:u.name})}else t.push({value:u})}while(E(","));E(")")||(l=o,y()),E(/^when/)&&(f=x(this.conditions,"expected condition")),r=E(this.block);if(r)return new i.mixin.Definition(e,t,r,f,c);y()}}},entity:function(){return E(this.entities.literal)||E(this.entities.variable)||E(this.entities.url)||E(this.entities.call)||E(this.entities.keyword)||E(this.entities.javascript)||E(this.comment)},end:function(){return E(";")||N("}")},alpha:function(){var e;if(!E(/^\(opacity=/i))return;if(e=E(/^\d+/)||E(this.entities.variable))return x(")"),new i.Alpha(e)},element:function(){var e,t,n,r;n=E(this.combinator),e=E(/^(?:\d+\.\d+|\d+)%/)||E(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||E("*")||E("&")||E(this.attribute)||E(/^\([^)@]+\)/)||E(/^[\.#](?=@)/)||E(this.entities.variableCurly),e||E("(")&&(r=E(this.entities.variableCurly)||E(this.entities.variable))&&E(")")&&(e=new i.Paren(r));if(e)return new i.Element(n,e,o)},combinator:function(){var e,t=s.charAt(o);if(t===">"||t==="+"||t==="~"){o++;while(s.charAt(o).match(/\s/))o++;return new i.Combinator(t)}return s.charAt(o-1).match(/\s/)?new i.Combinator(" "):new i.Combinator(null)},selector:function(){var e,t,n=[],r,u;if(E("("))return e=E(this.entity),x(")"),new i.Selector([new i.Element("",e,o)]);while(t=E(this.element)){r=s.charAt(o),n.push(t);if(r==="{"||r==="}"||r===";"||r===",")break}if(n.length>0)return new i.Selector(n)},tag:function(){return E(/^[A-Za-z][A-Za-z-]*[0-9]?/)||E("*")},attribute:function(){var e="",t,n,r;if(!E("["))return;if(t=E(/^(?:[_A-Za-z0-9-]|\\.)+/)||E(this.entities.quoted))(r=E(/^[|~*$^]?=/))&&(n=E(this.entities.quoted)||E(/^[\w-]+/))?e=[t,r,n.toCSS?n.toCSS():n].join(""):e=t;if(!E("]"))return;if(e)return"["+e+"]"},block:function(){var e;if(E("{")&&(e=E(this.primary))&&E("}"))return e},ruleset:function(){var e=[],n,r,u,a;g(),t.dumpLineNumbers&&(a=A(o,s,t));while(n=E(this.selector)){e.push(n),E(this.comment);if(!E(","))break;E(this.comment)}if(e.length>0&&(r=E(this.block))){var f=new i.Ruleset(e,r,t.strictImports);return t.dumpLineNumbers&&(f.debugInfo=a),f}l=o,y()},rule:function(){var e,t,n=s.charAt(o),r,a;g();if(n==="."||n==="#"||n==="&")return;if(e=E(this.variable)||E(this.property)){e.charAt(0)!="@"&&(a=/^([^@+\/'"*`(;{}-]*);/.exec(c[u]))?(o+=a[0].length-1,t=new i.Anonymous(a[1])):e==="font"?t=E(this.font):t=E(this.value),r=E(this.important);if(t&&E(this.end))return new i.Rule(e,t,r,f);l=o,y()}},"import":function(){var e,t,n=o;g();var r=E(/^@import(?:-(once))?\s+/);if(r&&(e=E(this.entities.quoted)||E(this.entities.url))){t=E(this.mediaFeatures);if(E(";"))return new i.Import(e,m,t,r[1]==="once",n)}y()},mediaFeature:function(){var e,t,n=[];do if(e=E(this.entities.keyword))n.push(e);else if(E("(")){t=E(this.property),e=E(this.entity);if(!E(")"))return null;if(t&&e)n.push(new i.Paren(new i.Rule(t,e,null,o,!0)));else{if(!e)return null;n.push(new i.Paren(e))}}while(e);if(n.length>0)return new i.Expression(n)},mediaFeatures:function(){var e,t=[];do if(e=E(this.mediaFeature)){t.push(e);if(!E(","))break}else if(e=E(this.entities.variable)){t.push(e);if(!E(","))break}while(e);return t.length>0?t:null},media:function(){var e,n,r,u;t.dumpLineNumbers&&(u=A(o,s,t));if(E(/^@media/)){e=E(this.mediaFeatures);if(n=E(this.block))return r=new i.Media(n,e),t.dumpLineNumbers&&(r.debugInfo=u),r}},directive:function(){var e,t,n,r,u,a,f,l,c;if(s.charAt(o)!=="@")return;if(t=E(this["import"])||E(this.media))return t;g(),e=E(/^@[a-z-]+/),f=e,e.charAt(1)=="-"&&e.indexOf("-",2)>0&&(f="@"+e.slice(e.indexOf("-",2)+1));switch(f){case"@font-face":l=!0;break;case"@viewport":case"@top-left":case"@top-left-corner":case"@top-center":case"@top-right":case"@top-right-corner":case"@bottom-left":case"@bottom-left-corner":case"@bottom-center":case"@bottom-right":case"@bottom-right-corner":case"@left-top":case"@left-middle":case"@left-bottom":case"@right-top":case"@right-middle":case"@right-bottom":l=!0;break;case"@page":case"@document":case"@supports":case"@keyframes":l=!0,c=!0}c&&(e+=" "+(E(/^[^{]+/)||"").trim());if(l){if(n=E(this.block))return new i.Directive(e,n)}else if((t=E(this.entity))&&E(";"))return new i.Directive(e,t);y()},font:function(){var e=[],t=[],n,r,s,o;while(o=E(this.shorthand)||E(this.entity))t.push(o);e.push(new i.Expression(t));if(E(","))while(o=E(this.expression)){e.push(o);if(!E(","))break}return new i.Value(e)},value:function(){var e,t=[],n;while(e=E(this.expression)){t.push(e);if(!E(","))break}if(t.length>0)return new i.Value(t)},important:function(){if(s.charAt(o)==="!")return E(/^! *important/)},sub:function(){var e;if(E("(")&&(e=E(this.expression))&&E(")"))return e},multiplication:function(){var e,t,n,r;if(e=E(this.operand)){while(!N(/^\/\*/)&&(n=E("/")||E("*"))&&(t=E(this.operand)))r=new i.Operation(n,[r||e,t]);return r||e}},addition:function(){var e,t,n,r;if(e=E(this.multiplication)){while((n=E(/^[-+]\s+/)||!w(s.charAt(o-1))&&(E("+")||E("-")))&&(t=E(this.multiplication)))r=new i.Operation(n,[r||e,t]);return r||e}},conditions:function(){var e,t,n=o,r;if(e=E(this.condition)){while(E(",")&&(t=E(this.condition)))r=new i.Condition("or",r||e,t,n);return r||e}},condition:function(){var e,t,n,r,s=o,u=!1;E(/^not/)&&(u=!0),x("(");if(e=E(this.addition)||E(this.entities.keyword)||E(this.entities.quoted))return(r=E(/^(?:>=|=<|[<=>])/))?(t=E(this.addition)||E(this.entities.keyword)||E(this.entities.quoted))?n=new i.Condition(r,e,t,s,u):T("expected expression"):n=new i.Condition("=",e,new i.Keyword("true"),s,u),x(")"),E(/^and/)?new i.Condition("and",n,E(this.condition)):n},operand:function(){var e,t=s.charAt(o+1);s.charAt(o)==="-"&&(t==="@"||t==="(")&&(e=E("-"));var n=E(this.sub)||E(this.entities.dimension)||E(this.entities.color)||E(this.entities.variable)||E(this.entities.call);return e?new i.Operation("*",[new i.Dimension(-1),n]):n},expression:function(){var e,t,n=[],r;while(e=E(this.addition)||E(this.entity))n.push(e);if(n.length>0)return new i.Expression(n)},property:function(){var e;if(e=E(/^(\*?-?[_a-z0-9-]+)\s*:/))return e[1]}}}};if(r.mode==="browser"||r.mode==="rhino")r.Parser.importer=function(e,t,n,r){!/^([a-z-]+:)?\//.test(e)&&t.length>0&&(e=t[0]+e),d({href:e,title:e,type:r.mime,contents:r.contents},function(i){i&&typeof r.errback=="function"?r.errback.call(null,e,t,n,r):n.apply(null,arguments)},!0)};(function(e){function t(t){return e.functions.hsla(t.h,t.s,t.l,t.a)}function n(t){if(t instanceof e.Dimension)return parseFloat(t.unit=="%"?t.value/100:t.value);if(typeof t=="number")return t;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function r(e){return Math.min(1,Math.max(0,e))}e.functions={rgb:function(e,t,n){return this.rgba(e,t,n,1)},rgba:function(t,r,i,s){var o=[t,r,i].map(function(e){return n(e)}),s=n(s);return new e.Color(o,s)},hsl:function(e,t,n){return this.hsla(e,t,n,1)},hsla:function(e,t,r,i){function u(e){return e=e<0?e+1:e>1?e-1:e,e*6<1?o+(s-o)*e*6:e*2<1?s:e*3<2?o+(s-o)*(2/3-e)*6:o}e=n(e)%360/360,t=n(t),r=n(r),i=n(i);var s=r<=.5?r*(t+1):r+t-r*t,o=r*2-s;return this.rgba(u(e+1/3)*255,u(e)*255,u(e-1/3)*255,i)},hue:function(t){return new e.Dimension(Math.round(t.toHSL().h))},saturation:function(t){return new e.Dimension(Math.round(t.toHSL().s*100),"%")},lightness:function(t){return new e.Dimension(Math.round(t.toHSL().l*100),"%")},red:function(t){return new e.Dimension(t.rgb[0])},green:function(t){return new e.Dimension(t.rgb[1])},blue:function(t){return new e.Dimension(t.rgb[2])},alpha:function(t){return new e.Dimension(t.toHSL().a)},luma:function(t){return new e.Dimension(Math.round((.2126*(t.rgb[0]/255)+.7152*(t.rgb[1]/255)+.0722*(t.rgb[2]/255))*t.alpha*100),"%")},saturate:function(e,n){var i=e.toHSL();return i.s+=n.value/100,i.s=r(i.s),t(i)},desaturate:function(e,n){var i=e.toHSL();return i.s-=n.value/100,i.s=r(i.s),t(i)},lighten:function(e,n){var i=e.toHSL();return i.l+=n.value/100,i.l=r(i.l),t(i)},darken:function(e,n){var i=e.toHSL();return i.l-=n.value/100,i.l=r(i.l),t(i)},fadein:function(e,n){var i=e.toHSL();return i.a+=n.value/100,i.a=r(i.a),t(i)},fadeout:function(e,n){var i=e.toHSL();return i.a-=n.value/100,i.a=r(i.a),t(i)},fade:function(e,n){var i=e.toHSL();return i.a=n.value/100,i.a=r(i.a),t(i)},spin:function(e,n){var r=e.toHSL(),i=(r.h+n.value)%360;return r.h=i<0?360+i:i,t(r)},mix:function(t,n,r){r||(r=new e.Dimension(50));var i=r.value/100,s=i*2-1,o=t.toHSL().a-n.toHSL().a,u=((s*o==-1?s:(s+o)/(1+s*o))+1)/2,a=1-u,f=[t.rgb[0]*u+n.rgb[0]*a,t.rgb[1]*u+n.rgb[1]*a,t.rgb[2]*u+n.rgb[2]*a],l=t.alpha*i+n.alpha*(1-i);return new e.Color(f,l)},greyscale:function(t){return this.desaturate(t,new e.Dimension(100))},contrast:function(e,t,n,r){return typeof n=="undefined"&&(n=this.rgba(255,255,255,1)),typeof t=="undefined"&&(t=this.rgba(0,0,0,1)),typeof r=="undefined"?r=.43:r=r.value,(.2126*(e.rgb[0]/255)+.7152*(e.rgb[1]/255)+.0722*(e.rgb[2]/255))*e.alpha<r?n:t},e:function(t){return new e.Anonymous(t instanceof e.JavaScript?t.evaluated:t)},escape:function(t){return new e.Anonymous(encodeURI(t.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(t){var n=Array.prototype.slice.call(arguments,1),r=t.value;for(var i=0;i<n.length;i++)r=r.replace(/%[sda]/i,function(e){var t=e.match(/s/i)?n[i].value:n[i].toCSS();return e.match(/[A-Z]$/)?encodeURIComponent(t):t});return r=r.replace(/%%/g,"%"),new e.Quoted('"'+r+'"',r)},round:function(t,r){var i=typeof r=="undefined"?0:r.value;if(t instanceof e.Dimension)return new e.Dimension(n(t).toFixed(i),t.unit);if(typeof t=="number")return t.toFixed(i);throw{type:"Argument",message:"argument must be a number"}},ceil:function(e){return this._math("ceil",e)},floor:function(e){return this._math("floor",e)},_math:function(t,r){if(r instanceof e.Dimension)return new e.Dimension(Math[t](n(r)),r.unit);if(typeof r=="number")return Math[t](r);throw{type:"Argument",message:"argument must be a number"}},argb:function(t){return new e.Anonymous(t.toARGB())},percentage:function(t){return new e.Dimension(t.value*100,"%")},color:function(t){if(t instanceof e.Quoted)return new e.Color(t.value.slice(1));throw{type:"Argument",message:"argument must be a string"}},iscolor:function(t){return this._isa(t,e.Color)},isnumber:function(t){return this._isa(t,e.Dimension)},isstring:function(t){return this._isa(t,e.Quoted)},iskeyword:function(t){return this._isa(t,e.Keyword)},isurl:function(t){return this._isa(t,e.URL)},ispixel:function(t){return t instanceof e.Dimension&&t.unit==="px"?e.True:e.False},ispercentage:function(t){return t instanceof e.Dimension&&t.unit==="%"?e.True:e.False},isem:function(t){return t instanceof e.Dimension&&t.unit==="em"?e.True:e.False},_isa:function(t,n){return t instanceof n?e.True:e.False},multiply:function(e,t){var n=e.rgb[0]*t.rgb[0]/255,r=e.rgb[1]*t.rgb[1]/255,i=e.rgb[2]*t.rgb[2]/255;return this.rgb(n,r,i)},screen:function(e,t){var n=255-(255-e.rgb[0])*(255-t.rgb[0])/255,r=255-(255-e.rgb[1])*(255-t.rgb[1])/255,i=255-(255-e.rgb[2])*(255-t.rgb[2])/255;return this.rgb(n,r,i)},overlay:function(e,t){var n=e.rgb[0]<128?2*e.rgb[0]*t.rgb[0]/255:255-2*(255-e.rgb[0])*(255-t.rgb[0])/255,r=e.rgb[1]<128?2*e.rgb[1]*t.rgb[1]/255:255-2*(255-e.rgb[1])*(255-t.rgb[1])/255,i=e.rgb[2]<128?2*e.rgb[2]*t.rgb[2]/255:255-2*(255-e.rgb[2])*(255-t.rgb[2])/255;return this.rgb(n,r,i)},softlight:function(e,t){var n=t.rgb[0]*e.rgb[0]/255,r=n+e.rgb[0]*(255-(255-e.rgb[0])*(255-t.rgb[0])/255-n)/255;n=t.rgb[1]*e.rgb[1]/255;var i=n+e.rgb[1]*(255-(255-e.rgb[1])*(255-t.rgb[1])/255-n)/255;n=t.rgb[2]*e.rgb[2]/255;var s=n+e.rgb[2]*(255-(255-e.rgb[2])*(255-t.rgb[2])/255-n)/255;return this.rgb(r,i,s)},hardlight:function(e,t){var n=t.rgb[0]<128?2*t.rgb[0]*e.rgb[0]/255:255-2*(255-t.rgb[0])*(255-e.rgb[0])/255,r=t.rgb[1]<128?2*t.rgb[1]*e.rgb[1]/255:255-2*(255-t.rgb[1])*(255-e.rgb[1])/255,i=t.rgb[2]<128?2*t.rgb[2]*e.rgb[2]/255:255-2*(255-t.rgb[2])*(255-e.rgb[2])/255;return this.rgb(n,r,i)},difference:function(e,t){var n=Math.abs(e.rgb[0]-t.rgb[0]),r=Math.abs(e.rgb[1]-t.rgb[1]),i=Math.abs(e.rgb[2]-t.rgb[2]);return this.rgb(n,r,i)},exclusion:function(e,t){var n=e.rgb[0]+t.rgb[0]*(255-e.rgb[0]-e.rgb[0])/255,r=e.rgb[1]+t.rgb[1]*(255-e.rgb[1]-e.rgb[1])/255,i=e.rgb[2]+t.rgb[2]*(255-e.rgb[2]-e.rgb[2])/255;return this.rgb(n,r,i)},average:function(e,t){var n=(e.rgb[0]+t.rgb[0])/2,r=(e.rgb[1]+t.rgb[1])/2,i=(e.rgb[2]+t.rgb[2])/2;return this.rgb(n,r,i)},negation:function(e,t){var n=255-Math.abs(255-t.rgb[0]-e.rgb[0]),r=255-Math.abs(255-t.rgb[1]-e.rgb[1]),i=255-Math.abs(255-t.rgb[2]-e.rgb[2]);return this.rgb(n,r,i)},tint:function(e,t){return this.mix(this.rgb(255,255,255),e,t)},shade:function(e,t){return this.mix(this.rgb(0,0,0),e,t)}}})(n("./tree")),function(e){e.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(n("./tree")),function(e){e.Alpha=function(e){this.value=e},e.Alpha.prototype={toCSS:function(){return"alpha(opacity="+(this.value.toCSS?this.value.toCSS():this.value)+")"},eval:function(e){return this.value.eval&&(this.value=this.value.eval(e)),this}}}(n("../tree")),function(e){e.Anonymous=function(e){this.value=e.value||e},e.Anonymous.prototype={toCSS:function(){return this.value},eval:function(){return this},compare:function(e){if(!e.toCSS)return-1;var t=this.toCSS(),n=e.toCSS();return t===n?0:t<n?-1:1}}}(n("../tree")),function(e){e.Assignment=function(e,t){this.key=e,this.value=t},e.Assignment.prototype={toCSS:function(){return this.key+"="+(this.value.toCSS?this.value.toCSS():this.value)},eval:function(t){return this.value.eval?new e.Assignment(this.key,this.value.eval(t)):this}}}(n("../tree")),function(e){e.Call=function(e,t,n,r){this.name=e,this.args=t,this.index=n,this.filename=r},e.Call.prototype={eval:function(t){var n=this.args.map(function(e){return e.eval(t)});if(!(this.name in e.functions))return new e.Anonymous(this.name+"("+n.map(function(e){return e.toCSS(t)}).join(", ")+")");try{return e.functions[this.name].apply(e.functions,n)}catch(r){throw{type:r.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(r.message?": "+r.message:""),index:this.index,filename:this.filename}}},toCSS:function(e){return this.eval(e).toCSS()}}}(n("../tree")),function(e){e.Color=function(e,t){Array.isArray(e)?this.rgb=e:e.length==6?this.rgb=e.match(/.{2}/g).map(function(e){return parseInt(e,16)}):this.rgb=e.split("").map(function(e){return parseInt(e+e,16)}),this.alpha=typeof t=="number"?t:1},e.Color.prototype={eval:function(){return this},toCSS:function(){return this.alpha<1?"rgba("+this.rgb.map(function(e){return Math.round(e)}).concat(this.alpha).join(", ")+")":"#"+this.rgb.map(function(e){return e=Math.round(e),e=(e>255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("")},operate:function(t,n){var r=[];n instanceof e.Color||(n=n.toColor());for(var i=0;i<3;i++)r[i]=e.operate(t,this.rgb[i],n.rgb[i]);return new e.Color(r,this.alpha+n.alpha)},toHSL:function(){var e=this.rgb[0]/255,t=this.rgb[1]/255,n=this.rgb[2]/255,r=this.alpha,i=Math.max(e,t,n),s=Math.min(e,t,
-n),o,u,a=(i+s)/2,f=i-s;if(i===s)o=u=0;else{u=a>.5?f/(2-i-s):f/(i+s);switch(i){case e:o=(t-n)/f+(t<n?6:0);break;case t:o=(n-e)/f+2;break;case n:o=(e-t)/f+4}o/=6}return{h:o*360,s:u,l:a,a:r}},toARGB:function(){var e=[Math.round(this.alpha*255)].concat(this.rgb);return"#"+e.map(function(e){return e=Math.round(e),e=(e>255?255:e<0?0:e).toString(16),e.length===1?"0"+e:e}).join("")},compare:function(e){return e.rgb?e.rgb[0]===this.rgb[0]&&e.rgb[1]===this.rgb[1]&&e.rgb[2]===this.rgb[2]&&e.alpha===this.alpha?0:-1:-1}}}(n("../tree")),function(e){e.Comment=function(e,t){this.value=e,this.silent=!!t},e.Comment.prototype={toCSS:function(e){return e.compress?"":this.value},eval:function(){return this}}}(n("../tree")),function(e){e.Condition=function(e,t,n,r,i){this.op=e.trim(),this.lvalue=t,this.rvalue=n,this.index=r,this.negate=i},e.Condition.prototype.eval=function(e){var t=this.lvalue.eval(e),n=this.rvalue.eval(e),r=this.index,i,i=function(e){switch(e){case"and":return t&&n;case"or":return t||n;default:if(t.compare)i=t.compare(n);else{if(!n.compare)throw{type:"Type",message:"Unable to perform comparison",index:r};i=n.compare(t)}switch(i){case-1:return e==="<"||e==="=<";case 0:return e==="="||e===">="||e==="=<";case 1:return e===">"||e===">="}}}(this.op);return this.negate?!i:i}}(n("../tree")),function(e){e.Dimension=function(e,t){this.value=parseFloat(e),this.unit=t||null},e.Dimension.prototype={eval:function(){return this},toColor:function(){return new e.Color([this.value,this.value,this.value])},toCSS:function(){var e=this.value+this.unit;return e},operate:function(t,n){return new e.Dimension(e.operate(t,this.value,n.value),this.unit||n.unit)},compare:function(t){return t instanceof e.Dimension?t.value>this.value?-1:t.value<this.value?1:0:-1}}}(n("../tree")),function(e){e.Directive=function(t,n){this.name=t,Array.isArray(n)?(this.ruleset=new e.Ruleset([],n),this.ruleset.allowImports=!0):this.value=n},e.Directive.prototype={toCSS:function(e,t){return this.ruleset?(this.ruleset.root=!0,this.name+(t.compress?"{":" {\n ")+this.ruleset.toCSS(e,t).trim().replace(/\n/g,"\n ")+(t.compress?"}":"\n}\n")):this.name+" "+this.value.toCSS()+";\n"},eval:function(t){var n=this;return this.ruleset&&(t.frames.unshift(this),n=new e.Directive(this.name),n.ruleset=this.ruleset.eval(t),t.frames.shift()),n},variable:function(t){return e.Ruleset.prototype.variable.call(this.ruleset,t)},find:function(){return e.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return e.Ruleset.prototype.rulesets.apply(this.ruleset)}}}(n("../tree")),function(e){e.Element=function(t,n,r){this.combinator=t instanceof e.Combinator?t:new e.Combinator(t),typeof n=="string"?this.value=n.trim():n?this.value=n:this.value="",this.index=r},e.Element.prototype.eval=function(t){return new e.Element(this.combinator,this.value.eval?this.value.eval(t):this.value,this.index)},e.Element.prototype.toCSS=function(e){var t=this.value.toCSS?this.value.toCSS(e):this.value;return t==""&&this.combinator.value.charAt(0)=="&"?"":this.combinator.toCSS(e||{})+t},e.Combinator=function(e){e===" "?this.value=" ":this.value=e?e.trim():""},e.Combinator.prototype.toCSS=function(e){return{"":""," ":" ",":":" :","+":e.compress?"+":" + ","~":e.compress?"~":" ~ ",">":e.compress?">":" > "}[this.value]}}(n("../tree")),function(e){e.Expression=function(e){this.value=e},e.Expression.prototype={eval:function(t){return this.value.length>1?new e.Expression(this.value.map(function(e){return e.eval(t)})):this.value.length===1?this.value[0].eval(t):this},toCSS:function(e){return this.value.map(function(t){return t.toCSS?t.toCSS(e):""}).join(" ")}}}(n("../tree")),function(e){e.Import=function(t,n,r,i,s){var o=this;this.once=i,this.index=s,this._path=t,this.features=r&&new e.Value(r),t instanceof e.Quoted?this.path=/\.(le?|c)ss(\?.*)?$/.test(t.value)?t.value:t.value+".less":this.path=t.value.value||t.value,this.css=/css(\?.*)?$/.test(this.path),this.css||n.push(this.path,function(t,n,r){t&&(t.index=s),r&&o.once&&(o.skip=r),o.root=n||new e.Ruleset([],[])})},e.Import.prototype={toCSS:function(e){var t=this.features?" "+this.features.toCSS(e):"";return this.css?"@import "+this._path.toCSS()+t+";\n":""},eval:function(t){var n,r=this.features&&this.features.eval(t);if(this.skip)return[];if(this.css)return this;n=new e.Ruleset([],this.root.rules.slice(0));for(var i=0;i<n.rules.length;i++)n.rules[i]instanceof e.Import&&Array.prototype.splice.apply(n.rules,[i,1].concat(n.rules[i].eval(t)));return this.features?new e.Media(n.rules,this.features.value):n.rules}}}(n("../tree")),function(e){e.JavaScript=function(e,t,n){this.escaped=n,this.expression=e,this.index=t},e.JavaScript.prototype={eval:function(t){var n,r=this,i={},s=this.expression.replace(/@\{([\w-]+)\}/g,function(n,i){return e.jsify((new e.Variable("@"+i,r.index)).eval(t))});try{s=new Function("return ("+s+")")}catch(o){throw{message:"JavaScript evaluation error: `"+s+"`",index:this.index}}for(var u in t.frames[0].variables())i[u.slice(1)]={value:t.frames[0].variables()[u].value,toJS:function(){return this.value.eval(t).toCSS()}};try{n=s.call(i)}catch(o){throw{message:"JavaScript evaluation error: '"+o.name+": "+o.message+"'",index:this.index}}return typeof n=="string"?new e.Quoted('"'+n+'"',n,this.escaped,this.index):Array.isArray(n)?new e.Anonymous(n.join(", ")):new e.Anonymous(n)}}}(n("../tree")),function(e){e.Keyword=function(e){this.value=e},e.Keyword.prototype={eval:function(){return this},toCSS:function(){return this.value},compare:function(t){return t instanceof e.Keyword?t.value===this.value?0:1:-1}},e.True=new e.Keyword("true"),e.False=new e.Keyword("false")}(n("../tree")),function(e){e.Media=function(t,n){var r=this.emptySelectors();this.features=new e.Value(n),this.ruleset=new e.Ruleset(r,t),this.ruleset.allowImports=!0},e.Media.prototype={toCSS:function(e,t){var n=this.features.toCSS(t);return this.ruleset.root=e.length===0||e[0].multiMedia,"@media "+n+(t.compress?"{":" {\n ")+this.ruleset.toCSS(e,t).trim().replace(/\n/g,"\n ")+(t.compress?"}":"\n}\n")},eval:function(t){t.mediaBlocks||(t.mediaBlocks=[],t.mediaPath=[]);var n=t.mediaBlocks.length;t.mediaPath.push(this),t.mediaBlocks.push(this);var r=new e.Media([],[]);return this.debugInfo&&(this.ruleset.debugInfo=this.debugInfo,r.debugInfo=this.debugInfo),r.features=this.features.eval(t),t.frames.unshift(this.ruleset),r.ruleset=this.ruleset.eval(t),t.frames.shift(),t.mediaBlocks[n]=r,t.mediaPath.pop(),t.mediaPath.length===0?r.evalTop(t):r.evalNested(t)},variable:function(t){return e.Ruleset.prototype.variable.call(this.ruleset,t)},find:function(){return e.Ruleset.prototype.find.apply(this.ruleset,arguments)},rulesets:function(){return e.Ruleset.prototype.rulesets.apply(this.ruleset)},emptySelectors:function(){var t=new e.Element("","&",0);return[new e.Selector([t])]},evalTop:function(t){var n=this;if(t.mediaBlocks.length>1){var r=this.emptySelectors();n=new e.Ruleset(r,t.mediaBlocks),n.multiMedia=!0}return delete t.mediaBlocks,delete t.mediaPath,n},evalNested:function(t){var n,r,i=t.mediaPath.concat([this]);for(n=0;n<i.length;n++)r=i[n].features instanceof e.Value?i[n].features.value:i[n].features,i[n]=Array.isArray(r)?r:[r];return this.features=new e.Value(this.permute(i).map(function(t){t=t.map(function(t){return t.toCSS?t:new e.Anonymous(t)});for(n=t.length-1;n>0;n--)t.splice(n,0,new e.Anonymous("and"));return new e.Expression(t)})),new e.Ruleset([],[])},permute:function(e){if(e.length===0)return[];if(e.length===1)return e[0];var t=[],n=this.permute(e.slice(1));for(var r=0;r<n.length;r++)for(var i=0;i<e[0].length;i++)t.push([e[0][i]].concat(n[r]));return t},bubbleSelectors:function(t){this.ruleset=new e.Ruleset(t.slice(0),[this.ruleset])}}}(n("../tree")),function(e){e.mixin={},e.mixin.Call=function(t,n,r,i,s){this.selector=new e.Selector(t),this.arguments=n,this.index=r,this.filename=i,this.important=s},e.mixin.Call.prototype={eval:function(e){var t,n,r=[],i=!1;for(var s=0;s<e.frames.length;s++)if((t=e.frames[s].find(this.selector)).length>0){n=this.arguments&&this.arguments.map(function(t){return{name:t.name,value:t.value.eval(e)}});for(var o=0;o<t.length;o++)if(t[o].match(n,e))try{Array.prototype.push.apply(r,t[o].eval(e,this.arguments,this.important).rules),i=!0}catch(u){throw{message:u.message,index:this.index,filename:this.filename,stack:u.stack}}if(i)return r;throw{type:"Runtime",message:"No matching definition was found for `"+this.selector.toCSS().trim()+"("+this.arguments.map(function(e){return e.toCSS()}).join(", ")+")`",index:this.index,filename:this.filename}}throw{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.filename}}},e.mixin.Definition=function(t,n,r,i,s){this.name=t,this.selectors=[new e.Selector([new e.Element(null,t)])],this.params=n,this.condition=i,this.variadic=s,this.arity=n.length,this.rules=r,this._lookups={},this.required=n.reduce(function(e,t){return!t.name||t.name&&!t.value?e+1:e},0),this.parent=e.Ruleset.prototype,this.frames=[]},e.mixin.Definition.prototype={toCSS:function(){return""},variable:function(e){return this.parent.variable.call(this,e)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},evalParams:function(t,n){var r=new e.Ruleset(null,[]),i,s;for(var o=0,u,a;o<this.params.length;o++){s=n&&n[o];if(s&&s.name){r.rules.unshift(new e.Rule(s.name,s.value.eval(t))),n.splice(o,1),o--;continue}if(a=this.params[o].name)if(this.params[o].variadic&&n){i=[];for(var f=o;f<n.length;f++)i.push(n[f].value.eval(t));r.rules.unshift(new e.Rule(a,(new e.Expression(i)).eval(t)))}else{if(!(u=s&&s.value||this.params[o].value))throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+n.length+" for "+this.arity+")"};r.rules.unshift(new e.Rule(a,u.eval(t)))}}return r},eval:function(t,n,r){var i=this.evalParams(t,n),s,o=[],u,a;for(var f=0;f<Math.max(this.params.length,n&&n.length);f++)o.push(n[f]&&n[f].value||this.params[f].value);return i.rules.unshift(new e.Rule("@arguments",(new e.Expression(o)).eval(t))),u=r?this.rules.map(function(t){return new e.Rule(t.name,t.value,"!important",t.index)}):this.rules.slice(0),(new e.Ruleset(null,u)).eval({frames:[this,i].concat(this.frames,t.frames)})},match:function(e,t){var n=e&&e.length||0,r,i;if(!this.variadic){if(n<this.required)return!1;if(n>this.params.length)return!1;if(this.required>0&&n>this.params.length)return!1}if(this.condition&&!this.condition.eval({frames:[this.evalParams(t,e)].concat(t.frames)}))return!1;r=Math.min(n,this.arity);for(var s=0;s<r;s++)if(!this.params[s].name&&e[s].value.eval(t).toCSS()!=this.params[s].value.eval(t).toCSS())return!1;return!0}}}(n("../tree")),function(e){e.Operation=function(e,t){this.op=e.trim(),this.operands=t},e.Operation.prototype.eval=function(t){var n=this.operands[0].eval(t),r=this.operands[1].eval(t),i;if(n instanceof e.Dimension&&r instanceof e.Color){if(this.op!=="*"&&this.op!=="+")throw{name:"OperationError",message:"Can't substract or divide a color from a number"};i=r,r=n,n=i}return n.operate(this.op,r)},e.operate=function(e,t,n){switch(e){case"+":return t+n;case"-":return t-n;case"*":return t*n;case"/":return t/n}}}(n("../tree")),function(e){e.Paren=function(e){this.value=e},e.Paren.prototype={toCSS:function(e){return"("+this.value.toCSS(e)+")"},eval:function(t){return new e.Paren(this.value.eval(t))}}}(n("../tree")),function(e){e.Quoted=function(e,t,n,r){this.escaped=n,this.value=t||"",this.quote=e.charAt(0),this.index=r},e.Quoted.prototype={toCSS:function(){return this.escaped?this.value:this.quote+this.value+this.quote},eval:function(t){var n=this,r=this.value.replace(/`([^`]+)`/g,function(r,i){return(new e.JavaScript(i,n.index,!0)).eval(t).value}).replace(/@\{([\w-]+)\}/g,function(r,i){var s=(new e.Variable("@"+i,n.index)).eval(t);return"value"in s?s.value:s.toCSS()});return new e.Quoted(this.quote+r+this.quote,r,this.escaped,this.index)},compare:function(e){if(!e.toCSS)return-1;var t=this.toCSS(),n=e.toCSS();return t===n?0:t<n?-1:1}}}(n("../tree")),function(e){e.Ratio=function(e){this.value=e},e.Ratio.prototype={toCSS:function(e){return this.value},eval:function(){return this}}}(n("../tree")),function(e){e.Rule=function(t,n,r,i,s){this.name=t,this.value=n instanceof e.Value?n:new e.Value([n]),this.important=r?" "+r.trim():"",this.index=i,this.inline=s||!1,t.charAt(0)==="@"?this.variable=!0:this.variable=!1},e.Rule.prototype.toCSS=function(e){return this.variable?"":this.name+(e.compress?":":": ")+this.value.toCSS(e)+this.important+(this.inline?"":";")},e.Rule.prototype.eval=function(t){return new e.Rule(this.name,this.value.eval(t),this.important,this.index,this.inline)},e.Shorthand=function(e,t){this.a=e,this.b=t},e.Shorthand.prototype={toCSS:function(e){return this.a.toCSS(e)+"/"+this.b.toCSS(e)},eval:function(){return this}}}(n("../tree")),function(e){e.Ruleset=function(e,t,n){this.selectors=e,this.rules=t,this._lookups={},this.strictImports=n},e.Ruleset.prototype={eval:function(t){var n=this.selectors&&this.selectors.map(function(e){return e.eval(t)}),r=new e.Ruleset(n,this.rules.slice(0),this.strictImports),i=[];r.root=this.root,r.allowImports=this.allowImports,this.debugInfo&&(r.debugInfo=this.debugInfo),t.frames.unshift(r);if(r.root||r.allowImports||!r.strictImports){for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.Import?i=i.concat(r.rules[s].eval(t)):i.push(r.rules[s]);r.rules=i,i=[]}for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.mixin.Definition&&(r.rules[s].frames=t.frames.slice(0));var o=t.mediaBlocks&&t.mediaBlocks.length||0;for(var s=0;s<r.rules.length;s++)r.rules[s]instanceof e.mixin.Call?i=i.concat(r.rules[s].eval(t)):i.push(r.rules[s]);r.rules=i;for(var s=0,u;s<r.rules.length;s++)u=r.rules[s],u instanceof e.mixin.Definition||(r.rules[s]=u.eval?u.eval(t):u);t.frames.shift();if(t.mediaBlocks)for(var s=o;s<t.mediaBlocks.length;s++)t.mediaBlocks[s].bubbleSelectors(n);return r},match:function(e){return!e||e.length===0},variables:function(){return this._variables?this._variables:this._variables=this.rules.reduce(function(t,n){return n instanceof e.Rule&&n.variable===!0&&(t[n.name]=n),t},{})},variable:function(e){return this.variables()[e]},rulesets:function(){return this._rulesets?this._rulesets:this._rulesets=this.rules.filter(function(t){return t instanceof e.Ruleset||t instanceof e.mixin.Definition})},find:function(t,n){n=n||this;var r=[],i,s,o=t.toCSS();return o in this._lookups?this._lookups[o]:(this.rulesets().forEach(function(i){if(i!==n)for(var o=0;o<i.selectors.length;o++)if(s=t.match(i.selectors[o])){t.elements.length>i.selectors[o].elements.length?Array.prototype.push.apply(r,i.find(new e.Selector(t.elements.slice(1)),n)):r.push(i);break}}),this._lookups[o]=r)},toCSS:function(t,n){var r=[],i=[],s=[],o=[],u=[],a,f,l;this.root||this.joinSelectors(u,t,this.selectors);for(var c=0;c<this.rules.length;c++)l=this.rules[c],l.rules||l instanceof e.Directive||l instanceof e.Media?o.push(l.toCSS(u,n)):l instanceof e.Comment?l.silent||(this.root?o.push(l.toCSS(n)):i.push(l.toCSS(n))):l.toCSS&&!l.variable?i.push(l.toCSS(n)):l.value&&!l.variable&&i.push(l.value.toString());o=o.join("");if(this.root)r.push(i.join(n.compress?"":"\n"));else if(i.length>0){f=e.debugInfo(n,this),a=u.map(function(e){return e.map(function(e){return e.toCSS(n)}).join("").trim()}).join(n.compress?",":",\n");for(var c=i.length-1;c>=0;c--)s.indexOf(i[c])===-1&&s.unshift(i[c]);i=s,r.push(f+a+(n.compress?"{":" {\n ")+i.join(n.compress?"":"\n ")+(n.compress?"}":"\n}\n"))}return r.push(o),r.join("")+(n.compress?"\n":"")},joinSelectors:function(e,t,n){for(var r=0;r<n.length;r++)this.joinSelector(e,t,n[r])},joinSelector:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d,v,m,g,y;for(i=0;i<r.elements.length;i++)f=r.elements[i],f.value==="&"&&(u=!0);if(!u){if(n.length>0)for(i=0;i<n.length;i++)t.push(n[i].concat(r));else t.push([r]);return}g=[],a=[[]];for(i=0;i<r.elements.length;i++){f=r.elements[i];if(f.value!=="&")g.push(f);else{y=[],g.length>0&&this.mergeElementsOnToSelectors(g,a);for(s=0;s<a.length;s++){l=a[s];if(n.length==0)l.length>0&&(l[0].elements=l[0].elements.slice(0),l[0].elements.push(new e.Element(f.combinator,"",0))),y.push(l);else for(o=0;o<n.length;o++)c=n[o],h=[],p=[],v=!0,l.length>0?(h=l.slice(0),m=h.pop(),d=new e.Selector(m.elements.slice(0)),v=!1):d=new e.Selector([]),c.length>1&&(p=p.concat(c.slice(1))),c.length>0&&(v=!1,d.elements.push(new e.Element(f.combinator,c[0].elements[0].value,0)),d.elements=d.elements.concat(c[0].elements.slice(1))),v||h.push(d),h=h.concat(p),y.push(h)}a=y,g=[]}}g.length>0&&this.mergeElementsOnToSelectors(g,a);for(i=0;i<a.length;i++)t.push(a[i])},mergeElementsOnToSelectors:function(t,n){var r,i;if(n.length==0){n.push([new e.Selector(t)]);return}for(r=0;r<n.length;r++)i=n[r],i.length>0?i[i.length-1]=new e.Selector(i[i.length-1].elements.concat(t)):i.push(new e.Selector(t))}}}(n("../tree")),function(e){e.Selector=function(e){this.elements=e},e.Selector.prototype.match=function(e){var t=this.elements.length,n=e.elements.length,r=Math.min(t,n);if(t<n)return!1;for(var i=0;i<r;i++)if(this.elements[i].value!==e.elements[i].value)return!1;return!0},e.Selector.prototype.eval=function(t){return new e.Selector(this.elements.map(function(e){return e.eval(t)}))},e.Selector.prototype.toCSS=function(e){return this._css?this._css:(this.elements[0].combinator.value===""?this._css=" ":this._css="",this._css+=this.elements.map(function(t){return typeof t=="string"?" "+t.trim():t.toCSS(e)}).join(""),this._css)}}(n("../tree")),function(t){t.URL=function(e,t){this.value=e,this.paths=t},t.URL.prototype={toCSS:function(){return"url("+this.value.toCSS()+")"},eval:function(n){var r=this.value.eval(n);return typeof e!="undefined"&&typeof r.value=="string"&&!/^(?:[a-z-]+:|\/)/.test(r.value)&&this.paths.length>0&&(r.value=this.paths[0]+(r.value.charAt(0)==="/"?r.value.slice(1):r.value)),new t.URL(r,this.paths)}}}(n("../tree")),function(e){e.Value=function(e){this.value=e,this.is="value"},e.Value.prototype={eval:function(t){return this.value.length===1?this.value[0].eval(t):new e.Value(this.value.map(function(e){return e.eval(t)}))},toCSS:function(e){return this.value.map(function(t){return t.toCSS(e)}).join(e.compress?",":", ")}}}(n("../tree")),function(e){e.Variable=function(e,t,n){this.name=e,this.index=t,this.file=n},e.Variable.prototype={eval:function(t){var n,r,i=this.name;i.indexOf("@@")==0&&(i="@"+(new e.Variable(i.slice(1))).eval(t).value);if(n=e.find(t.frames,function(e){if(r=e.variable(i))return r.value.eval(t)}))return n;throw{type:"Name",message:"variable "+i+" is undefined",filename:this.file,index:this.index}}}}(n("../tree")),function(e){e.debugInfo=function(t,n){var r="";if(t.dumpLineNumbers&&!t.compress)switch(t.dumpLineNumbers){case"comments":r=e.debugInfo.asComment(n);break;case"mediaquery":r=e.debugInfo.asMediaQuery(n);break;case"all":r=e.debugInfo.asComment(n)+e.debugInfo.asMediaQuery(n)}return r},e.debugInfo.asComment=function(e){return"/* line "+e.debugInfo.lineNumber+", "+e.debugInfo.fileName+" */\n"},e.debugInfo.asMediaQuery=function(e){return'@media -sass-debug-info{filename{font-family:"'+e.debugInfo.fileName+'";}line{font-family:"'+e.debugInfo.lineNumber+'";}}\n'},e.find=function(e,t){for(var n=0,r;n<e.length;n++)if(r=t.call(e,e[n]))return r;return null},e.jsify=function(e){return Array.isArray(e.value)&&e.value.length>1?"["+e.value.map(function(e){return e.toCSS(!1)}).join(", ")+"]":e.toCSS(!1)}}(n("./tree"));var s=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);r.env=r.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||s?"development":"production"),r.async=r.async||!1,r.fileAsync=r.fileAsync||!1,r.poll=r.poll||(s?1e3:1500),r.watch=function(){return this.watchMode=!0},r.unwatch=function(){return this.watchMode=!1};if(r.env==="development"){r.optimization=0,/!watch/.test(location.hash)&&r.watch();var o=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);o&&(r.dumpLineNumbers=o[1]),r.watchTimer=setInterval(function(){r.watchMode&&p(function(e,t,n,r,i){t&&m(t.toCSS(),r,i.lastModified)})},r.poll)}else r.optimization=3;var u;try{u=typeof e.localStorage=="undefined"?null:e.localStorage}catch(a){u=null}var f=document.getElementsByTagName("link"),l=/^text\/(x-)?less$/;r.sheets=[];for(var c=0;c<f.length;c++)(f[c].rel==="stylesheet/less"||f[c].rel.match(/stylesheet/)&&f[c].type.match(l))&&r.sheets.push(f[c]);r.refresh=function(e){var t,n;t=n=new Date,p(function(e,r,i,s,o){o.local?w("loading "+s.href+" from cache."):(w("parsed "+s.href+" successfully."),m(r.toCSS(),s,o.lastModified)),w("css for "+s.href+" generated in "+(new Date-n)+"ms"),o.remaining===0&&w("css generated in "+(new Date-t)+"ms"),n=new Date},e),h()},r.refreshStyles=h,r.refresh(r.env==="development"),typeof define=="function"&&define.amd&&define("less",[],function(){return r})})(window);
View
2 WinLess/Less/lessc.cmd
@@ -1,2 +0,0 @@
-::For convenience
-@cscript //nologo "%~dp0lessc.wsf" %*
View
206 WinLess/Less/lessc.wsf
@@ -1,206 +0,0 @@
-<!--
-Less.js compiler for Windows Script Host
-http://blog.dotsmart.net/
-
-Copyright (c) 2010, Duncan Smart
-Licensed under the Apache 2.0 License.
--->
-<job>
-<script language="jscript">
- // Stub out globals
- var window = this;
- var location = window.location = {
- port: 0,
- href: ''
- };
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var input = null;
-
- var util = {
- readText: function (filename) {
- //WScript.StdErr.WriteLine("readText: " + filename);
- var file = fso.OpenTextFile(filename);
- // Don't error on empty files
- var text = file.AtEndOfStream ? '' : file.ReadAll();
-
- // Strip off any UTF-8 BOM
- var utf8bom = String.fromCharCode(0xEF, 0xBB, 0xBF);
- if (text.substr(0, utf8bom.length) == utf8bom) {
- text = text.substr(utf8bom.length);
- }
- file.Close();
- return text;
- }
- };
-
- // XMLHttpRequest that just gets local files. Used when processing "@import"
- function XMLHttpRequest(){}
- XMLHttpRequest.prototype = {
- open: function (method, url, async) {
- this.url = url;
- },
- send: function () {
- // get the file path relative to the input less file/directory
- var currDir = fso.folderExists(input) ? input : fso.getParentFolderName(input);
- var filename = fso.BuildPath(currDir, this.url);
-
- //WScript.StdErr.WriteLine("XHR.send " + filename);
-
- // Little hack so *.less will resolve to *.less.css also. Helps with Visual Studio
- // ensuring that file BuildAction is set to Content and you get rudimentary syntax highlighting with no set up.
- if (filename.match(/.less$/i) && !fso.FileExists(filename)) {
- filename = filename.replace(/.less$/i, '.less.css');
- }
-
- try {
- this.status = 200;
- this.responseText = util.readText(filename);
- }
- catch (e) {
- this.status = 404;
- this.responseText = e.description;
- }
- },
- setRequestHeader: function () {},
- getResponseHeader: function () {}
- };
-
- // Fake document
- var document = {
- _dummyElement: {
- childNodes: [],
- appendChild: function(){},
- style: {}
- },
- getElementsByTagName: function(){ return []; },
- getElementById: function(){ return this._dummyElement; },
- createElement: function(){ return this._dummyElement; },
- createTextNode: function(){ return this._dummyElement; }
- };
-
-</script>
-
-<!-- less.js from https://github.com/cloudhead/less.js/tree/master/dist/ -->
-<script language="jscript" src="less.js" />
-
-<script language="jscript">
- // Parse args
- var args = {};
- for (var i = 0; i < WScript.Arguments.Length; i++) {
- var arg = WScript.Arguments.Item(i);
- // Handle "-switch" and "--switch"
- var match = arg.match(/^--?([a-z][0-9a-z-]*)$/i);
- if (match) {
- i = match[1];
- arg = true;
- }
- args[i] = arg;
- }
-
- input = args[0];
- var output = args[1];
-
- if (fso.folderExists(input)) {
- input = fso.getAbsolutePathName(input);
- var files = getFiles(input, /\.less$/i);
- for (var i = 0; i < files.length; i++) {
- var file = files[i];
- convert(file.path, output + '\\' + file.name.replace( /\.less$/i, '.css'));
- }
- }
- else {
- if (fso.folderexists(output)) {
- output = fso.getAbsolutePathName(output) + '\\' + fso.getfile(input).name.replace(/\.less$/i, '.css');
- }
- convert(input, output);
- }
-
- // Returns array of {name:'foo.bar', path:'c:\baz\foo.bar'} for given directory and pattern
- function getFiles(dir, regex) {
- var e = new Enumerator(fso.getFolder(dir).files);
- var files = []
- for (; !e.atEnd(); e.moveNext()) {
- if (regex.test(e.item().path)) {
- files.push({
- name: e.item().name,
- path: e.item().path
- });
- }
- }
- return files;
- }
-
- function convert(input, output) {
- if (!input) {
- WScript.StdErr.WriteLine("lessc.wsf: no input files");
- WScript.StdErr.WriteLine("Usage:");
- WScript.StdErr.WriteLine(" Single file: cscript //nologo lessc.wsf input.less [output.css] [-compress]");
- WScript.StdErr.WriteLine(" Directory: cscript //nologo lessc.wsf inputdir outputdir [-compress]");
- WScript.Quit(1);
- }
-
- var data;
- if (input == '-') {
- var chunks = [];
- while (!WScript.StdIn.AtEndOfStream)
- chunks.push(WScript.StdIn.ReadAll());
- data = chunks.join('');
- }
- else {
- data = util.readText(input);
- }
-
- var parser = new less.Parser({
- filename: input
- });
-
- try {
- parser.parse(data, function (err, tree) {
-
- if (err) {
- WScript.StdErr.WriteLine("ERR: ");
- for (var i in err) {
- if (err[i]) {
- WScript.StdErr.WriteLine(" " + i + ': ' + err[i]);
- }
- }
- WScript.Quit(2);
- }
- else {
- var css = tree.toCSS({
- compress: args.compress
- });
- if (output) {
- var outputfile = fso.CreateTextFile(output);
- outputfile.Write(css);
- outputfile.Close();
- }
- else {
- WScript.StdOut.Write(css);
- }
- }
- });
- }
- catch (e) {
- WScript.StdErr.WriteLine("ERROR:");
- for (var i in e) {
- if (e[i]) {
- WScript.StdErr.WriteLine(" " + i + ': ' + e[i]);
- }
- }
- WScript.Quit(3);
- }
-
- // Sometimes less will return errors inside the fake HTML element
- if (document._dummyElement.innerHTML && document._dummyElement.innerHTML.match(/Syntax Error/i)) {
- var s = document._dummyElement.innerHTML;
- s = s.replace(/<[^>]+(\/?)>/g, function (m) { return m.indexOf('/') > 0 && m !== '</label>' ? "\n" : '' });
- s = s.replace(/\n+/g, '\n');
-
- WScript.StdErr.WriteLine("ERR: ");
- WScript.StdErr.WriteLine(s);
- WScript.Quit(2);
- }
- }
-</script>
-</job>
View
109 WinLess/LessCompiler.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+using System.IO;
+using WinLess.Models;
+using WinLess.Helpers;
+using System.Text.RegularExpressions;
+
+namespace WinLess
+{
+ static class LessCompiler
+ {
+ public static void CompileLessFile(string lessPath, string cssPath, bool minify)
+ {
+ try
+ {
+ CompileCommandResult compileResult = ExecuteCompileCommand(lessPath, cssPath, minify);
+ mainForm.ActiveOrInActiveMainForm.AddCompileResult(compileResult);
+ }
+ catch (Exception e)
+ {
+ ExceptionHandler.LogException(e);
+ }
+ }
+
+ public static string GetVersion()
+ {
+ string fileName = string.Format("{0}\\node_modules\\.bin\\lessc.cmd", Application.StartupPath);
+ string arguments = " -v";
+ CommandResult result = ExecuteCommand(fileName, arguments);
+ string version = "";
+ if (result.IsSuccess){
+ Match versionMatch = Regex.Match(result.ResultText, "\\d+(?:\\.\\d+)+");
+ if (versionMatch.Groups.Count > 0)
+ {
+ version = versionMatch.Groups[0].Value;
+ }
+ }
+ return version;
+ }
+
+ private static CompileCommandResult ExecuteCompileCommand(string lessPath, string cssPath, bool minify)
+ {
+ string fileName = string.Format("{0}\\node_modules\\.bin\\lessc.cmd", Application.StartupPath);
+ string arguments = CreateCompileArguments(lessPath, cssPath, minify);
+
+ CompileCommandResult result = new CompileCommandResult(ExecuteCommand(fileName, arguments));
+ result.FullPath = lessPath;
+
+ return result;
+ }
+
+ private static string CreateCompileArguments(string lessPath, string cssPath, bool minify)
+ {
+ string arguments = string.Format("\"{0}\" \"{1}\" --no-color", lessPath, cssPath);
+ if (minify)
+ {
+ arguments = string.Format("{0} --yui-compress", arguments);
+ }
+
+ return arguments;
+ }
+
+ private static CommandResult ExecuteCommand(string fileName, string arguments){
+ CommandResult result = new CommandResult();
+
+ try
+ {
+ System.Diagnostics.Process process = new System.Diagnostics.Process();
+
+ process.StartInfo = new System.Diagnostics.ProcessStartInfo()
+ {
+ FileName = fileName,
+ Arguments = arguments,
+ WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden,
+ CreateNoWindow = true,
+ UseShellExecute = false,
+ RedirectStandardError = true,
+ RedirectStandardOutput = true
+ };
+
+ process.Start();
+
+ string error = process.StandardError.ReadToEnd();
+ if(error.Length > 0){
+ result.ResultText = error;
+ }
+ else{
+ result.ResultText = process.StandardOutput.ReadToEnd();
+ result.IsSuccess = true;
+ }
+
+ process.WaitForExit();
+ result.Time = DateTime.Now;
+
+ return result;
+ }
+ catch (Exception e)
+ {
+ result.Time = DateTime.Now;
+ result.IsSuccess = false;
+ result.ResultText = e.Message;
+ }
+
+ return result;
+ }
+ }
+}
View
4 WinLess/Models/CommandLineArguments.cs → WinLess/Models/CommandArguments.cs
@@ -5,9 +5,9 @@
namespace WinLess.Models
{
- public class CommandLineArguments
+ public class CommandArguments
{
- public CommandLineArguments(string[] args)
+ public CommandArguments(string[] args)
{
HasArguments = args.Length > 0;
ConsoleExit = false;
View
15 WinLess/Models/CompileResult.cs → WinLess/Models/CommandResult.cs
@@ -4,9 +4,12 @@
namespace WinLess.Models
{
- public class CompileResult
- {
- #region Properties
+ public class CommandResult {
+ public CommandResult()
+ {
+ IsSuccess = false;
+ ResultText = "";
+ }
public string TimeString
{
@@ -15,14 +18,14 @@ public string TimeString
return Time.ToLongTimeString();
}
}
-
+
public DateTime Time
{
get;
set;
}
- public string FullPath
+ public bool IsSuccess
{
get;
set;
@@ -33,7 +36,5 @@ public string ResultText
get;
set;
}
-
- #endregion
}
}
View
26 WinLess/Models/CompileCommandResult.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WinLess.Models
+{
+ public class CompileCommandResult : CommandResult
+ {
+ public CompileCommandResult(CommandResult result)
+ {
+ this.Time = result.Time;
+ this.IsSuccess = result.IsSuccess;
+ this.ResultText = result.ResultText;
+ }
+
+ #region Properties
+
+ public string FullPath
+ {
+ get;
+ set;
+ }
+
+ #endregion
+ }
+}
View
3 WinLess/Models/File.cs
@@ -5,7 +5,6 @@
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using WinLess.Helpers;
-using WinLess.Less;
namespace WinLess.Models
{
@@ -115,7 +114,7 @@ public void Compile(bool compileParentFiles = true)
{
if (this.Enabled)
{
- Compiler.CompileLessFile(this.FullPath, this.OutputPath, this.Minify);
+ LessCompiler.CompileLessFile(this.FullPath, this.OutputPath, this.Minify);
}
if (compileParentFiles)
{
View
2 WinLess/Program.cs
@@ -15,7 +15,7 @@ static class Program
[STAThread]
static void Main(string[] args)
{
- CommandLineArguments commandLineArguments = new CommandLineArguments(args);
+ CommandArguments commandLineArguments = new CommandArguments(args);
if (!commandLineArguments.ConsoleExit)
{
Application.EnableVisualStyles();
View
4 WinLess/Properties/AssemblyInfo.cs
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.4.0")]
-[assembly: AssemblyFileVersion("1.5.4.0")]
+[assembly: AssemblyVersion("1.6.0.0")]
+[assembly: AssemblyFileVersion("1.6.0.0")]
View
10 WinLess/Properties/DataSources/winless.Models.CompileResult.datasource
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- This file is automatically generated by Visual Studio .Net. It is
- used to store generic object data source configuration information.
- Renaming the file extension or editing the content of this file may
- cause the file to be unrecognizable by the program.
--->
-<GenericObjectDataSource DisplayName="CompileResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
- <TypeInfo>WinLess.Models.CompileResult, WinLess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
-</GenericObjectDataSource>
View
10 WinLess/Properties/DataSources/winless.Models.Directory.datasource
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- This file is automatically generated by Visual Studio .Net. It is
- used to store generic object data source configuration information.
- Renaming the file extension or editing the content of this file may
- cause the file to be unrecognizable by the program.
--->
-<GenericObjectDataSource DisplayName="Directory" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
- <TypeInfo>WinLess.Models.Directory, WinLess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
-</GenericObjectDataSource>
View
10 WinLess/Properties/DataSources/winless.Models.File.datasource
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- This file is automatically generated by Visual Studio .Net. It is
- used to store generic object data source configuration information.
- Renaming the file extension or editing the content of this file may
- cause the file to be unrecognizable by the program.
--->
-<GenericObjectDataSource DisplayName="File" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
- <TypeInfo>WinLess.Models.File, WinLess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
-</GenericObjectDataSource>
View
63 WinLess/Properties/Resources.Designer.cs
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace WinLess.Properties {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinLess.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
View
117 WinLess/Properties/Resources.resx
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root>
View
26 WinLess/Properties/Settings.Designer.cs
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.239
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace WinLess.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
View
7 WinLess/Properties/Settings.settings
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
- <Profiles>
- <Profile Name="(Default)" />
- </Profiles>
- <Settings />
-</SettingsFile>
View
2 WinLess/SingleInstanceController.cs
@@ -20,7 +20,7 @@ private void this_StartupNextInstance(object sender, StartupNextInstanceEventArg
string[] args = new string[eventArgs.CommandLine.Count];
eventArgs.CommandLine.CopyTo(args, 0);
- CommandLineArguments commandLineArguments = new CommandLineArguments(args);
+ CommandArguments commandLineArguments = new CommandArguments(args);
if (!commandLineArguments.ConsoleExit)
{
mainForm form = (mainForm)this.MainForm;
View
215 WinLess/WinLess.csproj
@@ -56,10 +56,11 @@
<Compile Include="Forms\aboutForm.Designer.cs">
<DependentUpon>aboutForm.cs</DependentUpon>
</Compile>
- <Compile Include="Less\Compiler.cs" />
+ <Compile Include="LessCompiler.cs" />
<Compile Include="Helpers\ExceptionHandler.cs" />
- <Compile Include="Models\CommandLineArguments.cs" />
- <Compile Include="Models\CompileResult.cs" />
+ <Compile Include="Models\CommandResult.cs" />
+ <Compile Include="Models\CommandArguments.cs" />
+ <Compile Include="Models\CompileCommandResult.cs" />
<Compile Include="Models\Directory.cs" />
<Compile Include="Forms\mainForm.cs">
<SubType>Form</SubType>
@@ -80,55 +81,197 @@
</Compile>
<Compile Include="Helpers\AutoStartUtil.cs" />
<Compile Include="SingleInstanceController.cs" />
+ <Content Include="node_modules\.bin\node.exe" />
+ <Content Include="node_modules\less\benchmark\benchmark.less" />
+ <Content Include="node_modules\less\benchmark\less-benchmark.js" />
+ <Content Include="node_modules\less\build\amd.js" />
+ <Content Include="node_modules\less\build\ecma-5.js" />
+ <Content Include="node_modules\less\build\header.js" />
+ <Content Include="node_modules\less\build\require-rhino.js" />
+ <Content Include="node_modules\less\build\require.js" />
+ <Content Include="node_modules\less\dist\less-1.1.0.js" />
+ <Content Include="node_modules\less\dist\less-1.1.0.min.js" />
+ <Content Include="node_modules\less\dist\less-1.1.1.js" />
+ <Content Include="node_modules\less\dist\less-1.1.1.min.js" />
+ <Content Include="node_modules\less\dist\less-1.1.2.js" />
+ <Content Include="node_modules\less\dist\less-1.1.2.min.js" />
+ <Content Include="node_modules\less\dist\less-1.1.3.js" />
+ <Content Include="node_modules\less\dist\less-1.1.3.min.js" />
+ <Content Include="node_modules\less\dist\less-1.1.4.js" />
+ <Content Include="node_modules\less\dist\less-1.1.4.min.js" />
+ <Content Include="node_modules\less\dist\less-1.1.5.js" />
+ <Content Include="node_modules\less\dist\less-1.1.5.min.js" />
+ <Content Include="node_modules\less\dist\less-1.1.6.js" />
+ <Content Include="node_modules\less\dist\less-1.1.6.min.js" />
+ <Content Include="node_modules\less\dist\less-1.2.0.js" />
+ <Content Include="node_modules\less\dist\less-1.2.0.min.js" />
+ <Content Include="node_modules\less\dist\less-1.2.1.js" />
+ <Content Include="node_modules\less\dist\less-1.2.1.min.js" />
+ <Content Include="node_modules\less\dist\less-1.2.2.js" />
+ <Content Include="node_modules\less\dist\less-1.2.2.min.js" />
+ <Content Include="node_modules\less\dist\less-1.3.0.js" />
+ <Content Include="node_modules\less\dist\less-1.3.0.min.js" />
+ <Content Include="node_modules\less\dist\less-1.3.1.js" />
+ <Content Include="node_modules\less\dist\less-1.3.1.min.js" />
+ <Content Include="node_modules\less\dist\less-rhino-1.1.3.js" />
+ <Content Include="node_modules\less\dist\less-rhino-1.1.5.js" />
+ <Content Include="node_modules\less\dist\less-rhino-1.3.1.js" />
+ <Content Include="node_modules\less\lib\less\browser.js" />
+ <Content Include="node_modules\less\lib\less\colors.js" />
+ <Content Include="node_modules\less\lib\less\cssmin.js" />
+ <Content Include="node_modules\less\lib\less\functions.js" />
+ <Content Include="node_modules\less\lib\less\index.js" />
+ <Content Include="node_modules\less\lib\less\lessc_helper.js" />
+ <Content Include="node_modules\less\lib\less\parser.js" />
+ <Content Include="node_modules\less\lib\less\rhino.js" />
+ <Content Include="node_modules\less\lib\less\tree.js" />
+ <Content Include="node_modules\less\lib\less\tree\alpha.js" />
+ <Content Include="node_modules\less\lib\less\tree\anonymous.js" />
+ <Content Include="node_modules\less\lib\less\tree\assignment.js" />
+ <Content Include="node_modules\less\lib\less\tree\call.js" />
+ <Content Include="node_modules\less\lib\less\tree\color.js" />
+ <Content Include="node_modules\less\lib\less\tree\comment.js" />
+ <Content Include="node_modules\less\lib\less\tree\condition.js" />
+ <Content Include="node_modules\less\lib\less\tree\dimension.js" />
+ <Content Include="node_modules\less\lib\less\tree\directive.js" />
+ <Content Include="node_modules\less\lib\less\tree\element.js" />
+ <Content Include="node_modules\less\lib\less\tree\expression.js" />
+ <Content Include="node_modules\less\lib\less\tree\import.js" />
+ <Content Include="node_modules\less\lib\less\tree\javascript.js" />
+ <Content Include="node_modules\less\lib\less\tree\keyword.js" />
+ <Content Include="node_modules\less\lib\less\tree\media.js" />
+ <Content Include="node_modules\less\lib\less\tree\mixin.js" />
+ <Content Include="node_modules\less\lib\less\tree\operation.js" />
+ <Content Include="node_modules\less\lib\less\tree\paren.js" />
+ <Content Include="node_modules\less\lib\less\tree\quoted.js" />
+ <Content Include="node_modules\less\lib\less\tree\ratio.js" />
+ <Content Include="node_modules\less\lib\less\tree\rule.js" />
+ <Content Include="node_modules\less\lib\less\tree\ruleset.js" />
+ <Content Include="node_modules\less\lib\less\tree\selector.js" />
+ <Content Include="node_modules\less\lib\less\tree\url.js" />
+ <Content Include="node_modules\less\lib\less\tree\value.js" />
+ <Content Include="node_modules\less\lib\less\tree\variable.js" />
+ <Content Include="node_modules\less\test\css\colors.css" />
+ <Content Include="node_modules\less\test\css\comments.css" />
+ <Content Include="node_modules\less\test\css\css-3.css" />
+ <Content Include="node_modules\less\test\css\css-escapes.css" />
+ <Content Include="node_modules\less\test\css\css.css" />
+ <Content Include="node_modules\less\test\css\debug\linenumbers-all.css" />
+ <Content Include="node_modules\less\test\css\debug\linenumbers-comments.css" />
+ <Content Include="node_modules\less\test\css\debug\linenumbers-mediaquery.css" />
+ <Content Include="node_modules\less\test\css\functions.css" />
+ <Content Include="node_modules\less\test\css\ie-filters.css" />
+ <Content Include="node_modules\less\test\css\import-once.css" />
+ <Content Include="node_modules\less\test\css\import.css" />
+ <Content Include="node_modules\less\test\css\javascript.css" />
+ <Content Include="node_modules\less\test\css\lazy-eval.css" />
+ <Content Include="node_modules\less\test\css\media.css" />
+ <Content Include="node_modules\less\test\css\mixins-args.css" />
+ <Content Include="node_modules\less\test\css\mixins-closure.css" />
+ <Content Include="node_modules\less\test\css\mixins-guards.css" />
+ <Content Include="node_modules\less\test\css\mixins-important.css" />
+ <Content Include="node_modules\less\test\css\mixins-named-args.css" />
+ <Content Include="node_modules\less\test\css\mixins-nested.css" />
+ <Content Include="node_modules\less\test\css\mixins-pattern.css" />
+ <Content Include="node_modules\less\test\css\mixins.css" />
+ <Content Include="node_modules\less\test\css\operations.css" />
+ <Content Include="node_modules\less\test\css\parens.css" />
+ <Content Include="node_modules\less\test\css\rulesets.css" />
+ <Content Include="node_modules\less\test\css\scope.css" />
+ <Content Include="node_modules\less\test\css\selectors.css" />
+ <Content Include="node_modules\less\test\css\strings.css" />
+ <Content Include="node_modules\less\test\css\variables.css" />
+ <Content Include="node_modules\less\test\css\whitespace.css" />
+ <Content Include="node_modules\less\test\less-test.js" />
+ <Content Include="node_modules\less\test\less\colors.less" />
+ <Content Include="node_modules\less\test\less\comments.less" />
+ <Content Include="node_modules\less\test\less\css-3.less" />
+ <Content Include="node_modules\less\test\less\css-escapes.less" />
+ <Content Include="node_modules\less\test\less\css.less" />
+ <Content Include="node_modules\less\test\less\debug\import\test.less" />
+ <Content Include="node_modules\less\test\less\debug\linenumbers.less" />
+ <Content Include="node_modules\less\test\less\errors\comment-in-selector.less" />
+ <Content Include="node_modules\less\test\less\errors\comment-in-selector.txt" />
+ <Content Include="node_modules\less\test\less\errors\import-missing.less" />
+ <Content Include="node_modules\less\test\less\errors\import-missing.txt" />
+ <Content Include="node_modules\less\test\less\errors\import-no-semi.less" />
+ <Content Include="node_modules\less\test\less\errors\import-no-semi.txt" />
+ <Content Include="node_modules\less\test\less\errors\import-subfolder1.less" />
+ <Content Include="node_modules\less\test\less\errors\import-subfolder1.txt" />
+ <Content Include="node_modules\less\test\less\errors\import-subfolder2.less" />
+ <Content Include="node_modules\less\test\less\errors\import-subfolder2.txt" />
+ <Content Include="node_modules\less\test\less\errors\imports\import-subfolder1.less" />
+ <Content Include="node_modules\less\test\less\errors\imports\import-subfolder2.less" />
+ <Content Include="node_modules\less\test\less\errors\imports\subfolder\mixin-not-defined.less" />
+ <Content Include="node_modules\less\test\less\errors\imports\subfolder\parse-error-curly-bracket.less" />
+ <Content Include="node_modules\less\test\less\errors\javascript-error.less" />
+ <Content Include="node_modules\less\test\less\errors\javascript-error.txt" />
+ <Content Include="node_modules\less\test\less\errors\mixin-not-defined.less" />
+ <Content Include="node_modules\less\test\less\errors\mixin-not-defined.txt" />
+ <Content Include="node_modules\less\test\less\errors\parse-error-curly-bracket.less" />
+ <Content Include="node_modules\less\test\less\errors\parse-error-curly-bracket.txt" />
+ <Content Include="node_modules\less\test\less\errors\parse-error-missing-bracket.less" />
+ <Content Include="node_modules\less\test\less\errors\parse-error-missing-bracket.txt" />
+ <Content Include="node_modules\less\test\less\errors\property-ie5-hack.less" />
+ <Content Include="node_modules\less\test\less\errors\property-ie5-hack.txt" />
+ <Content Include="node_modules\less\test\less\functions.less" />
+ <Content Include="node_modules\less\test\less\ie-filters.less" />
+ <Content Include="node_modules\less\test\less\import-once.less" />
+ <Content Include="node_modules\less\test\less\import.less" />
+ <Content Include="node_modules\less\test\less\import\deeper\import-once-test-a.less" />
+ <Content Include="node_modules\less\test\less\import\import-once-test-c.less" />
+ <Content Include="node_modules\less\test\less\import\import-test-a.less" />
+ <Content Include="node_modules\less\test\less\import\import-test-b.less" />
+ <Content Include="node_modules\less\test\less\import\import-test-c.less" />
+ <Content Include="node_modules\less\test\less\import\import-test-d.css" />
+ <Content Include="node_modules\less\test\less\import\import-test-e.less" />
+ <Content Include="node_modules\less\test\less\javascript.less" />
+ <Content Include="node_modules\less\test\less\lazy-eval.less" />
+ <Content Include="node_modules\less\test\less\media.less" />
+ <Content Include="node_modules\less\test\less\mixins-args.less" />
+ <Content Include="node_modules\less\test\less\mixins-closure.less" />
+ <Content Include="node_modules\less\test\less\mixins-guards.less" />
+ <Content Include="node_modules\less\test\less\mixins-important.less" />
+ <Content Include="node_modules\less\test\less\mixins-named-args.less" />
+ <Content Include="node_modules\less\test\less\mixins-nested.less" />
+ <Content Include="node_modules\less\test\less\mixins-pattern.less" />
+ <Content Include="node_modules\less\test\less\mixins.less" />
+ <Content Include="node_modules\less\test\less\operations.less" />
+ <Content Include="node_modules\less\test\less\parens.less" />
+ <Content Include="node_modules\less\test\less\rulesets.less" />
+ <Content Include="node_modules\less\test\less\scope.less" />
+ <Content Include="node_modules\less\test\less\selectors.less" />
+ <Content Include="node_modules\less\test\less\strings.less" />
+ <Content Include="node_modules\less\test\less\variables.less" />
+ <Content Include="node_modules\less\test\less\whitespace.less" />
<EmbeddedResource Include="Forms\aboutForm.resx">
<DependentUpon>aboutForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\mainForm.resx">
<DependentUpon>mainForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <Compile Include="Properties\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Resources.resx</DependentUpon>
- <DesignTime>True</DesignTime>
- </Compile>
<EmbeddedResource Include="Forms\settingsForm.resx">
<DependentUpon>settingsForm.cs</DependentUpon>
</EmbeddedResource>
<Content Include="icon.ico" />
- <Content Include="Less\lessc.cmd">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
<None Include="app.config" />
+ <None Include="node_modules\.bin\lessc" />
+ <None Include="node_modules\.bin\lessc.cmd" />
+ <None Include="node_modules\less\.npmignore" />
+ <None Include="node_modules\less\bin\lessc" />
+ <None Include="node_modules\less\CHANGELOG.md" />
+ <None Include="node_modules\less\LICENSE" />
+ <None Include="node_modules\less\Makefile" />
+ <None Include="node_modules\less\package.json" />
+ <None Include="node_modules\less\README.md" />
<None Include="packages.config" />
- <None Include="Properties\DataSources\WinLess.Models.CompileResult.datasource" />
- <None Include="Properties\DataSources\WinLess.Models.Directory.datasource" />
- <None Include="Properties\DataSources\WinLess.Models.File.datasource" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Settings.settings</DependentUpon>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <Content Include="Less\less.js">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
- <Content Include="Less\lessc.wsf">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>ROBOCOPY "$(ProjectDir)node_modules" "$(TargetDir)node_modules" * /COPYALL /S</PostBuildEvent>
+ </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
View
15 WinLess/node_modules/.bin/lessc
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=`dirname "$0"`
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../less/bin/lessc" "$@"
+ ret=$?
+else
+ node "$basedir/../less/bin/lessc" "$@"
+ ret=$?
+fi
+exit $ret
View
6 WinLess/node_modules/.bin/lessc.cmd
@@ -0,0 +1,6 @@
+:: Created by npm, please don't edit manually.
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\less\bin\lessc" %*
+) ELSE (
+ node "%~dp0\..\less\bin\lessc" %*
+)
View
BIN WinLess/node_modules/.bin/node.exe
Binary file not shown.
View
5 WinLess/node_modules/less/.npmignore
@@ -0,0 +1,5 @@
+node_modules
+.emacs*
+*.flymake
+*~
+.#*
View
49 WinLess/node_modules/less/CHANGELOG.md
@@ -0,0 +1,49 @@
+# 1.3.0
+
+2012-03-10
+
+- @media bubbling
+- Support arbitrary entities as selectors
+- [Variadic argument support](https://gist.github.com/1933613)
+- Behaviour of zero-arity mixins has [changed](https://gist.github.com/1933613)
+- Allow `@import` directives in any selector
+- Media-query features can now be a variable
+- Automatic merging of media-query conditions
+- Fix global variable leaks
+- Fix error message on wrong-arity call
+- Fix an `@arguments` behaviour bug
+- Fix `::` selector output
+- Fix a bug when using @media with mixins
+
+
+# 1.2.1
+
+2012-01-15
+
+- Fix imports in browser
+- Improve error reporting in browser
+- Fix Runtime error reports from imported files
+- Fix `File not found` import error reporting
+
+
+# 1.2.0
+
+2012-01-07
+
+- Mixin guards
+- New function `percentage`
+- New `color` function to parse hex color strings
+- New type-checking stylesheet functions
+- Fix Rhino support
+- Fix bug in string arguments to mixin call
+- Fix error reporting when index is 0
+- Fix browser support in WebKit and IE
+- Fix string interpolation bug when var is empty
+- Support `!important` after mixin calls
+- Support vanilla @keyframes directive
+- Support variables in certain css selectors, like `nth-child`
+- Support @media and @import features properly
+- Improve @import support with media features
+- Improve error reports from imported files
+- Improve function call error reporting
+- Improve error-reporting
View
179 WinLess/node_modules/less/LICENSE
@@ -0,0 +1,179 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+Copyright (c) 2009-2010 Alexis Sellier
View
76 WinLess/node_modules/less/Makefile
@@ -0,0 +1,76 @@
+#
+# Run all tests
+#
+test:
+ node test/less-test.js
+
+#
+# Run benchmark
+#
+benchmark:
+ node benchmark/less-benchmark.js
+
+#
+# Build less.js
+#
+SRC = lib/less
+HEADER = build/header.js
+VERSION = `cat package.json | grep version \
+ | grep -o '[0-9]\.[0-9]\.[0-9]\+'`
+DIST = dist/less-${VERSION}.js
+RHINO = dist/less-rhino-${VERSION}.js
+DIST_MIN = dist/less-${VERSION}.min.js
+
+less:
+ @@mkdir -p dist
+ @@touch ${DIST}
+ @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
+ @@echo "(function (window, undefined) {" >> ${DIST}
+ @@cat build/require.js\
+ build/ecma-5.js\
+ ${SRC}/parser.js\
+ ${SRC}/functions.js\
+ ${SRC}/colors.js\
+ ${SRC}/tree/*.js\
+ ${SRC}/tree.js\
+ ${SRC}/browser.js\
+ build/amd.js >> ${DIST}
+ @@echo "})(window);" >> ${DIST}
+ @@echo ${DIST} built.
+
+rhino:
+ @@mkdir -p dist
+ @@touch ${RHINO}
+ @@cat build/require-rhino.js\
+ build/ecma-5.js\
+ ${SRC}/parser.js\
+ ${SRC}/functions.js\
+ ${SRC}/colors.js\
+ ${SRC}/tree/*.js\
+ ${SRC}/tree.js\
+ ${SRC}/rhino.js > ${RHINO}
+ @@echo ${RHINO} built.
+
+min: less
+ @@echo minifying...
+ @@uglifyjs ${DIST} > ${DIST_MIN}
+ @@echo ${DIST_MIN} built.
+
+server: less
+ cp dist/less-${VERSION}.js test/html/
+ cd test/html && python -m SimpleHTTPServer
+
+clean:
+ git rm dist/*
+
+dist: clean min
+ git add dist/*
+ git commit -a -m "(dist) build ${VERSION}"
+ git archive master --prefix=less/ -o less-${VERSION}.tar.gz
+ npm publish less-${VERSION}.tar.gz
+
+stable:
+ npm tag less ${VERSION} stable
+
+
+.PHONY: test benchmark
View
20 WinLess/node_modules/less/README.md
@@ -0,0 +1,20 @@
+less.js
+=======
+
+The **dynamic** stylesheet language.
+
+<http://lesscss.org>
+
+about
+-----
+
+This is the JavaScript, and now official, stable version of LESS.
+
+For more information, visit <http://lesscss.org>.
+
+license
+-------
+
+See `LICENSE` file.
+
+> Copyright (c) 2009-2011 Alexis Sellier
View
3,979 WinLess/node_modules/less/benchmark/benchmark.less
3,979 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
47 WinLess/node_modules/less/benchmark/less-benchmark.js
@@ -0,0 +1,47 @@
+var path = require('path'),
+ fs = require('fs'),
+ sys = require('util');
+
+var less = require('../lib/less');
+var file = path.join(__dirname, 'benchmark.less');
+
+if (process.argv[2]) { file = path.join(process.cwd(), process.argv[2]) }
+
+fs.readFile(file, 'utf8', function (e, data) {
+ var tree, css, start, end, total;
+
+ sys.puts("Benchmarking...\n", path.basename(file) + " (" +
+ parseInt(data.length / 1024) + " KB)", "");
+
+ start = new(Date);
+
+ new(less.Parser)({ optimization: 2 }).parse(data, function (err, tree) {
+ end = new(Date);
+
+ total = end - start;
+
+ sys.puts("Parsing: " +
+ total + " ms (" +
+ parseInt(1000 / total *
+ data.length / 1024) + " KB\/s)");
+
+ start = new(Date);
+ css = tree.toCSS();
+ end = new(Date);
+
+ sys.puts("Generation: " + (end - start) + " ms (" +
+ parseInt(1000 / (end - start) *
+ data.length / 1024) + " KB\/s)");
+
+ total += end - start;
+
+ sys.puts("Total: " + total + "ms (" +
+ parseInt(1000 / total * data.length / 1024) + " KB/s)");
+
+ if (err) {
+ less.writeError(err);
+ process.exit(3);
+ }
+ });
+});
+
View
394 WinLess/node_modules/less/lib/less/browser.js
@@ -0,0 +1,394 @@
+//
+// browser.js - client-side engine
+//
+
+var isFileProtocol = /^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);
+
+less.env = less.env || (location.hostname == '127.0.0.1' ||
+ location.hostname == '0.0.0.0' ||
+ location.hostname == 'localhost' ||
+ location.port.length > 0 ||
+ isFileProtocol ? 'development'
+ : 'production');
+
+// Load styles asynchronously (default: false)
+//
+// This is set to `false` by default, so that the body
+// doesn't start loading before the stylesheets are parsed.
+// Setting this to `true` can result in flickering.
+//
+less.async = less.async || false;
+less.fileAsync = less.fileAsync || false;
+
+// Interval between watch polls
+less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
+
+//
+// Watch mode
+//
+less.watch = function () { return this.watchMode = true };
+less.unwatch = function () { return this.watchMode = false };
+
+if (less.env === 'development') {
+ less.optimization = 0;
+
+ if (/!watch/.test(location.hash)) {
+ less.watch();
+ }
+ var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);
+ if (dumpLineNumbers) {
+ less.dumpLineNumbers = dumpLineNumbers[1];
+ }
+ less.watchTimer = setInterval(function () {
+ if (less.watchMode) {
+ loadStyleSheets(function (e, root, _, sheet, env) {
+ if (root) {
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ });
+ }
+ }, less.poll);
+} else {
+ less.optimization = 3;
+}
+
+var cache;
+
+try {
+ cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;