Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/marklagendijk/WinLess

  • Loading branch information...
commit 41a26b1b8e61120aaab6b7be8306a76eb4732c4f 2 parents 677d3c7 + dfa628d
@marklagendijk authored
Showing with 13,462 additions and 487 deletions.
  1. +8 −0 CHANGELOG.md
  2. +7 −1 Installer/WinLess.warsetup
  3. +47 −21 WinLess/Forms/aboutForm.Designer.cs
  4. +30 −2 WinLess/Forms/aboutForm.cs
  5. +18 −1 WinLess/Forms/mainForm.cs
  6. +27 −14 WinLess/Forms/settingsForm.Designer.cs
  7. +2 −0  WinLess/Forms/settingsForm.cs
  8. +52 −17 WinLess/LessCompiler.cs
  9. +2 −2 WinLess/Models/File.cs
  10. +2 −2 WinLess/Properties/AssemblyInfo.cs
  11. +3 −2 WinLess/Settings.cs
  12. +1,980 −0 WinLess/WinLess.csproj
  13. +15 −0 WinLess/node_modules/.bin/npm
  14. +6 −0 WinLess/node_modules/.bin/npm.cmd
  15. +1 −5 WinLess/node_modules/less/.npmignore
  16. +70 −1 WinLess/node_modules/less/CHANGELOG.md
  17. +50 −0 WinLess/node_modules/less/CONTRIBUTING.md
  18. +11 −0 WinLess/node_modules/less/Makefile
  19. +171 −46 WinLess/node_modules/less/lib/less/browser.js
  20. +57 −17 WinLess/node_modules/less/lib/less/functions.js
  21. +107 −31 WinLess/node_modules/less/lib/less/index.js
  22. +5 −2 WinLess/node_modules/less/lib/less/lessc_helper.js
  23. +134 −57 WinLess/node_modules/less/lib/less/parser.js
  24. +1 −1  WinLess/node_modules/less/lib/less/rhino.js
  25. +3 −1 WinLess/node_modules/less/lib/less/tree.js
  26. +12 −6 WinLess/node_modules/less/lib/less/tree/call.js
  27. +3 −1 WinLess/node_modules/less/lib/less/tree/dimension.js
  28. +2 −1  WinLess/node_modules/less/lib/less/tree/element.js
  29. +11 −12 WinLess/node_modules/less/lib/less/tree/import.js
  30. +3 −5 WinLess/node_modules/less/lib/less/tree/media.js
  31. +120 −54 WinLess/node_modules/less/lib/less/tree/mixin.js
  32. +5 −0 WinLess/node_modules/less/lib/less/tree/operation.js
  33. +1 −1  WinLess/node_modules/less/lib/less/tree/quoted.js
  34. +7 −0 WinLess/node_modules/less/lib/less/tree/rule.js
  35. +56 −16 WinLess/node_modules/less/lib/less/tree/ruleset.js
  36. +11 −6 WinLess/node_modules/less/lib/less/tree/selector.js
  37. +13 −0 WinLess/node_modules/less/lib/less/tree/unicode-descriptor.js
  38. +11 −7 WinLess/node_modules/less/lib/less/tree/url.js
  39. +13 −1 WinLess/node_modules/less/lib/less/tree/variable.js
  40. +15 −0 WinLess/node_modules/less/node_modules/.bin/ycssmin
  41. +6 −0 WinLess/node_modules/less/node_modules/.bin/ycssmin.cmd
  42. +11 −0 WinLess/node_modules/less/node_modules/ycssmin/.npmignore
  43. +8 −0 WinLess/node_modules/less/node_modules/ycssmin/.travis.yml
  44. +25 −0 WinLess/node_modules/less/node_modules/ycssmin/LICENSE
  45. +14 −0 WinLess/node_modules/less/node_modules/ycssmin/Makefile
  46. +97 −0 WinLess/node_modules/less/node_modules/ycssmin/README.md
  47. +89 −83 WinLess/node_modules/less/{lib/less → node_modules/ycssmin}/cssmin.js
  48. +62 −0 WinLess/node_modules/less/node_modules/ycssmin/package.json
  49. +2 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/background-position.css
  50. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/background-position.css.min
  51. +5 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/border-none.css
  52. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/border-none.css.min
  53. +9 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/box-model-hack.css
  54. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/box-model-hack.css.min
  55. +10 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2527974.css
  56. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2527974.css.min
  57. +19 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2527991.css
  58. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2527991.css.min
  59. +4 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2527998.css
  60. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2527998.css.min
  61. +5 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2528034.css
  62. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/bug2528034.css.min
  63. +9 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/charset-media.css
  64. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/charset-media.css.min
  65. +8 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/color-simple.css
  66. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/color-simple.css.min
  67. +46 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/color.css
  68. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/color.css.min
  69. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/comment.css
  70. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/comment.css.min
  71. +15 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/concat-charset.css
  72. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/concat-charset.css.min
  73. +23 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-doublequotes.css
  74. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-doublequotes.css.min
  75. +10 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-eof.css
  76. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-eof.css.min
  77. +34 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-linebreakindata.css
  78. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-linebreakindata.css.min
  79. +26 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-noquotes.css
  80. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-noquotes.css.min
  81. +23 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-singlequotes.css
  82. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-singlequotes.css.min
  83. +27 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-twourls.css
  84. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-base64-twourls.css.min
  85. +30 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-dbquote-font.css
  86. +5 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-dbquote-font.css.min
  87. +13 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-nonbase64-doublequotes.css
  88. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-nonbase64-doublequotes.css.min
  89. +11 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-nonbase64-noquotes.css
  90. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-nonbase64-noquotes.css.min
  91. +15 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-nonbase64-singlequotes.css
  92. +2 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-nonbase64-singlequotes.css.min
  93. +31 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-noquote-multiline-font.css
  94. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-noquote-multiline-font.css.min
  95. +90 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-doublequotes.css
  96. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-doublequotes.css.min
  97. +90 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-noquotes.css
  98. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-noquotes.css.min
  99. +90 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-singlequotes.css
  100. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-singlequotes.css.min
  101. +106 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-yuiapp.css
  102. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-realdata-yuiapp.css.min
  103. +30 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-singlequote-font.css
  104. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dataurl-singlequote-font.css.min
  105. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/decimals.css
  106. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/decimals.css.min
  107. +7 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/dollar-header.css
  108. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/dollar-header.css.min
  109. +6 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/font-face.css
  110. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/font-face.css.min
  111. +5 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/ie5mac.css
  112. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/ie5mac.css.min
  113. +16 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/media-empty-class.css
  114. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/media-empty-class.css.min
  115. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/media-multi.css
  116. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/media-multi.css.min
  117. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/media-test.css
  118. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/media-test.css.min
  119. +14 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/opacity-filter.css
  120. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/opacity-filter.css.min
  121. +15 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/preserve-case.css
  122. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/preserve-case.css.min
  123. +6 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/preserve-new-line.css
  124. +3 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/preserve-new-line.css.min
  125. +7 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/preserve-strings.css
  126. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/preserve-strings.css.min
  127. +16 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/pseudo-first.css
  128. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/pseudo-first.css.min
  129. +5 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/pseudo.css
  130. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/pseudo.css.min
  131. +13 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/special-comments.css
  132. +9 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/special-comments.css.min
  133. +118 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/special/linebreakpos.css
  134. +6 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/special/linebreakpos.css.min
  135. +5 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/star-underscore-hacks.css
  136. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/star-underscore-hacks.css.min
  137. +8 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/string-in-comment.css
  138. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/string-in-comment.css.min
  139. +2 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/webkit-transform.css
  140. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/webkit-transform.css.min
  141. +6 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/files/zeros.css
  142. +1 −0  WinLess/node_modules/less/node_modules/ycssmin/tests/files/zeros.css.min
  143. +49 −0 WinLess/node_modules/less/node_modules/ycssmin/tests/tests.js
  144. +18 −5 WinLess/node_modules/less/package.json
  145. +29 −0 WinLess/node_modules/less/test/browser-test-prepare.js
  146. +74 −0 WinLess/node_modules/less/test/browser/common.js
  147. +36 −0 WinLess/node_modules/less/test/browser/css/relative-urls/urls.css
  148. +36 −0 WinLess/node_modules/less/test/browser/css/rootpath-relative/urls.css
  149. +36 −0 WinLess/node_modules/less/test/browser/css/rootpath/urls.css
  150. +36 −0 WinLess/node_modules/less/test/browser/css/urls.css
  151. +681 −0 WinLess/node_modules/less/test/browser/jasmine-html.js
  152. +82 −0 WinLess/node_modules/less/test/browser/jasmine.css
  153. +2,600 −0 WinLess/node_modules/less/test/browser/jasmine.js
  154. +4 −0 WinLess/node_modules/less/test/browser/less/imports/urls.less
  155. +4 −0 WinLess/node_modules/less/test/browser/less/imports/urls2.less
  156. +33 −0 WinLess/node_modules/less/test/browser/less/relative-urls/urls.less
  157. +33 −0 WinLess/node_modules/less/test/browser/less/rootpath-relative/urls.less
  158. +33 −0 WinLess/node_modules/less/test/browser/less/rootpath/urls.less
  159. +33 −0 WinLess/node_modules/less/test/browser/less/urls.less
  160. +139 −0 WinLess/node_modules/less/test/browser/phantom-runner.js
  161. +3 −0  WinLess/node_modules/less/test/browser/runner-browser.js
  162. +15 −0 WinLess/node_modules/less/test/browser/runner-main.js
  163. +4 −0 WinLess/node_modules/less/test/browser/runner-relative-urls.js
  164. +5 −0 WinLess/node_modules/less/test/browser/runner-rootpath-relative.js
  165. +4 −0 WinLess/node_modules/less/test/browser/runner-rootpath.js
  166. +10 −0 WinLess/node_modules/less/test/browser/template.htm
  167. +1 −0  WinLess/node_modules/less/test/css/charsets.css
  168. +3 −0  WinLess/node_modules/less/test/css/colors.css
  169. +7 −0 WinLess/node_modules/less/test/css/comments.css
  170. +17 −2 WinLess/node_modules/less/test/css/css-3.css
  171. +3 −14 WinLess/node_modules/less/test/css/css.css
  172. +8 −0 WinLess/node_modules/less/test/css/functions.css
  173. +0 −3  WinLess/node_modules/less/test/css/import-once.css
  174. +7 −9 WinLess/node_modules/less/test/css/import.css
  175. +19 −0 WinLess/node_modules/less/test/css/media.css
  176. +21 −0 WinLess/node_modules/less/test/css/mixins-args.css
  177. +3 −0  WinLess/node_modules/less/test/css/mixins-guards.css
  178. +21 −0 WinLess/node_modules/less/test/css/mixins-important.css
  179. +7 −0 WinLess/node_modules/less/test/css/mixins-named-args.css
  180. +13 −0 WinLess/node_modules/less/test/css/mixins.css
  181. +20 −0 WinLess/node_modules/less/test/css/scope.css
  182. +3 −0  WinLess/node_modules/less/test/css/selectors.css
  183. +42 −0 WinLess/node_modules/less/test/css/static-urls/urls.css
  184. +1 −1  WinLess/node_modules/less/test/css/strings.css
  185. +42 −0 WinLess/node_modules/less/test/css/urls.css
  186. +0 −1  WinLess/node_modules/less/test/css/variables.css
  187. +14 −6 WinLess/node_modules/less/test/less-test.js
  188. +3 −0  WinLess/node_modules/less/test/less/charsets.less
  189. +4 −0 WinLess/node_modules/less/test/less/colors.less
  190. +12 −0 WinLess/node_modules/less/test/less/comments.less
  191. +8 −3 WinLess/node_modules/less/test/less/css-3.less
  192. +4 −17 WinLess/node_modules/less/test/less/css.less
  193. +1 −0  WinLess/node_modules/less/test/less/errors/bad-variable-declaration1.less
  194. +2 −0  WinLess/node_modules/less/test/less/errors/bad-variable-declaration1.txt
  195. +1 −1  WinLess/node_modules/less/test/less/errors/import-subfolder2.txt
  196. +4 −0 WinLess/node_modules/less/test/less/errors/imports/import-test.less
  197. +6 −0 WinLess/node_modules/less/test/less/errors/mixed-mixin-definition-args-1.less
  198. +4 −0 WinLess/node_modules/less/test/less/errors/mixed-mixin-definition-args-1.txt
  199. +6 −0 WinLess/node_modules/less/test/less/errors/mixed-mixin-definition-args-2.less
  200. +4 −0 WinLess/node_modules/less/test/less/errors/mixed-mixin-definition-args-2.txt
  201. +6 −0 WinLess/node_modules/less/test/less/errors/mixin-not-matched.less
  202. +3 −0  WinLess/node_modules/less/test/less/errors/mixin-not-matched.txt
  203. +6 −0 WinLess/node_modules/less/test/less/errors/mixin-not-matched2.less
  204. +3 −0  WinLess/node_modules/less/test/less/errors/mixin-not-matched2.txt
  205. +1 −1  WinLess/node_modules/less/test/less/errors/parse-error-curly-bracket.txt
  206. +1 −1  WinLess/node_modules/less/test/less/errors/parse-error-missing-bracket.txt
  207. +13 −0 WinLess/node_modules/less/test/less/errors/parse-error-with-import.less
  208. +4 −0 WinLess/node_modules/less/test/less/errors/parse-error-with-import.txt
  209. +1 −0  WinLess/node_modules/less/test/less/errors/recursive-variable.less
  210. +2 −0  WinLess/node_modules/less/test/less/errors/recursive-variable.txt
  211. +10 −0 WinLess/node_modules/less/test/less/functions.less
  212. +2 −1  WinLess/node_modules/less/test/less/import-once.less
  213. +2 −1  WinLess/node_modules/less/test/less/import.less
  214. +1 −1  WinLess/node_modules/less/test/less/import/deeper/import-once-test-a.less
  215. +6 −0 WinLess/node_modules/less/test/less/import/import-and-relative-paths-test.less
  216. +1 −0  WinLess/node_modules/less/test/less/import/import-charset-test.less
  217. +0 −1  WinLess/node_modules/less/test/less/import/import-once-test-c.less
  218. +1 −0  WinLess/node_modules/less/test/less/import/import-test-a.less
  219. +0 −1  WinLess/node_modules/less/test/less/import/import-test-c.less
  220. +8 −0 WinLess/node_modules/less/test/less/import/imports/font.less
  221. +5 −0 WinLess/node_modules/less/test/less/import/imports/logo.less
  222. +1 −0  WinLess/node_modules/less/test/less/import/urls.less
  223. +20 −0 WinLess/node_modules/less/test/less/media.less
  224. +37 −0 WinLess/node_modules/less/test/less/mixins-args.less
  225. +11 −0 WinLess/node_modules/less/test/less/mixins-guards.less
  226. +4 −0 WinLess/node_modules/less/test/less/mixins-important.less
  227. +5 −0 WinLess/node_modules/less/test/less/mixins-named-args.less
  228. +21 −0 WinLess/node_modules/less/test/less/mixins.less
  229. +48 −1 WinLess/node_modules/less/test/less/scope.less
  230. +5 −0 WinLess/node_modules/less/test/less/selectors.less
  231. +33 −0 WinLess/node_modules/less/test/less/static-urls/urls.less
  232. +33 −0 WinLess/node_modules/less/test/less/urls.less
  233. +0 −1  WinLess/node_modules/less/test/less/variables.less
  234. +22 −0 WinLess/node_modules/npm/.npmignore
  235. +80 −0 WinLess/node_modules/npm/AUTHORS
  236. +65 −0 WinLess/node_modules/npm/LICENSE
  237. +138 −0 WinLess/node_modules/npm/Makefile
  238. +239 −0 WinLess/node_modules/npm/README.md
  239. +2 −0  WinLess/node_modules/npm/cli.js
  240. +33 −0 WinLess/node_modules/npm/configure
  241. +13 −0 WinLess/node_modules/npm/doc/api/bin.md
  242. +19 −0 WinLess/node_modules/npm/doc/api/bugs.md
  243. +22 −0 WinLess/node_modules/npm/doc/api/commands.md
  244. +45 −0 WinLess/node_modules/npm/doc/api/config.md
  245. +34 −0 WinLess/node_modules/npm/doc/api/deprecate.md
  246. +19 −0 WinLess/node_modules/npm/doc/api/docs.md
  247. +24 −0 WinLess/node_modules/npm/doc/api/edit.md
  248. +18 −0 WinLess/node_modules/npm/doc/api/explore.md
  249. +30 −0 WinLess/node_modules/npm/doc/api/help-search.md
  250. +29 −0 WinLess/node_modules/npm/doc/api/init.md
  251. +19 −0 WinLess/node_modules/npm/doc/api/install.md
  252. +33 −0 WinLess/node_modules/npm/doc/api/link.md
  253. +26 −0 WinLess/node_modules/npm/doc/api/load.md
  254. +56 −0 WinLess/node_modules/npm/doc/api/ls.md
  255. +115 −0 WinLess/node_modules/npm/doc/api/npm.md
  256. +13 −0 WinLess/node_modules/npm/doc/api/outdated.md
  257. +31 −0 WinLess/node_modules/npm/doc/api/owner.md
  258. +19 −0 WinLess/node_modules/npm/doc/api/pack.md
  259. +15 −0 WinLess/node_modules/npm/doc/api/prefix.md
  260. +17 −0 WinLess/node_modules/npm/doc/api/prune.md
  261. +30 −0 WinLess/node_modules/npm/doc/api/publish.md
  262. +16 −0 WinLess/node_modules/npm/doc/api/rebuild.md
  263. +22 −0 WinLess/node_modules/npm/doc/api/restart.md
  264. +15 −0 WinLess/node_modules/npm/doc/api/root.md
  265. +27 −0 WinLess/node_modules/npm/doc/api/run-script.md
  266. +35 −0 WinLess/node_modules/npm/doc/api/search.md
  267. +20 −0 WinLess/node_modules/npm/doc/api/shrinkwrap.md
  268. +13 −0 WinLess/node_modules/npm/doc/api/start.md
  269. +13 −0 WinLess/node_modules/npm/doc/api/stop.md
  270. +28 −0 WinLess/node_modules/npm/doc/api/submodule.md
  271. +23 −0 WinLess/node_modules/npm/doc/api/tag.md
  272. +16 −0 WinLess/node_modules/npm/doc/api/test.md
  273. +16 −0 WinLess/node_modules/npm/doc/api/uninstall.md
  274. +20 −0 WinLess/node_modules/npm/doc/api/unpublish.md
  275. +11 −0 WinLess/node_modules/npm/doc/api/update.md
  276. +18 −0 WinLess/node_modules/npm/doc/api/version.md
  277. +93 −0 WinLess/node_modules/npm/doc/api/view.md
  278. +15 −0 WinLess/node_modules/npm/doc/api/whoami.md
  279. +36 −0 WinLess/node_modules/npm/doc/cli/adduser.md
  280. +17 −0 WinLess/node_modules/npm/doc/cli/bin.md
  281. +38 −0 WinLess/node_modules/npm/doc/cli/bugs.md
  282. +22 −0 WinLess/node_modules/npm/doc/cli/build.md
  283. +14 −0 WinLess/node_modules/npm/doc/cli/bundle.md
  284. +70 −0 WinLess/node_modules/npm/doc/cli/cache.md
  285. +80 −0 WinLess/node_modules/npm/doc/cli/changelog.md
  286. +181 −0 WinLess/node_modules/npm/doc/cli/coding-style.md
  287. +29 −0 WinLess/node_modules/npm/doc/cli/completion.md
  288. +858 −0 WinLess/node_modules/npm/doc/cli/config.md
  289. +53 −0 WinLess/node_modules/npm/doc/cli/dedupe.md
  290. +26 −0 WinLess/node_modules/npm/doc/cli/deprecate.md
  291. +183 −0 WinLess/node_modules/npm/doc/cli/developers.md
  292. +91 −0 WinLess/node_modules/npm/doc/cli/disputes.md
  293. +38 −0 WinLess/node_modules/npm/doc/cli/docs.md
  294. +35 −0 WinLess/node_modules/npm/doc/cli/edit.md
  295. +40 −0 WinLess/node_modules/npm/doc/cli/explore.md
  296. +260 −0 WinLess/node_modules/npm/doc/cli/faq.md
  297. +209 −0 WinLess/node_modules/npm/doc/cli/folders.md
  298. +35 −0 WinLess/node_modules/npm/doc/cli/help-search.md
  299. +38 −0 WinLess/node_modules/npm/doc/cli/help.md
  300. +381 −0 WinLess/node_modules/npm/doc/cli/index.md
Sorry, we could not display the entire diff because too many files (2,188) changed.
View
8 CHANGELOG.md
@@ -1,5 +1,13 @@
## Changelog
+### 1.8.0
+- Updated less.js to 1.3.3
+- Added automatic updating of less.js. On start WinLess now checks whether there is a new version of less.js available and offers to install it. This can disabled in the settings dialog. WinLess also performs this check when the about dialog is opened.
+
+### 1.7.1
+- Updated less.js to 1.3.2
+
+
### 1.7.0
- Improved folder selection via 'Add folder' by using Ookii.VistaFolderBrowserDialog
- Improved output path selection by changing 'select output folder' to 'select output file', @jmclocklin thanks for the help
View
8 Installer/WinLess.warsetup
@@ -1,5 +1,5 @@
<?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="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">
+<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="7185" projectName="WinLess" projectUuid="3561b233-c213-4e07-9548-a35719fdf1f0" projectUpgradeUuid="b795642a-13ec-4b7c-bb13-d8f0311fc42d" projectVersion="1.8.0" projectOrganization="Mark Lagendijk" projectMustBeAdministratorToInstall="false" project64BitTarget="false" projectTargetDirectory="C:\projects\WinLess\installer" projectTargetName="WinLess-1.8.0" projectType="0" projectUserInterface="WixUI_Minimal">
<LicencePaths>
<string>C:\Program Files (x86)\Jgaa's Internet\War Setup\Licenses</string>
</LicencePaths>
@@ -18,6 +18,12 @@
</componentFiles>
<addToCreateFolder>false</addToCreateFolder>
</components>
+ <components componentId="ID7184" componentGuid="5b0b9ac9-3912-4bd5-8922-42a4e158c5ff">
+ <componentFiles fileId="ID_28c25a72_9379_4420_981d_e8c0087a8900" srcName="Ookii.Dialogs.Wpf.dll" srcDirectory="..\WinLess\bin\Release" dstName="Ookii.Dialogs.Wpf.dll" dstPath="" isTrueTypeFont="false" isComModule="false" typelibGuid="" menuName="Ookii.Dialogs.Wpf" shortcutInProgramFilesMenu="false" shortcutOnDesktop="false" shortcutInQuickLaunch="false" shortcutInStartupFolder="false" shortcutWorkingDirectory="" shortcutCommandArguments="" shortcutDescription="">
+ <service StartWhenInstalled="true" Remove="both" id="ID7183" isService="false" userAccount="" userPassword="" cmdLineArguments="" errorControl="normal" interactive="false" loadOrderGroup="" serviceName="" startMode="auto" vital="true" />
+ </componentFiles>
+ <addToCreateFolder>false</addToCreateFolder>
+ </components>
<defaultInstallMode>3</defaultInstallMode>
<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">
View
68 WinLess/Forms/aboutForm.Designer.cs
@@ -30,32 +30,45 @@ private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(aboutForm));
this.versionGroupBox = new System.Windows.Forms.GroupBox();
+ this.checkingForUpdatesLabel = new System.Windows.Forms.Label();
this.lessjsVersionLabel = new System.Windows.Forms.Label();
this.lessjsLabel = new System.Windows.Forms.Label();
this.winlessVersionLabel = new System.Windows.Forms.Label();
this.winlessLabel = new System.Windows.Forms.Label();
this.creditsGroupBox = new System.Windows.Forms.GroupBox();
+ this.graphicalDesignNameLabel = new System.Windows.Forms.Label();
+ this.authorNameLabel = new System.Windows.Forms.Label();
this.graphicalDesignLabel = new System.Windows.Forms.Label();
this.authorLabel = new System.Windows.Forms.Label();
- this.authorNameLabel = new System.Windows.Forms.Label();
- this.graphicalDesignNameLabel = new System.Windows.Forms.Label();
+ this.updatingLabel = new System.Windows.Forms.Label();
this.versionGroupBox.SuspendLayout();
this.creditsGroupBox.SuspendLayout();
this.SuspendLayout();
//
// versionGroupBox
//
+ this.versionGroupBox.Controls.Add(this.updatingLabel);
+ this.versionGroupBox.Controls.Add(this.checkingForUpdatesLabel);
this.versionGroupBox.Controls.Add(this.lessjsVersionLabel);
this.versionGroupBox.Controls.Add(this.lessjsLabel);
this.versionGroupBox.Controls.Add(this.winlessVersionLabel);
this.versionGroupBox.Controls.Add(this.winlessLabel);
this.versionGroupBox.Location = new System.Drawing.Point(12, 12);
this.versionGroupBox.Name = "versionGroupBox";
- this.versionGroupBox.Size = new System.Drawing.Size(260, 59);
+ this.versionGroupBox.Size = new System.Drawing.Size(290, 59);
this.versionGroupBox.TabIndex = 1;
this.versionGroupBox.TabStop = false;
this.versionGroupBox.Text = "Version info";
//
+ // checkingForUpdatesLabel
+ //
+ this.checkingForUpdatesLabel.AutoSize = true;
+ this.checkingForUpdatesLabel.Location = new System.Drawing.Point(165, 37);
+ this.checkingForUpdatesLabel.Name = "checkingForUpdatesLabel";
+ this.checkingForUpdatesLabel.Size = new System.Drawing.Size(117, 13);
+ this.checkingForUpdatesLabel.TabIndex = 4;
+ this.checkingForUpdatesLabel.Text = "Checking for updates...";
+ //
// lessjsVersionLabel
//
this.lessjsVersionLabel.AutoSize = true;
@@ -100,11 +113,29 @@ private void InitializeComponent()
this.creditsGroupBox.Controls.Add(this.authorLabel);
this.creditsGroupBox.Location = new System.Drawing.Point(13, 78);
this.creditsGroupBox.Name = "creditsGroupBox";
- this.creditsGroupBox.Size = new System.Drawing.Size(259, 66);
+ this.creditsGroupBox.Size = new System.Drawing.Size(289, 66);
this.creditsGroupBox.TabIndex = 2;
this.creditsGroupBox.TabStop = false;
this.creditsGroupBox.Text = "Credits";
//
+ // graphicalDesignNameLabel
+ //
+ this.graphicalDesignNameLabel.AutoSize = true;
+ this.graphicalDesignNameLabel.Location = new System.Drawing.Point(103, 37);
+ this.graphicalDesignNameLabel.Name = "graphicalDesignNameLabel";
+ this.graphicalDesignNameLabel.Size = new System.Drawing.Size(105, 13);
+ this.graphicalDesignNameLabel.TabIndex = 3;
+ this.graphicalDesignNameLabel.Text = "Elmar Kouwenhoven";
+ //
+ // authorNameLabel
+ //
+ this.authorNameLabel.AutoSize = true;
+ this.authorNameLabel.Location = new System.Drawing.Point(103, 20);
+ this.authorNameLabel.Name = "authorNameLabel";
+ this.authorNameLabel.Size = new System.Drawing.Size(80, 13);
+ this.authorNameLabel.TabIndex = 2;
+ this.authorNameLabel.Text = "Mark Lagendijk";
+ //
// graphicalDesignLabel
//
this.graphicalDesignLabel.AutoSize = true;
@@ -123,34 +154,27 @@ private void InitializeComponent()
this.authorLabel.TabIndex = 0;
this.authorLabel.Text = "Author:";
//
- // authorNameLabel
- //
- this.authorNameLabel.AutoSize = true;
- this.authorNameLabel.Location = new System.Drawing.Point(103, 20);
- this.authorNameLabel.Name = "authorNameLabel";
- this.authorNameLabel.Size = new System.Drawing.Size(80, 13);
- this.authorNameLabel.TabIndex = 2;
- this.authorNameLabel.Text = "Mark Lagendijk";
- //
- // graphicalDesignNameLabel
+ // updatingLabel
//
- this.graphicalDesignNameLabel.AutoSize = true;
- this.graphicalDesignNameLabel.Location = new System.Drawing.Point(103, 37);
- this.graphicalDesignNameLabel.Name = "graphicalDesignNameLabel";
- this.graphicalDesignNameLabel.Size = new System.Drawing.Size(105, 13);
- this.graphicalDesignNameLabel.TabIndex = 3;
- this.graphicalDesignNameLabel.Text = "Elmar Kouwenhoven";
+ this.updatingLabel.AutoSize = true;
+ this.updatingLabel.Location = new System.Drawing.Point(165, 37);
+ this.updatingLabel.Name = "updatingLabel";
+ this.updatingLabel.Size = new System.Drawing.Size(59, 13);
+ this.updatingLabel.TabIndex = 5;
+ this.updatingLabel.Text = "Updating...";
+ this.updatingLabel.Visible = false;
//
// aboutForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(284, 154);
+ this.ClientSize = new System.Drawing.Size(313, 154);
this.Controls.Add(this.creditsGroupBox);
this.Controls.Add(this.versionGroupBox);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "aboutForm";
this.Text = "About";
+ this.Shown += new System.EventHandler(this.aboutForm_Shown);
this.versionGroupBox.ResumeLayout(false);
this.versionGroupBox.PerformLayout();
this.creditsGroupBox.ResumeLayout(false);
@@ -171,6 +195,8 @@ private void InitializeComponent()
private System.Windows.Forms.Label authorLabel;
private System.Windows.Forms.Label graphicalDesignNameLabel;
private System.Windows.Forms.Label authorNameLabel;
+ private System.Windows.Forms.Label checkingForUpdatesLabel;
+ private System.Windows.Forms.Label updatingLabel;
}
}
View
32 WinLess/Forms/aboutForm.cs
@@ -14,10 +14,10 @@ namespace WinLess
public partial class aboutForm : Form
{
public aboutForm()
- {
+ {
InitializeComponent();
winlessVersionLabel.Text = GetApplicationVersion();
- lessjsVersionLabel.Text = LessCompiler.GetVersion();
+ lessjsVersionLabel.Text = LessCompiler.GetCurrentCompilerVersion().ToString();
}
private string GetApplicationVersion()
@@ -27,5 +27,33 @@ private string GetApplicationVersion()
// return the ProductVersion without the last '.0'
return version.Substring(0, version.Length - 2);
}
+
+ private void aboutForm_Shown(object sender, EventArgs e)
+ {
+ //Force paint by calling Application.DoEvents();
+ Application.DoEvents();
+
+ bool lessCompilerUpdateAvailable = LessCompiler.IsCompilerUpdateAvailable();
+ checkingForUpdatesLabel.Visible = false;
+
+ if(lessCompilerUpdateAvailable)
+ {
+ if (MessageBox.Show(string.Format("WinLess uses the official LESS compiler, less.js, to compile your LESS files.\n\nA new version of less.js is available. Do you want to update less.js from {0} to {1}?", LessCompiler.GetCurrentCompilerVersion(), LessCompiler.GetAvailableCompilerVersion()), "Update LESS compiler?", MessageBoxButtons.YesNo) == DialogResult.Yes)
+ {
+ //Show updatingLabel and force repaint by calling Application.DoEvents();
+ updatingLabel.Visible = true;
+ Application.DoEvents();
+
+ LessCompiler.UpdateCompiler();
+
+ Version newVersion = LessCompiler.GetCurrentCompilerVersion();
+ lessjsVersionLabel.Text = newVersion.ToString();
+
+ updatingLabel.Visible = false;
+
+ MessageBox.Show(string.Format("Succesfully updated less.js to version {0}", newVersion), "LESS compiler update");
+ }
+ }
+ }
}
}
View
19 WinLess/Forms/mainForm.cs
@@ -51,6 +51,8 @@ public mainForm()
AddExtension = true,
Filter = "*.css|*.css"
};
+
+ CheckForLessUpdates();
}
catch (Exception e)
{
@@ -58,6 +60,21 @@ public mainForm()
}
}
+ private void CheckForLessUpdates()
+ {
+ if (Program.Settings.CheckForLessUpdates)
+ {
+ if (LessCompiler.IsCompilerUpdateAvailable())
+ {
+ if (MessageBox.Show(string.Format("WinLess uses the official LESS compiler, less.js, to compile your LESS files.\n\nA new version of less.js is available. Do you want to update less.js from {0} to {1}?", LessCompiler.GetCurrentCompilerVersion(), LessCompiler.GetAvailableCompilerVersion()), "Update LESS compiler?", MessageBoxButtons.YesNo) == DialogResult.Yes)
+ {
+ LessCompiler.UpdateCompiler();
+ MessageBox.Show(string.Format("Succesfully updated less.js to version {0}", LessCompiler.GetCurrentCompilerVersion()), "LESS compiler update");
+ }
+ }
+ }
+ }
+
public void LoadDirectories(CommandArguments args)
{
if (args.ClearDirectories)
@@ -506,7 +523,7 @@ private void CompileSelectedFiles()
{
if (file.Enabled)
{
- LessCompiler.CompileLessFile(file.FullPath, file.OutputPath, file.Minify);
+ LessCompiler.Compile(file.FullPath, file.OutputPath, file.Minify);
}
}
}
View
41 WinLess/Forms/settingsForm.Designer.cs
@@ -35,16 +35,17 @@ private void InitializeComponent()
this.startMinimizedCheckBox = new System.Windows.Forms.CheckBox();
this.startWithWindowsCheckBox = new System.Windows.Forms.CheckBox();
this.compilingGroupBox = new System.Windows.Forms.GroupBox();
+ this.showSuccessMessagesCheckbox = new System.Windows.Forms.CheckBox();
this.compileOnSaveCheckBox = new System.Windows.Forms.CheckBox();
this.defaultMinifyCheckBox = new System.Windows.Forms.CheckBox();
- this.showSuccessMessagesCheckbox = new System.Windows.Forms.CheckBox();
+ this.checkForLessUpdatesCheckbox = new System.Windows.Forms.CheckBox();
this.generalGroupBox.SuspendLayout();
this.compilingGroupBox.SuspendLayout();
this.SuspendLayout();
//
// cancelButton
//
- this.cancelButton.Location = new System.Drawing.Point(197, 197);
+ this.cancelButton.Location = new System.Drawing.Point(197, 233);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 0;
@@ -54,7 +55,7 @@ private void InitializeComponent()
//
// okButton
//
- this.okButton.Location = new System.Drawing.Point(116, 197);
+ this.okButton.Location = new System.Drawing.Point(116, 233);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 23);
this.okButton.TabIndex = 1;
@@ -64,11 +65,12 @@ private void InitializeComponent()
//
// generalGroupBox
//
+ this.generalGroupBox.Controls.Add(this.checkForLessUpdatesCheckbox);
this.generalGroupBox.Controls.Add(this.startMinimizedCheckBox);
this.generalGroupBox.Controls.Add(this.startWithWindowsCheckBox);
this.generalGroupBox.Location = new System.Drawing.Point(13, 13);
this.generalGroupBox.Name = "generalGroupBox";
- this.generalGroupBox.Size = new System.Drawing.Size(259, 72);
+ this.generalGroupBox.Size = new System.Drawing.Size(259, 91);
this.generalGroupBox.TabIndex = 2;
this.generalGroupBox.TabStop = false;
this.generalGroupBox.Text = "General";
@@ -98,13 +100,23 @@ private void InitializeComponent()
this.compilingGroupBox.Controls.Add(this.showSuccessMessagesCheckbox);
this.compilingGroupBox.Controls.Add(this.compileOnSaveCheckBox);
this.compilingGroupBox.Controls.Add(this.defaultMinifyCheckBox);
- this.compilingGroupBox.Location = new System.Drawing.Point(13, 91);
+ this.compilingGroupBox.Location = new System.Drawing.Point(13, 127);
this.compilingGroupBox.Name = "compilingGroupBox";
this.compilingGroupBox.Size = new System.Drawing.Size(259, 100);
this.compilingGroupBox.TabIndex = 3;
this.compilingGroupBox.TabStop = false;
this.compilingGroupBox.Text = "Compiling";
//
+ // showSuccessMessagesCheckbox
+ //
+ this.showSuccessMessagesCheckbox.AutoSize = true;
+ this.showSuccessMessagesCheckbox.Location = new System.Drawing.Point(7, 68);
+ this.showSuccessMessagesCheckbox.Name = "showSuccessMessagesCheckbox";
+ this.showSuccessMessagesCheckbox.Size = new System.Drawing.Size(200, 17);
+ this.showSuccessMessagesCheckbox.TabIndex = 2;
+ this.showSuccessMessagesCheckbox.Text = "Show message on succesful compile";
+ this.showSuccessMessagesCheckbox.UseVisualStyleBackColor = true;
+ //
// compileOnSaveCheckBox
//
this.compileOnSaveCheckBox.AutoSize = true;
@@ -125,21 +137,21 @@ private void InitializeComponent()
this.defaultMinifyCheckBox.Text = "Minify by default";
this.defaultMinifyCheckBox.UseVisualStyleBackColor = true;
//
- // showSuccessMessagesCheckbox
+ // checkForLessUpdatesCheckbox
//
- this.showSuccessMessagesCheckbox.AutoSize = true;
- this.showSuccessMessagesCheckbox.Location = new System.Drawing.Point(7, 68);
- this.showSuccessMessagesCheckbox.Name = "showSuccessMessagesCheckbox";
- this.showSuccessMessagesCheckbox.Size = new System.Drawing.Size(200, 17);
- this.showSuccessMessagesCheckbox.TabIndex = 2;
- this.showSuccessMessagesCheckbox.Text = "Show message on succesful compile";
- this.showSuccessMessagesCheckbox.UseVisualStyleBackColor = true;
+ this.checkForLessUpdatesCheckbox.AutoSize = true;
+ this.checkForLessUpdatesCheckbox.Location = new System.Drawing.Point(7, 67);
+ this.checkForLessUpdatesCheckbox.Name = "checkForLessUpdatesCheckbox";
+ this.checkForLessUpdatesCheckbox.Size = new System.Drawing.Size(208, 17);
+ this.checkForLessUpdatesCheckbox.TabIndex = 2;
+ this.checkForLessUpdatesCheckbox.Text = "Automatically check for less.js updates";
+ this.checkForLessUpdatesCheckbox.UseVisualStyleBackColor = true;
//
// settingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(289, 232);
+ this.ClientSize = new System.Drawing.Size(289, 268);
this.Controls.Add(this.compilingGroupBox);
this.Controls.Add(this.generalGroupBox);
this.Controls.Add(this.okButton);
@@ -166,5 +178,6 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox defaultMinifyCheckBox;
private System.Windows.Forms.CheckBox compileOnSaveCheckBox;
private System.Windows.Forms.CheckBox showSuccessMessagesCheckbox;
+ private System.Windows.Forms.CheckBox checkForLessUpdatesCheckbox;
}
}
View
2  WinLess/Forms/settingsForm.cs
@@ -20,6 +20,7 @@ private void loadSettings()
{
startWithWindowsCheckBox.Checked = Program.Settings.StartWithWindows;
startMinimizedCheckBox.Checked = Program.Settings.StartMinified;
+ checkForLessUpdatesCheckbox.Checked = Program.Settings.CheckForLessUpdates;
defaultMinifyCheckBox.Checked = Program.Settings.DefaultMinify;
compileOnSaveCheckBox.Checked = Program.Settings.CompileOnSave;
showSuccessMessagesCheckbox.Checked = Program.Settings.ShowSuccessMessages;
@@ -29,6 +30,7 @@ private void saveSettings()
{
Program.Settings.StartWithWindows = startWithWindowsCheckBox.Checked;
Program.Settings.StartMinified = startMinimizedCheckBox.Checked;
+ Program.Settings.CheckForLessUpdates = checkForLessUpdatesCheckbox.Checked;
Program.Settings.DefaultMinify = defaultMinifyCheckBox.Checked;
Program.Settings.CompileOnSave = compileOnSaveCheckBox.Checked;
Program.Settings.ShowSuccessMessages = showSuccessMessagesCheckbox.Checked;
View
69 WinLess/LessCompiler.cs
@@ -9,13 +9,13 @@
namespace WinLess
{
- static class LessCompiler
+ public static class LessCompiler
{
- public static void CompileLessFile(string lessPath, string cssPath, bool minify)
+ public static void Compile(string lessFile, string cssFile, bool minify)
{
try
{
- CompileCommandResult compileResult = ExecuteCompileCommand(lessPath, cssPath, minify);
+ CompileCommandResult compileResult = ExecuteCompileCommand(lessFile, cssFile, minify);
mainForm.ActiveOrInActiveMainForm.AddCompileResult(compileResult);
}
catch (Exception e)
@@ -24,36 +24,71 @@ public static void CompileLessFile(string lessPath, string cssPath, bool minify)
}
}
- public static string GetVersion()
+ public static Version GetCurrentCompilerVersion()
{
- 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){
+ CommandResult result = ExecuteLessCommand("-v");
+
+ return GetVersionFromCommandResult(result);
+ }
+
+ public static Version GetAvailableCompilerVersion()
+ {
+ CommandResult result = ExecuteNodePackageManagerCommand("view less version");
+
+ return GetVersionFromCommandResult(result);
+ }
+
+ public static bool IsCompilerUpdateAvailable()
+ {
+ Version currentVersion = GetCurrentCompilerVersion();
+ Version availableVersion = GetAvailableCompilerVersion();
+
+ return (currentVersion.CompareTo(availableVersion) < 0);
+ }
+
+ public static void UpdateCompiler()
+ {
+ ExecuteNodePackageManagerCommand("update less");
+ }
+
+ private static Version GetVersionFromCommandResult(CommandResult result)
+ {
+ if (result.IsSuccess)
+ {
Match versionMatch = Regex.Match(result.ResultText, "\\d+(?:\\.\\d+)+");
if (versionMatch.Groups.Count > 0)
{
- version = versionMatch.Groups[0].Value;
+ return new Version(versionMatch.Groups[0].Value);
}
}
- return version;
+ return null;
}
- private static CompileCommandResult ExecuteCompileCommand(string lessPath, string cssPath, bool minify)
+ private static CommandResult ExecuteNodePackageManagerCommand(string arguments)
+ {
+ string fileName = string.Format("{0}\\node_modules\\.bin\\npm.cmd", Application.StartupPath);
+ return ExecuteCommand(fileName, arguments);
+ }
+
+ private static CommandResult ExecuteLessCommand(string arguments)
{
string fileName = string.Format("{0}\\node_modules\\.bin\\lessc.cmd", Application.StartupPath);
- string arguments = CreateCompileArguments(lessPath, cssPath, minify);
+ return ExecuteCommand(fileName, arguments);
+ }
+
+ private static CompileCommandResult ExecuteCompileCommand(string lessFile, string cssFile, bool minify)
+ {
+ string arguments = CreateCompileArguments(lessFile, cssFile, minify);
- CompileCommandResult result = new CompileCommandResult(ExecuteCommand(fileName, arguments));
- result.FullPath = lessPath;
+ CompileCommandResult result = new CompileCommandResult(ExecuteLessCommand(arguments));
+ result.FullPath = lessFile;
return result;
}
- private static string CreateCompileArguments(string lessPath, string cssPath, bool minify)
+ private static string CreateCompileArguments(string lessFile, string cssFile, bool minify)
{
- string arguments = string.Format("\"{0}\" \"{1}\" --no-color", lessPath, cssPath);
+ string arguments = string.Format("\"{0}\" \"{1}\" --no-color", lessFile, cssFile);
if (minify)
{
arguments = string.Format("{0} --yui-compress", arguments);
View
4 WinLess/Models/File.cs
@@ -116,7 +116,7 @@ public void Compile(bool compileParentFiles = true)
{
if (this.Enabled)
{
- LessCompiler.CompileLessFile(this.FullPath, this.OutputPath, this.Minify);
+ LessCompiler.Compile(this.FullPath, this.OutputPath, this.Minify);
}
if (compileParentFiles)
{
@@ -178,7 +178,7 @@ private List<string> GetLessImportPaths()
if (!string.IsNullOrEmpty(fileText))
{
// find the @imports using regex
- MatchCollection matches = Regex.Matches(fileText, "@import [\"\\']?([^\"\\';]+)[\"\\']?;");
+ MatchCollection matches = Regex.Matches(fileText, "@import\\s*(?:url\\()?\\s*[\"\\']?([^\"\\'\\);]+)[\"\\']?\\s*\\)?\\s*;");
foreach (Match match in matches)
{
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.6.0.0")]
-[assembly: AssemblyFileVersion("1.6.0.0")]
+[assembly: AssemblyVersion("1.8.0.0")]
+[assembly: AssemblyFileVersion("1.8.0.0")]
View
5 WinLess/Settings.cs
@@ -14,12 +14,12 @@ public class Settings
public Settings()
{
DirectoryList = new DirectoryList();
- DefaultMinify = false;
+ DefaultMinify = true;
CompileOnSave = true;
ShowSuccessMessages = false;
StartWithWindows = true;
StartMinified = false;
- ApplyStartWithWindows();
+ CheckForLessUpdates = true;
}
public DirectoryList DirectoryList { get; set; }
@@ -27,6 +27,7 @@ public Settings()
public bool CompileOnSave { get; set; }
public bool ShowSuccessMessages { get; set; }
public bool StartMinified { get; set; }
+ public bool CheckForLessUpdates { get; set; }
private bool startWithWindows;
public bool StartWithWindows
View
1,980 WinLess/WinLess.csproj
1,980 additions, 0 deletions not shown
View
15 WinLess/node_modules/.bin/npm
@@ -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/../npm/bin/npm-cli.js" "$@"
+ ret=$?
+else
+ node "$basedir/../npm/bin/npm-cli.js" "$@"
+ ret=$?
+fi
+exit $ret
View
6 WinLess/node_modules/.bin/npm.cmd
@@ -0,0 +1,6 @@
+:: Created by npm, please don't edit manually.
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\npm\bin\npm-cli.js" %*
+) ELSE (
+ node "%~dp0\..\npm\bin\npm-cli.js" %*
+)
View
6 WinLess/node_modules/less/.npmignore
@@ -1,5 +1 @@
-node_modules
-.emacs*
-*.flymake
-*~
-.#*
+dist/*
View
71 WinLess/node_modules/less/CHANGELOG.md
@@ -1,3 +1,72 @@
+# 1.3.3
+
+2012-12-30
+
+ - Fix critical bug with mixin call if using multiple brackets
+ - when using the filter contrast function, the function is passed through if the first argument is not a color
+
+# 1.3.2
+
+2012-12-28
+
+ - browser and server url re-writing is now aligned to not re-write (previous lessc behaviour)
+ - url-rewriting can be made to re-write to be relative to the entry file using the relative-urls option (less.relativeUrls option)
+ - rootpath option can be used to add a base path to every url
+ - Support mixin argument seperator of ';' so you can pass comma seperated values. e.g. `.mixin(23px, 12px;);`
+ - Fix lots of problems with named arguments in corner cases, not behaving as expected
+ - hsv, hsva, unit functions
+ - fixed lots more bad error messages
+ - fix `@import-once` to use the full path, not the relative one for determining if an import has been imported already
+ - support `:not(:nth-child(3))`
+ - mixin guards take units into account
+ - support unicode descriptors (`U+00A1-00A9`)
+ - support calling mixins with a stack when using `&` (broken in 1.3.1)
+ - support `@namespace` and namespace combinators
+ - when using % with colour functions, take into account a colour is out of 256
+ - when doing maths with a % do not divide by 100 and keep the unit
+ - allow url to contain % (e.g. %20 for a space)
+ - if a mixin guard stops execution a default mixin is not required
+ - units are output in strings (use the unit function if you need to get the value without unit)
+ - do not infinite recurse when mixins call mixins of the same name
+ - fix issue on important on mixin calls
+ - fix issue with multiple comments being confused
+ - tolerate multiple semi-colons on rules
+ - ignore subsequant `@charset`
+ - syncImport option for node.js to read files syncronously
+ - write the output directory if it is missing
+ - change dependency on cssmin to ycssmin
+ - lessc can load files over http
+ - allow calling less.watch() in non dev mode
+ - don't cache in dev mode
+ - less files cope with query parameters better
+ - sass debug statements are now chrome compatible
+ - modifyVars function added to re-render with different root variables
+
+# 1.3.1
+
+2012-10-18
+
+- Support for comment and @media debugging statements
+- bug fix for async access in chrome extensions
+- new functions tint, shade, multiply, screen, overlay, hardlight, difference, exclusion, average, negation, softlight, red, green, blue, contrast
+- allow escaped characters in attributes
+- in selectors support @{a} directly, e.g. .a.@{a} { color: black; }
+- add fraction parameter to round function
+- much better support for & selector
+- preserve order of link statements client side
+- lessc has better help
+- rhino version fixed
+- fix bugs in clientside error handling
+- support dpi, vmin, vm, dppx, dpcm units
+- Fix ratios in media statements
+- in mixin guards allow comparing colors and strings
+- support for -*-keyframes (for -khtml but now supports any)
+- in mix function, default weight to 50%
+- support @import-once
+- remove duplicate rules in output
+- implement named parameters when calling mixins
+- many numerous bug fixes
+
# 1.3.0
2012-03-10
@@ -46,4 +115,4 @@
- Improve @import support with media features
- Improve error reports from imported files
- Improve function call error reporting
-- Improve error-reporting
+- Improve error-reporting
View
50 WinLess/node_modules/less/CONTRIBUTING.md
@@ -0,0 +1,50 @@
+## Bug Reports
+
+ - Please create a short test case
+ - Test with the latest version
+ - indicate how you use less - browser/lessc/external tool
+
+## Feature Requests
+
+ - Please search feature requests to see if something similar exists already
+ - include a use-case - we do not add language features without a reason
+ - consider whether your language feature would be better as a function
+
+## Pull Requests
+
+Thankyou! Please take the time to read these guidelines
+
+ - Consider adding a feature request first to see if people are pro or con
+ - do not change the dist/ folder - we do this when releasing
+ - tests - please add tests for your work. use `make test` to see if they pass
+ - spaces not tabs
+ - end lines in semi-colons - loosely aim towards jslint standards
+
+## Developing
+
+1. install cygwin - http://cygwin.com/install.html
+ - default options +
+ - Devel -> Make
+ -> Git
+2. install node.js - http://nodejs.org/
+3. install phantomJS - http://phantomjs.org/download.html
+ - copy to a directory of your choice
+ - (windows) modify the path directory to include whereever you have copied it
+4. clone the repository and download to local computer
+5. run `npm install -g diff` to get diffs in your tests
+
+`lessc or node bin/lessc`
+
+to run the less compiler
+
+`make test`
+
+runs the node tests
+
+`make browser-test`
+
+runs the headless browser tests
+
+`make browser-test-server`
+
+sets up the server for the headless tests.. then go to http://localhost:8081/browser/test-runner-main.htm or one of the other test runner pages created in /test/browser/
View
11 WinLess/node_modules/less/Makefile
@@ -21,6 +21,8 @@ DIST = dist/less-${VERSION}.js
RHINO = dist/less-rhino-${VERSION}.js
DIST_MIN = dist/less-${VERSION}.min.js
+browser-prepare: DIST := test/browser/less.js
+
less:
@@mkdir -p dist
@@touch ${DIST}
@@ -37,6 +39,15 @@ less:
build/amd.js >> ${DIST}
@@echo "})(window);" >> ${DIST}
@@echo ${DIST} built.
+
+browser-prepare: less
+ node test/browser-test-prepare.js
+
+browser-test: browser-prepare
+ phantomjs test/browser/phantom-runner.js
+
+browser-test-server: browser-prepare
+ phantomjs test/browser/phantom-runner.js --no-tests
rhino:
@@mkdir -p dist
View
217 WinLess/node_modules/less/lib/less/browser.js
@@ -23,41 +23,58 @@ less.fileAsync = less.fileAsync || false;
// Interval between watch polls
less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
+//Setup user functions
+if (less.functions) {
+ for(var func in less.functions) {
+ less.tree.functions[func] = less.functions[func];
+ }
+}
+
+var dumpLineNumbers = /!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);
+if (dumpLineNumbers) {
+ less.dumpLineNumbers = dumpLineNumbers[1];
+}
+
//
// Watch mode
//
-less.watch = function () { return this.watchMode = true };
-less.unwatch = function () { return this.watchMode = false };
+less.watch = function () {
+ if (!less.watchMode ){
+ less.env = 'development';
+ initRunningMode();
+ }
+ return this.watchMode = true
+};
-if (less.env === 'development') {
- less.optimization = 0;
+less.unwatch = function () {clearInterval(less.watchTimer); return this.watchMode = false; };
+
+function initRunningMode(){
+ if (less.env === 'development') {
+ less.optimization = 0;
+ 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;
+ }
+}
- 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;
+if (/!watch/.test(location.hash)) {
+ less.watch();
}
-var cache;
+var cache = null;
-try {
- cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
-} catch (_) {
- cache = null;
+if (less.env != 'development') {
+ try {
+ cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
+ } catch (_) {}
}
//
@@ -75,6 +92,21 @@ for (var i = 0; i < links.length; i++) {
}
}
+//
+// With this function, it's possible to alter variables and re-render
+// CSS without reloading less-files
+//
+var session_cache = '';
+less.modifyVars = function(record) {
+ var str = session_cache;
+ for (name in record) {
+ str += ((name.slice(0,1) === '@')? '' : '@') + name +': '+
+ ((record[name].slice(-1) === ';')? record[name] : record[name] +';');
+ }
+ new(less.Parser)().parse(str, function (e, root) {
+ createCSS(root.toCSS(), less.sheets[less.sheets.length - 1]);
+ });
+};
less.refresh = function (reload) {
var startTime, endTime;
@@ -125,44 +157,139 @@ function loadStyleSheets(callback, reload) {
}
}
+function pathDiff(url, baseUrl) {
+ // diff between two paths to create a relative path
+
+ var urlParts = extractUrlParts(url),
+ baseUrlParts = extractUrlParts(baseUrl),
+ i, max, urlDirectories, baseUrlDirectories, diff = "";
+ if (urlParts.hostPart !== baseUrlParts.hostPart) {
+ return "";
+ }
+ max = Math.max(baseUrlParts.directories.length, urlParts.directories.length);
+ for(i = 0; i < max; i++) {
+ if (baseUrlParts.directories[i] !== urlParts.directories[i]) { break; }
+ }
+ baseUrlDirectories = baseUrlParts.directories.slice(i);
+ urlDirectories = urlParts.directories.slice(i);
+ for(i = 0; i < baseUrlDirectories.length-1; i++) {
+ diff += "../";
+ }
+ for(i = 0; i < urlDirectories.length-1; i++) {
+ diff += urlDirectories[i] + "/";
+ }
+ return diff;
+}
+
+function extractUrlParts(url, baseUrl) {
+ // urlParts[1] = protocol&hostname || /
+ // urlParts[2] = / if path relative to host base
+ // urlParts[3] = directories
+ // urlParts[4] = filename
+ // urlParts[5] = parameters
+
+ var urlPartsRegex = /^((?:[a-z-]+:)?\/\/(?:[^\/\?#]+\/)|([\/\\]))?((?:[^\/\\\?#]+[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/,
+ urlParts = url.match(urlPartsRegex),
+ returner = {}, directories = [], i, baseUrlParts;
+
+ if (!urlParts) {
+ throw new Error("Could not parse sheet href - '"+url+"'");
+ }
+
+ // Stylesheets in IE don't always return the full path
+ if (!urlParts[1] || urlParts[2]) {
+ baseUrlParts = baseUrl.match(urlPartsRegex);
+ if (!baseUrlParts) {
+ throw new Error("Could not parse page url - '"+baseUrl+"'");
+ }
+ urlParts[1] = baseUrlParts[1];
+ if (!urlParts[2]) {
+ urlParts[3] = baseUrlParts[3] + urlParts[3];
+ }
+ }
+
+ if (urlParts[3]) {
+ directories = urlParts[3].replace("\\", "/").split("/");
+
+ for(i = 0; i < directories.length; i++) {
+ if (directories[i] === ".." && i > 0) {
+ directories.splice(i-1, 2);
+ i -= 2;
+ }
+ }
+ }
+
+ returner.hostPart = urlParts[1];
+ returner.directories = directories;
+ returner.path = urlParts[1] + directories.join("/");
+ returner.fileUrl = returner.path + (urlParts[4] || "");
+ returner.url = returner.fileUrl + (urlParts[5] || "");
+ return returner;
+}
+
function loadStyleSheet(sheet, callback, reload, remaining) {
- var contents = sheet.contents || {}; // Passing a ref to top importing parser content cache trough 'sheet' arg.
- var url = window.location.href.replace(/[#?].*$/, '');
- var href = sheet.href.replace(/\?.*$/, '');
+ // sheet may be set to the stylesheet for the initial load or a collection of properties including
+ // some env variables for imports
+ var contents = sheet.contents || {};
+ var files = sheet.files || {};
+ var hrefParts = extractUrlParts(sheet.href, window.location.href);
+ var href = hrefParts.url;
var css = cache && cache.getItem(href);
var timestamp = cache && cache.getItem(href + ':timestamp');
var styles = { css: css, timestamp: timestamp };
+ var rootpath;
- // Stylesheets in IE don't always return the full path
- if (! /^[a-z-]+:/.test(href)) {
- if (href.charAt(0) == "/") {
- href = window.location.protocol + "//" + window.location.host + href;
+ if (less.relativeUrls) {
+ if (less.rootpath) {
+ if (sheet.entryPath) {
+ rootpath = extractUrlParts(less.rootpath + pathDiff(hrefParts.path, sheet.entryPath)).path;
+ } else {
+ rootpath = less.rootpath;
+ }
} else {
- href = url.slice(0, url.lastIndexOf('/') + 1) + href;
+ rootpath = hrefParts.path;
+ }
+ } else {
+ if (less.rootpath) {
+ rootpath = less.rootpath;
+ } else {
+ if (sheet.entryPath) {
+ rootpath = sheet.entryPath;
+ } else {
+ rootpath = hrefParts.path;
+ }
}
}
- xhr(sheet.href, sheet.type, function (data, lastModified) {
+
+ xhr(href, sheet.type, function (data, lastModified) {
+ // Store data this session
+ session_cache += data.replace(/@import .+?;/ig, '');
+
if (!reload && styles && lastModified &&
(new(Date)(lastModified).valueOf() ===
new(Date)(styles.timestamp).valueOf())) {
// Use local copy
createCSS(styles.css, sheet);
- callback(null, null, data, sheet, { local: true, remaining: remaining });
+ callback(null, null, data, sheet, { local: true, remaining: remaining }, href);
} else {
// Use remote copy (re-parse)
try {
contents[href] = data; // Updating top importing parser content cache
new(less.Parser)({
optimization: less.optimization,
- paths: [href.replace(/[\w\.-]+$/, '')],
+ paths: [hrefParts.path],
+ entryPath: sheet.entryPath || hrefParts.path,
mime: sheet.type,
filename: href,
- 'contents': contents, // Passing top importing parser content cache ref down.
+ rootpath: rootpath,
+ relativeUrls: sheet.relativeUrls,
+ contents: contents, // Passing top importing parser content cache ref down.
+ files: files,
dumpLineNumbers: less.dumpLineNumbers
}).parse(data, function (e, root) {
if (e) { return error(e, href) }
try {
- callback(e, root, data, sheet, { local: false, lastModified: lastModified, remaining: remaining });
+ callback(e, root, data, sheet, { local: false, lastModified: lastModified, remaining: remaining }, href);
removeNode(document.getElementById('less-error-message:' + extractId(href)));
} catch (e) {
error(e, href);
@@ -180,8 +307,7 @@ function loadStyleSheet(sheet, callback, reload, remaining) {
function extractId(href) {
return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain
.replace(/^\//, '' ) // Remove root /
- .replace(/\?.*$/, '' ) // Remove query
- .replace(/\.[^\.\/]+$/, '' ) // Remove file extension
+ .replace(/\.[a-zA-Z]+$/, '' ) // Remove simple extension
.replace(/[^\.\w-]+/g, '-') // Replace illegal characters
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
}
@@ -190,7 +316,7 @@ function createCSS(styles, sheet, lastModified) {
var css;
// Strip the query-string
- var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : '';
+ var href = sheet.href || '';
// If there is no title set, use the filename, minus the extension
var id = 'less:' + (sheet.title || extractId(href));
@@ -202,7 +328,7 @@ function createCSS(styles, sheet, lastModified) {
if( sheet.media ){ css.media = sheet.media; }
css.id = id;
var nextEl = sheet && sheet.nextSibling || null;
- document.getElementsByTagName('head')[0].insertBefore(css, nextEl);
+ (nextEl || document.getElementsByTagName('head')[0]).parentNode.insertBefore(css, nextEl);
}
if (css.styleSheet) { // IE
@@ -299,7 +425,7 @@ function error(e, href) {
var template = '<li><label>{line}</label><pre class="{class}">{content}</pre></li>';
var elem = document.createElement('div'), timer, content, error = [];
var filename = e.filename || href;
- var filenameNoPath = filename.match(/([^\/]+)$/)[1];
+ var filenameNoPath = filename.match(/([^\/]+(\?.*)?)$/)[1];
elem.id = id;
elem.className = "less-error-message";
@@ -391,4 +517,3 @@ function error(e, href) {
}, 10);
}
}
-
View
74 WinLess/node_modules/less/lib/less/functions.js
@@ -5,8 +5,8 @@ tree.functions = {
return this.rgba(r, g, b, 1.0);
},
rgba: function (r, g, b, a) {
- var rgb = [r, g, b].map(function (c) { return number(c) }),
- a = number(a);
+ var rgb = [r, g, b].map(function (c) { return scaled(c, 256); });
+ a = number(a);
return new(tree.Color)(rgb, a);
},
hsl: function (h, s, l) {
@@ -32,6 +32,36 @@ tree.functions = {
else return m1;
}
},
+
+ hsv: function(h, s, v) {
+ return this.hsva(h, s, v, 1.0);
+ },
+
+ hsva: function(h, s, v, a) {
+ h = ((number(h) % 360) / 360) * 360;
+ s = number(s); v = number(v); a = number(a);
+
+ var i, f;
+ i = Math.floor((h / 60) % 6);
+ f = (h / 60) - i;
+
+ var vs = [v,
+ v * (1 - s),
+ v * (1 - f * s),
+ v * (1 - (1 - f) * s)];
+ var perm = [[0, 3, 1],
+ [2, 0, 1],
+ [1, 0, 3],
+ [1, 2, 0],
+ [3, 1, 0],
+ [0, 1, 2]];
+
+ return this.rgba(vs[perm[i][0]] * 255,
+ vs[perm[i][1]] * 255,
+ vs[perm[i][2]] * 255,
+ a);
+ },
+
hue: function (color) {
return new(tree.Dimension)(Math.round(color.toHSL().h));
},
@@ -56,8 +86,8 @@ tree.functions = {
luma: function (color) {
return new(tree.Dimension)(Math.round((0.2126 * (color.rgb[0]/255) +
0.7152 * (color.rgb[1]/255) +
- 0.0722 * (color.rgb[2]/255))
- * color.alpha * 100), '%');
+ 0.0722 * (color.rgb[2]/255)) *
+ color.alpha * 100), '%');
},
saturate: function (color, amount) {
var hsl = color.toHSL();
@@ -143,6 +173,11 @@ tree.functions = {
return this.desaturate(color, new(tree.Dimension)(100));
},
contrast: function (color, dark, light, threshold) {
+ // filter: contrast(3.2);
+ // should be kept as is, so check for color
+ if (!color.rgb) {
+ return null;
+ }
if (typeof light === 'undefined') {
light = this.rgba(255, 255, 255, 1.0);
}
@@ -179,27 +214,24 @@ tree.functions = {
str = str.replace(/%%/g, '%');
return new(tree.Quoted)('"' + str + '"', str);
},
+ unit: function (val, unit) {
+ return new(tree.Dimension)(val.value, unit ? unit.toCSS() : "");
+ },
round: function (n, f) {
var fraction = typeof(f) === "undefined" ? 0 : f.value;
- if (n instanceof tree.Dimension) {
- return new(tree.Dimension)(number(n).toFixed(fraction), n.unit);
- } else if (typeof(n) === 'number') {
- return n.toFixed(fraction);
- } else {
- throw { type: "Argument", message: "argument must be a number" };
- }
+ return this._math(function(num) { return num.toFixed(fraction); }, n);
},
ceil: function (n) {
- return this._math('ceil', n);
+ return this._math(Math.ceil, n);
},
floor: function (n) {
- return this._math('floor', n);
+ return this._math(Math.floor, n);
},
_math: function (fn, n) {
if (n instanceof tree.Dimension) {
- return new(tree.Dimension)(Math[fn](number(n)), n.unit);
+ return new(tree.Dimension)(fn(parseFloat(n.value)), n.unit);
} else if (typeof(n) === 'number') {
- return Math[fn](n);
+ return fn(n);
} else {
throw { type: "Argument", message: "argument must be a number" };
}
@@ -313,8 +345,16 @@ tree.functions = {
}
};
-function hsla(hsla) {
- return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
+function hsla(color) {
+ return tree.functions.hsla(color.h, color.s, color.l, color.a);
+}
+
+function scaled(n, size) {
+ if (n instanceof tree.Dimension && n.unit == '%') {
+ return parseFloat(n.value * size / 100);
+ } else {
+ return number(n);
+ }
}
function number(n) {
View
138 WinLess/node_modules/less/lib/less/index.js
@@ -1,9 +1,11 @@
var path = require('path'),
sys = require('util'),
+ url = require('url'),
+ http = require('http'),
fs = require('fs');
var less = {
- version: [1, 3, 0],
+ version: [1, 3, 3],
Parser: require('./parser').Parser,
importer: require('./parser').importer,
tree: require('./tree'),
@@ -41,9 +43,10 @@ var less = {
var error = [];
var stylize = options.color ? require('./lessc_helper').stylize : function (str) { return str };
- if (ctx.stack) { return stylize(ctx.stack, 'red') }
+ // only output a stack if it isn't a less error
+ if (ctx.stack && !ctx.type) { return stylize(ctx.stack, 'red') }
- if (!ctx.hasOwnProperty('index')) {
+ if (!ctx.hasOwnProperty('index') || !extract) {
return ctx.stack || ctx.message;
}
@@ -88,48 +91,121 @@ var less = {
'call', 'url', 'alpha', 'import',
'mixin', 'comment', 'anonymous', 'value',
'javascript', 'assignment', 'condition', 'paren',
- 'media', 'ratio'
+ 'media', 'ratio', 'unicode-descriptor'
].forEach(function (n) {
require('./tree/' + n);
});
+
+var isUrlRe = /^(?:https?:)?\/\//i;
+
less.Parser.importer = function (file, paths, callback, env) {
- var pathname;
-
- // TODO: Undo this at some point,
- // or use different approach.
- var paths = [].concat(paths); // Avoid passing paths by reference down the import tree...
- paths.unshift('.'); // ...which results on a lot of repeated '.' paths.
-
- for (var i = 0; i < paths.length; i++) {
- try {
- pathname = path.join(paths[i], file);
- fs.statSync(pathname);
- break;
- } catch (e) {
- pathname = null;
+ var pathname, dirname, data;
+
+ function parseFile(e, data) {
+ if (e) return callback(e);
+
+ var rootpath = env.rootpath,
+ j = file.lastIndexOf('/');
+
+ // Pass on an updated rootpath if path of imported file is relative and file
+ // is in a (sub|sup) directory
+ //
+ // Examples:
+ // - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',
+ // then rootpath should become 'less/module/nav/'
+ // - If path of imported file is '../mixins.less' and rootpath is 'less/',
+ // then rootpath should become 'less/../'
+ if(env.relativeUrls && !/^(?:[a-z-]+:|\/)/.test(file) && j != -1) {
+ rootpath = rootpath + file.slice(0, j+1); // append (sub|sup) directory path of imported file
}
- }
- if (pathname) {
- fs.readFile(pathname, 'utf-8', function(e, data) {
- if (e) return callback(e);
-
- env.contents[pathname] = data; // Updating top importing parser content cache.
- new(less.Parser)({
- paths: [path.dirname(pathname)].concat(paths),
+ env.contents[pathname] = data; // Updating top importing parser content cache.
+ new(less.Parser)({
+ paths: [dirname].concat(paths),
filename: pathname,
contents: env.contents,
+ files: env.files,
+ syncImport: env.syncImport,
+ relativeUrls: env.relativeUrls,
+ rootpath: rootpath,
dumpLineNumbers: env.dumpLineNumbers
- }).parse(data, function (e, root) {
- callback(e, root);
+ }).parse(data, function (e, root) {
+ callback(e, root, pathname);
+ });
+ };
+
+ var isUrl = isUrlRe.test( file );
+ if (isUrl || isUrlRe.test(paths[0])) {
+
+ var urlStr = isUrl ? file : url.resolve(paths[0], file),
+ urlObj = url.parse(urlStr),
+ req = {
+ host: urlObj.hostname,
+ port: urlObj.port || 80,
+ path: urlObj.pathname + (urlObj.search||'')
+ };
+
+ http.get(req, function (res) {
+ var body = '';
+ res.on('data', function (chunk) {
+ body += chunk.toString();
+ });
+ res.on('end', function () {
+ if (res.statusCode === 404) {
+ callback({ type: 'File', message: "resource '" + urlStr + "' was not found\n" });
+ }
+ if (!body) {
+ sys.error( 'Warning: Empty body (HTTP '+ res.statusCode + ') returned by "' + urlStr +'"' );
+ }
+ pathname = urlStr;
+ dirname = urlObj.protocol +'//'+ urlObj.host + urlObj.pathname.replace(/[^\/]*$/, '');
+ parseFile(null, body);
});
+ }).on('error', function (err) {
+ callback({ type: 'File', message: "resource '" + urlStr + "' gave this Error:\n "+ err +"\n" });
});
+
} else {
- if (typeof(env.errback) === "function") {
- env.errback(file, paths, callback);
+
+ // TODO: Undo this at some point,
+ // or use different approach.
+ var paths = [].concat(paths);
+ paths.push('.');
+
+ for (var i = 0; i < paths.length; i++) {
+ try {
+ pathname = path.join(paths[i], file);
+ fs.statSync(pathname);
+ break;
+ } catch (e) {
+ pathname = null;
+ }
+ }
+
+ paths = paths.slice(0, paths.length - 1);
+
+ if (!pathname) {
+
+ if (typeof(env.errback) === "function") {
+ env.errback(file, paths, callback);
+ } else {
+ callback({ type: 'File', message: "'" + file + "' wasn't found.\n" });
+ }
+ return;
+ }
+
+ dirname = path.dirname(pathname);
+
+ if (env.syncImport) {
+ try {
+ data = fs.readFileSync(pathname, 'utf-8');
+ parseFile(null, data);
+ } catch (e) {
+ parseFile(e);
+ }
} else {
- callback({ type: 'File', message: "'" + file + "' wasn't found.\n" });
+ fs.readFile(pathname, 'utf-8', parseFile);
}
}
}
View
7 WinLess/node_modules/less/lib/less/lessc_helper.js
@@ -23,7 +23,7 @@ var lessc_helper = {
//Print command line options
printUsage: function() {
- sys.puts("usage: lessc [options] <source> [destination]");
+ sys.puts("usage: lessc [option option=parameter ...] <source> [destination]");
sys.puts("");
sys.puts("If source is set to `-' (dash or hyphen-minus), input is read from stdin.");
sys.puts("");
@@ -36,7 +36,7 @@ var lessc_helper = {
sys.puts(" --verbose Be verbose.");
sys.puts(" -v, --version Print version number and exit.");
sys.puts(" -x, --compress Compress output by removing some whitespaces.");
- sys.puts(" --yui-compress Compress output using cssmin.js.");
+ sys.puts(" --yui-compress Compress output using ycssmin");
sys.puts(" -O0, -O1, -O2 Set the parser's optimization level. The lower");
sys.puts(" the number, the less nodes it will create in the");
sys.puts(" tree. This could matter for debugging, or if you");
@@ -47,6 +47,9 @@ var lessc_helper = {
sys.puts(" that will output the information within a fake");
sys.puts(" media query which is compatible with the SASS");
sys.puts(" format, and 'all' which will do both.");
+ sys.puts(" -rp, --rootpath Set rootpath for url rewriting in relative imports and urls.");
+ sys.puts(" Works with or withour the relative-urls option.");
+ sys.puts(" -ru, --relative-urls re-write relative urls to the base less file.");
sys.puts("");
sys.puts("Report bugs to: http://github.com/cloudhead/less.js/issues");
sys.puts("Home page: <http://lesscss.org/>");
View
191 WinLess/node_modules/less/lib/less/parser.js
@@ -1,4 +1,4 @@
-var less, tree;
+var less, tree, charset;
if (typeof environment === "object" && ({}).toString.call(environment) === "[object Environment]") {
// Rhino
@@ -68,19 +68,22 @@ less.Parser = function Parser(env) {
// Top parser on an import tree must be sure there is one "env"
// which will then be passed arround by reference.
var env = env || { };
- if (!env.contents) { env.contents={}; } // env.contents must be passed arround with top env
+ // env.contents and files must be passed arround with top env
+ if (!env.contents) { env.contents = {}; }
+ env.rootpath = env.rootpath || ''; // env.rootpath must be initialized to '' if not provided
+ if (!env.files) { env.files = {}; }
// This function is called after all files
// have been imported through `@import`.
var finish = function () {};
var imports = this.imports = {
- paths: env && env.paths || [], // Search paths, when importing
- queue: [], // Files which haven't been imported yet
- files: {}, // Holds the imported parse trees
- contents: env.contents, // Holds the imported file contents
- mime: env && env.mime, // MIME type of .less files
- error: null, // Error in parsing/evaluating an import
+ paths: env.paths || [], // Search paths, when importing
+ queue: [], // Files which haven't been imported yet
+ files: env.files, // Holds the imported parse trees
+ contents: env.contents, // Holds the imported file contents
+ mime: env.mime, // MIME type of .less files
+ error: null, // Error in parsing/evaluating an import
push: function (path, callback) {
var that = this;
this.queue.push(path);
@@ -88,18 +91,18 @@ less.Parser = function Parser(env) {
//
// Import a file asynchronously
//
- less.Parser.importer(path, this.paths, function (e, root) {
+ less.Parser.importer(path, this.paths, function (e, root, fullPath) {
that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
- var imported = path in that.files;
+ var imported = fullPath in that.files;
- that.files[path] = root; // Store the root
+ that.files[fullPath] = root; // Store the root
if (e && !that.error) { that.error = e }
callback(e, root, imported);
- if (that.queue.length === 0) { finish(e) } // Call `finish` if we're done importing
+ if (that.queue.length === 0) { finish(that.error) } // Call `finish` if we're done importing
}, env);
}
};
@@ -193,7 +196,10 @@ less.Parser = function Parser(env) {
}
function error(msg, type) {
- throw { index: i, type: type || 'Syntax', message: msg };
+ var e = new Error(msg);
+ e.index = i;
+ e.type = type || 'Syntax';
+ throw e;
}
// Same as $(), but don't change the state of the parser,
@@ -304,7 +310,7 @@ less.Parser = function Parser(env) {
chunk = chunks[0],
inParam;
- for (var i = 0, c, cc; i < input.length; i++) {
+ for (var i = 0, c, cc; i < input.length;) {
skip.lastIndex = i;
if (match = skip.exec(input)) {
if (match.index === i) {
@@ -319,7 +325,7 @@ less.Parser = function Parser(env) {
if (match.index === i) {
i += match[0].length;
chunk.push(match[0]);
- c = input.charAt(i);
+ continue;
}
}
@@ -330,7 +336,7 @@ less.Parser = function Parser(env) {
if (match.index === i) {
i += match[0].length;
chunk.push(match[0]);
- c = input.charAt(i);
+ continue;
}
}
}
@@ -343,12 +349,14 @@ less.Parser = function Parser(env) {
case ')': if ( inParam) { inParam = false; chunk.push(c); break }
default: chunk.push(c);
}
+
+ i++;
}
- if (level > 0) {
+ if (level != 0) {
error = new(LessError)({
- index: i,
+ index: i-1,
type: 'Parse',
- message: "missing closing `}`",
+ message: (level > 0) ? "missing closing `}`" : "missing opening `{`",
filename: env.filename
}, env);
}
@@ -357,7 +365,7 @@ less.Parser = function Parser(env) {
})([[]]);
if (error) {
- return callback(error);
+ return callback(error, env);
}
// Start with the primary rule.
@@ -419,7 +427,7 @@ less.Parser = function Parser(env) {
}
if (options.yuicompress && less.mode === 'node') {
- return require('./cssmin').compressor.cssmin(css);
+ return require('ycssmin').cssmin(css);
} else if (options.compress) {
return css.replace(/(\s)+/g, "$1");
} else {
@@ -460,6 +468,7 @@ less.Parser = function Parser(env) {
if (this.imports.queue.length > 0) {
finish = function (e) {
+ e = error || e;
if (e) callback(e);
else callback(null, root);
};
@@ -518,7 +527,7 @@ less.Parser = function Parser(env) {
while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
$(this.mixin.call) || $(this.comment) || $(this.directive))
- || $(/^[\s\n]+/)) {
+ || $(/^[\s\n]+/) || $(/^;+/)) {
node && root.push(node);
}
return root;
@@ -628,7 +637,8 @@ less.Parser = function Parser(env) {
return $(this.entities.ratio) ||
$(this.entities.dimension) ||
$(this.entities.color) ||
- $(this.entities.quoted);
+ $(this.entities.quoted) ||
+ $(this.entities.unicodeDescriptor);
},
// Assignments are argument entities for calls.
@@ -661,7 +671,7 @@ less.Parser = function Parser(env) {
expect(')');
return new(tree.URL)((value.value != null || value instanceof tree.Variable)
- ? value : new(tree.Anonymous)(value), imports.paths);
+ ? value : new(tree.Anonymous)(value), env.rootpath);
},
//
@@ -711,9 +721,10 @@ less.Parser = function Parser(env) {
//